Skip to content

VictorChukwudi/Logistics-API

Repository files navigation

Logistics API

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.

Features

  • User Authentication (Registration & Login) using Jsonwebtoken
  • Package Submission for delivery
  • Package Tracking
  • Automated Package Status Update

Technologies Used

Prerequisite

  1. Docker desktop

Installation

  1. Clone the repository
    git clone https://github.com/VictorChukwudi/Logistics-API.git
    
  2. Install dependencies
    cd Logistics-API
    npm install
    
  3. Build and run the docker container
  • For first time
     docker-compose up --build
    
  • Subsequently
      docker-compose up
    

API Endpoints

Authentication

  • POST /api/auth/register: Register a new user.
  • POST /api/auth/login: Login an existing user.

User Actions - submit, track and simulate automatic status update (Protected Using JWT)

  • 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.

Usage

  1. Register a new user using the /api/auth/register endpoint.
  2. Login with the registered user using the /api/auth/login endpoint to obtain an authentication token.
  3. Use the obtained token to access protected endpoints for user actions - submission, tracking of packages and automatically updating delivery status of packages.

Deploy

Click here to access a deployed version of this API

Documentation

Click here to get the full documentation of this API.

MOCK DATA

You can login with any of these login credentials to test with existing dummy data:

  1. email: [email protected] , password: 12345
  2. email: [email protected] , password: 12345
  3. email: [email protected] , password: 12345
  4. email: [email protected] , password: 12345
  5. email: [email protected] , password: 12345
  6. email: [email protected] , password: 12345
  7. email: [email protected] , password: 12345
  8. email: [email protected] , password: 12345

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published