Skip to content

luanfonsecap/shortner-url

 
 

Repository files navigation

Logo
Shortener URL

License MIT TypeScript Language Languages Code Quality

✨ Backend challenge proposed by Bemobi


💪 The Project

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.


🔥 Features

  • 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

⚗️ Tech Stack

  • NestJs
  • MongoDB
  • Mongoose
  • Date-fns
  • Jest
  • Docker

🚀 Run the project

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:

  1. Shorten a url with random alias
curl --request POST \
  --url 'http://localhost:3000/shorten/create?url=https%3A%2F%2Fwww.bing.com'
  1. 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'
  1. Retrieve and redirect client to full url
curl --request GET \
  --url http://localhost:3000/shorten/#alias aqui
  1. Retrieve list of most visited links
curl --request GET \
  --url http://localhost:3000/favorites

🚴 Roadmap

  • Docker
  • Integration tests
  • Swagger
  • Cache strategy
  • Microservices branch version
  • CI/CD Workflow


Made with 💜 by Luan Fonseca

About

Teste técnico para empresa Bemobi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 94.4%
  • JavaScript 4.7%
  • Dockerfile 0.9%