Skip to content

RiyaRaj28/Konnect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation


Konnect - A Modern Day Logistics Platform






About The Project

image image image image image image image image image image image

Logistics Platform - Overview

This logistics platform is designed for connecting clients to vehicle drivers using a microservices architecture, focusing on modular, scalable, and efficient systems for real-time tracking, booking, and driver management.

Key Features

  1. Microservices Architecture Independent Services: Booking, driver management, and real-time tracking are separated, allowing for independent scaling and maintenance. Trade-offs: Easier scalability but added complexity in communication and data consistency handled via REST APIs and message queues.

  2. Real-time Updates with WebSockets WebSockets (Socket.io): Used for low-latency real-time driver location updates. Challenges: Handling scalability of concurrent WebSocket connections.

  3. Asynchronous Job Processing BullMQ: Used for async job handling (e.g., driver assignment), improving responsiveness. Retries & Error Handling: Built-in support for retries and task prioritization.

  4. Caching & Data Management Redis: For caching driver data, improving read performance and reducing database load. Cron Job: Driver ratings are updated daily via a scheduled cron job to ensure rating accuracy.

  5. Scalability & Traffic Management Database Optimization: Indexed fields and MongoDB geospatial queries for efficient nearest-driver searches. Rate Limiting: Prevents abuse by limiting API requests. Stateless Backend: Backend is stateless, allowing easy horizontal scaling.

  6. Surge Price Tracking Price tracking based on the distance between the two coordinates.

  7. Future Scalability Kubernetes: Planned for container orchestration, enabling auto-scaling and self-healing services. Multi-region Deployment: Support for global multi-region deployment, reducing latency and improving fault tolerance.

(back to top)

Technologies Used

Frontend

  • React: Used for building the user interface.
  • React Router: For client-side routing.
  • Leaflet & React-Leaflet: Used for mapping and location-based services.
  • Axios: For making HTTP requests.

Backend

  • Node.js & Express: Backend framework for handling requests and routing.
  • MongoDB & Mongoose: Database and ORM for storing and managing data.
  • JWT (jsonwebtoken): For handling user authentication and security.
  • Zod: For schema validation.
  • Bcryptjs: For hashing passwords.
  • Cronjon: For updating driver ratings every 24 hours.
  • Bullmq: For assigning drivers through a queue system.
  • Redis: For caching of driver and current session data.

Installation

Prerequisites

  • Node.js: Ensure you have Node.js installed on your system.

Steps

  1. Fork the Repository

  2. Clone the Repository:

    git clone ${url_of_your_forked_repo}
    cd logistics-platform
  3. Setup the Client:

    cd frontend
    npm install
  4. Setup the Server:

    cd ../backend
    npm install
  5. Create a .env File:

    • In the backend directories, create a .env file and add the necessary environment variables.

    • Example for server/.env:

      MONGO_URI=your_mongodb_uri
      JWT_SECRET_KEY=your_jwt_secret_key
      GOOGLE_API_KEY=your_google_api_key
      SESSION_SECRET=your_secret
      

Run the Application

  1. Start the backend

    cd backend
    npm run dev
  2. Start the frontend

    cd ../frontend
    npm run start

Access the application

(back to top)

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors