A fully dockerized, self-hostable link shortening web application.
Built with NodeJS, TypeScript, and MongoDB.
- Validation upon creation (duplicates, invalid URLs, redirect loops, etc.)
- Dockerized NodeJS and MongoDB
- Live reload and compilation of TypeScript files
- Custom URL expiry
- User registration to add/modify/delete URL redirects
- Rate limiting
- Click/Impression tracking
- Clone this repo:
git clone https://github.com/jengmicah/url-shortener.git
- Duplicate
.env.example
and rename to.env
- Set
SERVER_URI
to server host- Note that the port of
SERVER_URI
corresponds with the exposed host port indocker-compose.yml
(host:container) - The exposed port in
Dockerfile
corresponds with the exposed container port indocker-compose.yml
(host:container) as well as the server port specified insrc/index.ts
.
- Note that the port of
- Set
NODE_ENV
todevelopment
orproduction
- Set
- Run
./_build.sh
to run thedocker-compose.yml
- May need to run
chmod +x _build.sh
beforehand
- May need to run