A light weight load shipping platform built with TypeScript using the clean architecture and Domain Driven Design and SOLID principles.
LoadLink aims to address the high cost of shipping for small and lightweight goods, making it more affordable for both vendors and customers. LoadLink achieves this by connecting travelers who are embarking on journeys with available space to vendors in need of cost-effective shipping solutions. Travelers can carry goods for vendors during their trips, reducing shipping costs significantly.
-
Fork the this repositiry and clone your forked version of the repo.
-
cdinto the repository folder. -
Copy the
.envexample file. Supply the neccessary details, feel free to change passwords and app secrets.
cp .env.example .env- Install dependencies.
npm install- Start the project in dev mode with:
npm run devYou can visit the app by going to http://localhost:3000.
Note: This project is currently under active development, and additional features and improvements will be added.
- Node.js
- Mongoose - The Object Data Modeling (ODM) library for MongoDB
- Express.js - Lightweight webserver
- Redis - For holding onto JWT tokens and refresh tokens
- Javascript
- HTML
- CSS
To separate concerns, the application was built with a Clean Architecture. It is divided into Domain, Application, Infrastructure layers and the User Interface which constitute part of the frontend.
Clean Architecture: This architecture ensures a clear separation of logic, preventing the mixing of infrastructure and domain code. It enhances maintainability and scalability.
DDD: DDD divides our application into subdomains, focusing on core concepts and their related concerns, promoting a cohesive codebase for better organization.
The User subdomain focuses on user-related concepts, including authentication, roles, identity, access management, and more. Here are some of the key concepts that will exist within this subdomain at each architectural layer:
-
Domain Layer:
- User (Aggregate Root)
- UserEmail (Value Object)
- UserCreated (Domain Event)
-
Application Layer:
- CreateUserUseCase (Use Case)
- GetUserByUserName (Use Case)
-
Adapter Layer:
- IUserRepo (Repository Interface Adapter)
-
Infrastructure Layer:
- MongooseUserRepo (Concrete Implementation using Mongoose)
- UserDTO (Data Transmission Objects)
The Shipping subdomain is primarily concerned with the process of creating shipments and shipping products. The concepts within this subdomain do not overlap with those in the User subdomain. Here are some key concepts related to the Shipping subdomain:
-
Domain Layer:
- Sender (or Vendor)
- Traveler
- Shipment
- Location
-
Application Layer:
- CreateShipmentUseCase (Use Case)
- ShipProductUseCase (Use Case)
- FindTravelersForShipmentUseCase (Use Case)
-
Adapter Layer:
- ISenderRepo (Repository Interface Adapter)
- ITravelerRepo (Repository Interface Adapter)
- IShipmentRepo (Repository Interface Adapter)
- ILocationRepo (Repository Interface Adapter)
-
Infrastructure Layer:
- MongooseSenderRepo (Concrete Implementation using Mongoose)
- MongooseTravelerRepo (Concrete Implementation using Mongoose)
- MongooseShipmentRepo (Concrete Implementation using Mongoose)
- MongooseLocationRepo (Concrete Implementation using Mongoose)
-
/users
- /api/v1/users
- POST: Create a new user account.
- Description: Clients can use this endpoint to register new users in the system.
- POST: Create a new user account.
- /api/v1/users/me
- GET: Allow users to login
- Description: This endpoint allows you to login to your account.
- GET: Allow users to login
- /api/v1/users/login
- POST: Create a new user account.
- Description: Clients can use this endpoint to register new users in the system.
- POST: Create a new user account.
- /api/v1/users
-
/travelers
- /api/v1/travelers
- GET: Retrieve a list of available travelers.
- Description: Clients can request a list of travelers who are available for shipping.
- GET: Retrieve a list of available travelers.
- /api/v1/travelers/pair
- POST: Connect a user with a traveler for shipping.
- Description: Users can create shipping requests and connect with travelers for the transportation of goods.
- POST: Connect a user with a traveler for shipping.
- /api/v1/travelers
-
/shipments
- /api/v1/shipments
- POST: Create a shipment.
- Description: Travelers can create shipments after accepting requests for shipping.
- POST: Create a shipment.
- /api/v1/shipments
- GET: Retrieve a list of available shipments.
- Description: Users and Travelers can request a list of the shipments they created.
- GET: Retrieve a list of available shipments.
- /api/v1/shipments/cancel
- POST: Cancel a shipment.
- Description: Users can cancel shipments before the journey starts.
- POST: Cancel a shipment.
- /api/v1/shipments/received
- POST: Mark shipment as delivered.
- Description: Users can mark a shipment as delivered after goods have been received.
- POST: Mark shipment as delivered.
- /api/v1/shipments
-
/locations
-
/api/v1/location
- POST: Receive geolocation data from travelers.
- Description: Travelers can update the current location of the shipment.
- POST: Receive geolocation data from travelers.
-
GET: Get location history.
- Description: This endpoint provides a list of the major locations of the shipment.
-
Incorporate your updated data model to reflect DDD and Clean Architecture:
- User
- Traveler
- Shipment
- Location
- UserName
- UserEmail
- UserId
- UserPassword
- Latitude
- Longitude
- Description
- AccountNumber
- BankName
- Amount
As a user, I want to create an account on LoadLink to access its features.
As a user, I want to search for available travelers who can transport my goods, specifying the destination, pickup, and delivery times.
As a traveler, I want to view and accept shipping requests from users for trips I plan to make.
As a user, I want to see my shipping history, including past shipments, to keep track of my transactions.
Contributions are welcome! Open issues, bugs, and enhancements are all listed on the issues tab and labeled accordingly. Feel free to open bug tickets and make feature requests.
Below is the list of people who has made contributions to the this repo:
![]() Bobson Prosper 💻 |


.png)
.png)
.png)
