Skip to content

About

Logistics engine with hexagonal architecture, AI, WebSockets, and event-driven processing

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🚚 OmniLogistics Core

A full-stack logistics platform built with modern architecture patterns, showcasing Clean Architecture in NestJS, React Native mobile app, and an admin dashboard.

TypeScript NestJS React Native Expo PostgreSQL MongoDB Turborepo License

✨ Features

  • Real-time Driver Tracking β€” WebSocket-based live location updates using Socket.IO
  • Trip Management β€” Full lifecycle from request to completion with fare calculation
  • Complaint System β€” AI-powered complaint analysis (Gemini integration)
  • Wallet System β€” Ledger-based financial operations with double-entry bookkeeping
  • Multi-role Authentication β€” Passport JWT for passengers, drivers, and admins
  • Background Jobs β€” BullMQ for trip completion and notification scheduling

πŸ—οΈ Architecture

omnilogistics-core/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ api/           # NestJS Backend (Clean Architecture)
β”‚   β”œβ”€β”€ mobile/        # Expo React Native App
β”‚   └── admin/         # Admin Dashboard
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ shared/        # Shared TypeScript types
β”‚   β”œβ”€β”€ db/            # Prisma Schema (PostgreSQL)
β”‚   └── config/        # ESLint, TypeScript, Prettier configs
β”œβ”€β”€ docs/              # Architecture documentation
└── turbo.json         # Monorepo orchestration

πŸš€ Quick Start

Prerequisites

  • Node.js 20+
  • npm 10+
  • Docker & Docker Compose

One-Command Setup

# Clone and setup everything automatically
git clone https://github.com/yourusername/omnilogistics-core.git
cd omnilogistics-core
./scripts/setup-local.sh

Manual Setup

# 1. Clone the repository
git clone https://github.com/yourusername/omnilogistics-core.git
cd omnilogistics-core

# 2. Start Docker services (PostgreSQL, MongoDB, Redis)
docker compose up -d

# 3. Install dependencies
npm install

# 4. Environment variables are created automatically by the setup script
# Or manually: cp .env.example .env

# 5. Generate Prisma client and run migrations
cd packages/db && npx prisma generate && npx prisma migrate deploy
cd ../..

Development

# Start all apps in development mode
npm run dev

# Start specific app
npm run dev --filter=api        # API only (http://localhost:3000)
npm run dev --filter=admin     # Admin only (http://localhost:5173)
cd apps/mobile && npm start    # Expo (requires Metro)

Build

# Build all apps
npm run build

# Type check all packages
npm run typecheck

# Lint all packages
npm run lint

Docker Services

Service Port Credentials
PostgreSQL 5432 postgres:postgres
MongoDB 27017 mongo:mongo
Redis 6379 No auth

Database: omnilogistics

Connection URL:

postgresql://postgres:postgres@localhost:5432/omnilogistics?schema=public

To stop services: docker compose down To reset data: docker compose down -v (deletes all data)

πŸ“± Apps

App Description Tech Stack
apps/api REST API + WebSocket server NestJS, MongoDB, PostgreSQL, Redis
apps/mobile Passenger & Driver app Expo, React Native, Zustand
apps/admin Admin dashboard React, Vite

πŸ“¦ Packages

Package Purpose
@omnilogistics/shared Shared TypeScript types and constants
@omnilogistics/db Prisma schema and database configuration
@omnilogistics/config Shared ESLint, TypeScript, Prettier configs

πŸ› οΈ Tech Stack

Backend

  • Framework: NestJS 11 with TypeScript strict mode
  • Databases: MongoDB (documents) + PostgreSQL (relational)
  • Cache/Queue: Redis + BullMQ
  • Real-time: Socket.IO
  • Auth: Passport JWT with bcrypt

Mobile

  • Framework: Expo SDK 54
  • State: Zustand for global state
  • Navigation: Expo Router (file-based routing)
  • API Client: Axios + React Query
  • Maps: React Native Maps with Google Maps API

DevOps

  • Monorepo: Turborepo 2.4
  • Linting: ESLint flat config
  • Code Quality: Prettier + Husky + Commitlint

πŸ“‚ Project Structure

apps/
β”œβ”€β”€ api/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ logistics/
β”‚   β”‚   β”‚   β”œβ”€β”€ domain/          # Entities, Value Objects, Ports
β”‚   β”‚   β”‚   β”œβ”€β”€ application/     # Use Cases, DTOs, Services
β”‚   β”‚   β”‚   └── infrastructure/   # Controllers, Adapters, Gateways
β”‚   β”‚   β”œβ”€β”€ shared/               # Cross-cutting concerns
β”‚   β”‚   └── main.ts
β”‚   └── test/
β”‚
β”œβ”€β”€ mobile/
β”‚   β”œβ”€β”€ app/                      # Expo Router screens
β”‚   β”‚   β”œβ”€β”€ (auth)/               # Auth screens
β”‚   β”‚   β”œβ”€β”€ (passenger)/          # Passenger screens
β”‚   β”‚   └── (driver)/             # Driver screens
β”‚   β”œβ”€β”€ components/               # Reusable UI components
β”‚   β”œβ”€β”€ services/                 # API integration
β”‚   β”œβ”€β”€ store/                    # Zustand stores
β”‚   └── constants/                 # App constants
β”‚
└── admin/
    β”œβ”€β”€ index.html
    β”œβ”€β”€ styles.css
    └── app.js

πŸ”Œ API Endpoints

Method Endpoint Description
POST /auth/login User authentication
POST /auth/register User registration
GET /trips List all trips
POST /trips Create new trip
GET /trips/:id Get trip details
PATCH /trips/:id Update trip status
POST /complaints Submit complaint
GET /complaints List complaints
PATCH /complaints/:id Update complaint status
WS /tracking Real-time driver location

πŸ“– Documentation

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is proprietary and unlicensed.


Built with πŸ’œ using NestJS, React Native, and Turborepo

About

Logistics engine with hexagonal architecture, AI, WebSockets, and event-driven processing

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages