This project implements a RESTful API using Django REST Framework to generate unique tracking numbers for parcels. The API ensures the generated tracking numbers follow a specified format, are unique, and can handle high concurrency and scalability.
- Generates unique tracking numbers that match the regex pattern
^[A-Z0-9]{1,16}$
- Ensures no duplicate tracking numbers are generated.
- Validates input fields using Django Rest Framework serializers
- API optimized for scalability and high concurrency
- Python 3.x
- Django 3.x or later
- Django REST Framework 3.x or later
git clone [email protected]:bhaskar8088/generate-tracking-number.git
# Create a new virtual environment
python -m venv venv
source venv/bin/activate
cd generate_tn_django
### Virtualenv
# Install requirements
pip install -r requirements.txt
# Run migrations
python manage.py migrate
# Run server
python manage.py runserver
GET http://localhost:8000/api/tracking_numbers/generate-tn/ in postman with the below query params:
origin_country_id
destination_country_id
weight
customer_id
customer_name
customer_slug
# Below is an example
origin_country_id=IN
destination_country_id=SG
weight=2
customer_id=62954f05-a05e-4b53-aabd-f35663e6e507
customer_name=sachin
customer_slug=sachin
Currently, its deployed to EC2
Here is the url: