This project builds a url shortener using FastAPI, Postgres, and Redis. The goal is to build a simple url shortener that can be used to shorten urls and redirect to the original url.
The solution is built using docker-compose. To run the solution, you will need to have docker and docker-compose installed on your machine. Once you have docker and docker-compose installed, you can run the following command to start the solution:
Copy the content of .env.sample into a new file called .env and update the values of the environment variables.
docker compose up --build
Then you can access the solution at http://localhost:8000/docs
You can call the api/v1/urls endpoint to create a new short url. You can also call the api/v1/urls/code/{code} endpoint to get the original url object by the code, and api/v1/urls/get-url/redirect?short_url=[some url] to get the objects by the short url itself.