This project is a logistics API built with Node.js, Express, Typescript, Postgresql, Typeorm and Docker. It provides functionalities for user registration, login, submission of packages for delivery, tracking packages,etc.
- User Authentication (Registration & Login) using Jsonwebtoken
- Package Submission for delivery
- Package Tracking
- Automated Package Status Update
- Node.js: JavaScript runtime environment for server-side development. (https://nodejs.org/en)
- Express.js: Web framework for building APIs with Node.js. (https://expressjs.com/)
- Typescript: Superset of JavaScript that adds static typing for improved code maintainability. (https://www.typescriptlang.org/docs)
- Postgresql: SQL database for storing user information and packages. (https://www.mongodb.com/)
- Typeorm: Typescript based ORM for SQL fast, quick and easy SQL database transactions (https://typeorm.io/)
- Docker: Service for application containerization (https://docker.com)
- Docker desktop
- Clone the repository
git clone https://github.com/VictorChukwudi/Logistics-API.git
- Install dependencies
cd Logistics-API npm install
- Build and run the docker container
- For first time
docker-compose up --build
- Subsequently
docker-compose up
POST /api/auth/register:
Register a new user.POST /api/auth/login:
Login an existing user.
POST /api/packages/submit:
Submit a package for delivery.GET /api/packages/:packageId:
Track a package delivery status - pending, in-transit, out-for-delivery, delivered.POST /api/packages/:packageId/update:
To simulate automatic package status update every 2 minutes.GET /api/packages/:
Gets all packages.
- Register a new user using the /api/auth/register endpoint.
- Login with the registered user using the /api/auth/login endpoint to obtain an authentication token.
- Use the obtained token to access protected endpoints for user actions - submission, tracking of packages and automatically updating delivery status of packages.
Click here to access a deployed version of this API
Click here to get the full documentation of this API.
You can login with any of these login credentials to test with existing dummy data:
- email: [email protected] , password: 12345
- email: [email protected] , password: 12345
- email: [email protected] , password: 12345
- email: [email protected] , password: 12345
- email: [email protected] , password: 12345
- email: [email protected] , password: 12345
- email: [email protected] , password: 12345
- email: [email protected] , password: 12345