This is a project responsible for shortening URLs.
- Python (~3.10) + FastAPI ๐
- Docker + docker-compose ๐
A report is provided at ./docs directory along with a load test result.
-
Clone the repo
git clone [email protected]:victormartinez/urlshorten.git
-
Create a
.env
file fromenv.sample
-
Install the dependencies
cd urlshorten/ poetry install
-
Split the terminal and execute the commands below:
# first terminal make up # second terminal make run
- Application: http://127.0.0.1:8000
- API Doc: http://127.0.0.1:8000/docs
- PGAdmin (user:
[email protected]
pass:postgres
): http://127.0.0.1:8080
Load test is performed using k6.io and the setup script is available at ./tests/load/script.js.
-
Build the container images
make load-test-build
-
Start containers
make load-test-up
-
Run the load test (requires k6.io)
make load-test
Makefile makes available most used commands.
make help
make format
make coverage
make unit-test
make integration-test