Skip to content

skang/tinyurl

Repository files navigation

TinyURL

Build Status Go Report Card GoDoc


Live Demo

a url shorten web service written by Golang, Vue and Gin.

Requisites

  • Golang(1.8+)
  • Govendor
  • MySQL/Sqlite3
  • make

Quick Start

  1. clone project to GOPATH
git clone https://github.com/tinyurl/tinyurl.git $GOPATH/src/github.com/tinyurl/tinyurl
  1. sync golang packages
govendor sync
  1. build binary
make
  1. change config in default.properties
# tinyurl dev config
#app
app.host=0.0.0.0
app.port=8877
app.domain=0.0.0.0:8877

# db config
db.type=sqlite3
db.path=.
db.host=
db.port=
db.name=tinyurldb
db.user=
db.password=
  1. run binary
./tinyurl -config default.properties
  1. open index.html in frontend/ with broswer

TODOs

  • validate input url format
  • improve random generate string algorithm
    • use math/rand.Read instead math/rand.Intn func
  • use logrus replace golang log lib
  • reserch wrk
  • add test case
  • Backend
    • data type support multi database(index in sender)
    • adjust short path generating algorithm
    • API rate
    • Swagger for api management
    • Admin account?
    • count each url parse time (high concurrent situation)
    • custom short url
  • Frontend
    • qrcode support

Reference

About

a fork of tinyurl/tinyurl for bug fixes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published