URL Shortener app based on microservices, REST API and Celery task queue.
Supported operations:
- Creating shortened urls
- Creating shortened urls
- Deleting shortened urls
- Using shortened url unique squid to redirect user to original path
URL Shortener app supports creating shortened urls that consist of following data:
{
"id": <Django instance id>,
"name": <Short name>,
"url": <Shortened url original path>,
"urlSquid": <unique squid>,
"createdAt": <Shortened url creation datetime>",
"updatedAt": <Shortened url creation datetime>",
"shortUrl": <App redirection url>"
}
To interact with shortened urls use Django REST framework API explorer or available API documentation views.
To create new shortened url use available HTML form or insomnia/postman client.
Accessing the app using valid shortened url urlSquid
as resource will redirect the user to short url original path.
i.e. localhost:8001/gbHJdmfrXB/ (As long as you've loaded local fixtures).
You can also just copy shortened url shortUrl
property and use it directly in your browser.
Creating, updating and removing shortened urls is processed using celery worker.
Check API URLs documentation to see all available API endpoints.
- Docker: 20.10.7
- docker-compose: 1.29.2
- Python: 3.11.7
- Django: ~4.2
- djangorestframework: ^3.15.0
- celery: ^5.3.6
- postgresql: 16
- redis: latest
- Docker: ^24.0.2
- docker-compose: ^2.18.1
- make
To run this project locally cd
into the project directory and use following make commands:
$ make build-dev
# Builds docker containers
$ make dev
# Starts containers for local development
$ make exec-backend
# enters backend container shell via bash
$ make test-backend
# runs backend tests inside container
$ make clean
# enforce isort and black rules on the backend/src
- Ensure the backend service is running
- Execute make file command
$ make load-local-fixtures
# loads local development data from backend/fixtures/development directory