All Projects → garaekz → goshort

garaekz / goshort

Licence: MIT License
Golang URL Shortener

Programming Languages

go
31211 projects - #10 most used programming language
Vue
7211 projects
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to goshort

slam-mirrorbot
Aria/qBittorrent Telegram mirror/leech bot.
Stars: ✭ 1,072 (+4023.08%)
Mutual labels:  shortener
Base62
PHP Base62 encoder and decoder for integers and big integers with Laravel 5 support.
Stars: ✭ 16 (-38.46%)
Mutual labels:  shortener
urlshortener-rs
A very-very simple url shortener for Rust
Stars: ✭ 34 (+30.77%)
Mutual labels:  shortener
dwarf
A O(1) URL shortener microservice backed by redis and gRPC communication.
Stars: ✭ 33 (+26.92%)
Mutual labels:  shortener
ruby-bitly
A simple bit.ly ruby client to shorten URLs, expand or get number of clicks on a bitlink.
Stars: ✭ 17 (-34.62%)
Mutual labels:  shortener
yii2-minify-url
Project on YII2 framework for create short url (url shortener)
Stars: ✭ 15 (-42.31%)
Mutual labels:  shortener
small-sh
Um encurtador de URL's gratuito e Open source. Torne suas URL's um tanto pequenas forma rápida e gratuita
Stars: ✭ 30 (+15.38%)
Mutual labels:  shortener
urlzap
⚡️ Your own static URL shortener
Stars: ✭ 57 (+119.23%)
Mutual labels:  shortener
node-bypasser
Bypass URL shortener websites
Stars: ✭ 33 (+26.92%)
Mutual labels:  shortener
gShort
URL Shortener without all the crap
Stars: ✭ 80 (+207.69%)
Mutual labels:  shortener
ursho
URL Shortener Service in Go
Stars: ✭ 118 (+353.85%)
Mutual labels:  shortener
YOURLS
🔗 The de facto standard self hosted URL shortener in PHP
Stars: ✭ 9,007 (+34542.31%)
Mutual labels:  shortener
ksana.in
✂️ Layanan pemendek tautan yang mudah, gratis & tanpa iklan
Stars: ✭ 186 (+615.38%)
Mutual labels:  shortener
bifrost
🌉 The rainbow bridge. URL shortener for Vercel.
Stars: ✭ 28 (+7.69%)
Mutual labels:  shortener
snip
✌️ The simple, no-bs link shortener
Stars: ✭ 33 (+26.92%)
Mutual labels:  shortener

GoShort

Build Status Go Report Card

enter image description here

GoShort is a simple Golang API URL Shortener, started as a learning project it gave me a nice time building the first version, I'll try to update it often with new ideas and functionality, one of the things I wanna do first is use Redis + MySQL to balance the load of the current MySQL database, the second thing I wanna do is restructure the files in order to make it easier to mantain. Hope you people like this and I'm open to new ideas, just remember this is just the server part, the client will be public soon, some tutorial will be public soon on my blog this project's now on the second version, I now restructured all the code and I laid the foundations to new cool features, I´ll try to add user registration and IP throttle in order to expand this tool use and functionality.

Setup

  • Install dependencies: go get -u ./...

  • Go to config/local.yml and set up your required info

    • db_type: "postgres" if you don't set this up it will fall back to mysql
    • dsn: "user:pass@tcp(127.0.0.1)/goshort?charset=utf8&parseTime=true&loc=Local" it needs to a be a valid DSN, this example is based on a mysql connection where 127.0.0.1 is the host.
    • jwt_signing_key: "RandomHS256-HMAC_JWTKey" this is needed in order to work.
  • Copy .env.example and save it as .env

  • Edit .env file with your PORT and DATABASE_URL info`

  • Install VueJS dependencies: npm install

  • Compile frontend: npm run build

  • Build: go build cmd/server/main.go -o goshortyou can user whichever name you want, remember using .exe if you're building this for Windows systems.

  • Run the server: ./goshortAgain, .exe if you're using Windows.

API

Currently has just two basic functions, search the original URL by a given code and store new URL's randomly generating unique codes.

Get the original URL

GET /:code

This code is used to redirect to original URL, if not found shows a 404 Page.

Submit a URL to shorten

POST /v1/links

Body:

{
    "url": "https://www.example.com/lets-see-if-this-works"
}

Returns:

  {
    "url": {
        "code": "pJ7V",
        "original_url": "https://www.example.com/lets-see-if-this-works",
        "created_at":  "2021-04-13T06:33:47.112707Z"
    }
}

TO DO

  • Make the redirection in the main route
  • Make a delete route
  • Make guest and member URL's
  • Make a route to fetch all the member URL's
  • Social login
  • Make GoShort client with VueJS
  • Implement Redis to search by code
  • Implement visit count
  • Implement QR Code
  • Visual changes (add brand)
  • Implement local storage history to guests
  • Implement throttle by IP
  • Add LICENSE
  • Add CHANGELOG.md
  • Add CI/CD to the workflow

Compatibility

The project frontend is built with VueJS, that means ES6 syntax is the standard used, some browsers may not be compliant to this standard yet, thus some issues may arise, we've been notified about a bug happening in iPhone 6s with Safari, following that trace we find the same issue in IE11, we've managed to fix IE11 issue but couldn't reproduce the issue in iPhone 6s yet.

This issue may be found (or not) in browsers not fully compliant with ECMAScript 2015 (ES6), we added babel-polyfill to handle this issue but we cannot guarantee that the problem will not arise again in older browsers.

Thanks to Yan Edy Chota Castillo who first encountered this bug in production!

Changelog

You can see all our realeases in the changelog

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].