Prerequisites
- Docker
- docker-compose
Available APIs
- api-auth (For session based browsable APIs alone - for testing)
- Login
- Logout
- login (For Token based auth - returns a token if valid)
- api
- List parcels created with tracking number and other details
- Delete a parcel tracking based on tracking id
- Generate a random tracking ID given all mandatory data
Contains
- APIs
- UI - Frontend with Vue (added login, logout, create based on form, list and delete tracking IDs)
- Admin site - Add, Update and Delete Users who can login with Session/ Token based auth
- Browsable APIs
Admin Site:
- deployed: https://stcgapi-web.onrender.com/admin/
- local: http://127.0.0.1:8000/admin/
UI:
- deployed: https://stcgapi-web.onrender.com/parcel/
- local: http://127.0.0.1:8000/parcel/
Browsable APIs
- deployed:
- https://stcgapi-web.onrender.com/api/parcels/list/
- https://stcgapi-web.onrender.com/api/parcels//
- https://stcgapi-web.onrender.com/api/next-tracking-number/
- https://stcgapi-web.onrender.com/api/next-tracking-number/?origin_country_id=IN&destination_country_id=US&weight=1.0&order_created_at=2024-10-10T19:29:32%2B08:00&customer_id=de619854-b59b-425e-9db4-943979e1bd49&customer_name=GlobalLogistics&customer_slug=global-logistics
- local:
- http://127.0.0.1:8000/api/parcels/list/
- http://127.0.0.1:8000/api/parcels//
- http://127.0.0.1:8000/api/next-tracking-number/
- http://127.0.0.1:8000/api/next-tracking-number/?origin_country_id=IN&destination_country_id=US&weight=1.0&order_created_at=2024-10-10T19:29:32%2B08:00&customer_id=de619854-b59b-425e-9db4-943979e1bd49&customer_name=GlobalLogistics&customer_slug=global-logistics
Steps to Run on Local Machine:
- git clone <repo_url>
- copy .env.example to .env and update the values
- docker-compose -f docker-compose.yml up -d --build
- docker exec -it stcgapi-web bash
- python3 manage.py createsuperuser
- Navigate to UI URL or browsable API URL to access the application
Points to Note
- Added validations for all input fields
- Used redis for making the tracking id generation faster and scalable