https://github.com/frzam/short-url
Shrt-URL is used to build simple and reliable short links.
https://github.com/frzam/short-url
golang mongodb redis short-url
Last synced: 2 months ago
JSON representation
Shrt-URL is used to build simple and reliable short links.
- Host: GitHub
- URL: https://github.com/frzam/short-url
- Owner: frzam
- Created: 2020-06-19T12:11:59.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-13T08:32:47.000Z (almost 3 years ago)
- Last Synced: 2025-01-22T19:48:34.306Z (4 months ago)
- Topics: golang, mongodb, redis, short-url
- Language: Go
- Homepage: https://frzam.github.io/short-url/
- Size: 16.1 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Shorten Bulky Links
Shrt-URL
Build simple and reliable short links.
About |
Features |
API |
Installation |
License## About
> Short-URL is used to make six characters URL and it can be retrived at lightning speed. [Try it out.]( https://shrt-url.xyz/)It has an amazing API for getting the click details of each shorturl that has been clicked.
![]()
## Features
* Built **six** characters long links.
* **TSL** based encryptions for all the URLs.
* RESTful based API to get the click counts.
* API for getting click details which includes its IP, Location and TimeStamp etc.
* API supports searching click details by **city**, **country** or **IP**.
* Google **reCaptcha** is implemented to prevent from bots.## API
* #### Get all click details for particular shorturl.
```
https://shrt-url.xyz/api/v1/{shorturl}?skip=0&limit=100
```
**Example:** {shorturl} = 52ea82r. Try it out [here.](https://shrt-url.xyz)* #### Get all click details for particular shorturl for past N days.
```
https://shrt-url.xyz/api/v1/{shorturl}/{days}?skip=0&limit=100
```
**Example:** {shorturl} = 52ea82r *and* {days} = 7. Try it out [here.](https://shrt-url.xyz)* #### Delete all the details for a url.
```
https://shrt-url.xyz/api/v1/{shorturl}
```
**Example:** Method: *DELETE*. Try it out [here.](https://shrt-url.xyz)* #### Get all the click details by a country for one shorturl.
```
https://shrt-url.xyz/api/v1/{shorturl}/country/{country}
```
**Example:** {shorturl} = 52ea82r *and* {country} = India. Try it out [here.](https://shrt-url.xyz)* #### Get all the click details by a city for one shorturl.
```
https://shrt-url.xyz/api/v1/{shorturl}/city/{city}
```
**Example:** {shorturl} = 52ea82r *and* {city} = Powai. Try it out [here.](https://shrt-url.xyz)* #### Get all the click details by an IP for one shorturl.
```
https://shrt-url.xyz/api/v1/{shorturl}/ip/{ip}
```
**Example:** {shorturl} = 52ea82r. Try it out [here.](https://shrt-url.xyz)* #### Get total click count for one shorturl.
```
https://shrt-url.xyz/api/v1/{shorturl}/totalcount
```
**Example:** {shorturl} = 52ea82r. Try it out [here.](https://shrt-url.xyz)* #### Get click count for past N days for one shorturl.
```
https://shrt-url.xyz/api/v1/{shorturl}/totalcount/{days}
```
**Example:** {shorturl} = 52ea82r. Try it out [here.](https://shrt-url.xyz)* #### Get total click count from one IP for one shorturl.
```
https://shrt-url.xyz/api/v1/{shorturl}/ip/{ip}/totalcount/
```
**Example:** {shorturl} = 52ea82r. Try it out [here.](https://shrt-url.xyz)## Installation
To run the application you need to type below mentioned command.
```bash
go run main.go
```
To successfully run the application you need to set below mentioned environment variables on your system.```
primary_db_name =
primary_db_host =
primary_db_port =
cache_db_name =
cache_db_host =
cache_db_port =
host =
PORT =
ipstack_api_key = Ex: API Key for ipstack
env = DEV
fullchain= Ex: /path/fullchain.pem
privkey= Ex: /path/privkey.pem
private_token=Ex: Captcha Token.
```## License
Short-URL is provided under [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) license.