✨ Backend challenge proposed by Bemobi
Shortener URL is an application that shortens URLs provided by any client through http requests, creating a randomly generated or provided alias, and also retrieves and redirects a client to an original URL when a valid short URL is requested.
- Shorten a url with a random
alias
- Shorten a url with a custom
alias
- Retrieve and redirect client to full url
- Retrieve list of most accessed links
- NestJs
- MongoDB
- Mongoose
- Date-fns
- Jest
- Docker
You need to have the docker environment configured and Yarn installed.
To start the application, clone this repository and run the commands below:
cd shortener-url
docker-compose up -d --build
Inside the docs/api
directory you will find a JSON file to import into Insomnia to make the requests.
Or, you can run the following commands in the terminal:
- Shorten a url with random
alias
curl --request POST \
--url 'http://localhost:3000/shorten/create?url=https%3A%2F%2Fwww.bing.com'
- Shorten a url with custom
alias
curl --request POST \
--url 'http://localhost:3000/shorten/create?url=https%3A%2F%2Fwww.bing.com&alias=my_custom_alias'
- Retrieve and redirect client to full url
curl --request GET \
--url http://localhost:3000/shorten/#alias aqui
- Retrieve list of most visited links
curl --request GET \
--url http://localhost:3000/favorites
- Docker
- Integration tests
- Swagger
- Cache strategy
- Microservices branch version
- CI/CD Workflow