Cloud-Native Logistics & Fleet Management Platform
Overview β’ Submodules β’ Getting Started β’ Skaffold β’ Kubernetes
FleetOS is a comprehensive, cloud-native logistics management platform built with modern microservices architecture. It provides end-to-end fleet operations management, from vehicle tracking and driver management to shipment orchestration and inventory control.
This monorepo contains all microservices for the FleetOS application, built using the MERN stack (MongoDB, Express, React, Node.js) with TypeScript. Each service is containerized, independently deployable, and managed as a Git submodule. The platform leverages Kubernetes for orchestration and Skaffold for streamlined local development.
FleetOS follows Clean Architecture and Domain-Driven Design principles:
- Microservices: Independent, scalable services with clear boundaries
- Event-Driven: Asynchronous communication via Apache Kafka
- Multi-Tenant: Complete data isolation between organizations
- API Gateway: Centralized routing and authentication
- Service Mesh: Kong for API management
| Service | Port | Description | Tech Stack | Repository |
|---|---|---|---|---|
| Auth Service | 3001 | Central authentication and authorization service handling multi-tenant user management, JWT-based auth with refresh tokens, role-based access control (RBAC), OTP verification, and user invitation workflows. | Express, MongoDB, Redis, Argon2, InversifyJS | π GitHub |
| Fleet Service | 3004 | Vehicle and driver management service providing complete CRUD operations for fleet vehicles, driver profiles and onboarding, maintenance scheduling (preventive & reactive), and vehicle-driver assignment tracking. | Express, MongoDB, Redis, Clean Architecture | π GitHub |
| Inventory Service | 3003 | Warehouse and stock management service managing multi-warehouse inventory, real-time stock levels, automated stock reservations for shipments, stock transactions (IN/OUT/ADJUSTMENT/TRANSFER), and inter-warehouse transfers. | Express, MongoDB, Redis, DDD | π GitHub |
| Shipment Service | 3002 | Order fulfillment and delivery orchestration service handling end-to-end shipment lifecycle, automated inventory integration, driver assignments, real-time tracking with status updates, and multi-item shipment support. | Express, MongoDB, Axios | π GitHub |
| Notification Service | 3005 | Event-driven notification service consuming Kafka events for transactional emails (OTP verification, user invitations, password reset), HTML email templates with Nodemailer, and asynchronous processing with retry mechanisms. | Express, Kafka, Nodemailer, Winston | π GitHub |
| Module | Description | Tech Stack | Repository |
|---|---|---|---|
| Client (Frontend) | Modern, responsive web application providing role-based dashboards for Platform Admins, Tenant Admins, Operations Managers, and Drivers. Features include inventory management, fleet operations, shipment tracking, and real-time updates. | React 19, TypeScript, Vite, TailwindCSS, shadcn/ui, Redux Toolkit, TanStack Table | π GitHub |
| Shared | Centralized package for shared utilities, constants, enums, validators, and TypeScript types used across all microservices to ensure consistency and reduce code duplication. | TypeScript, Zod | π GitHub |
Before you begin, ensure you have the following installed:
- Node.js >= 20.x
- pnpm >= 9.x
- Docker Desktop (with Kubernetes enabled)
- kubectl - Kubernetes command-line tool
- Skaffold >= 2.x - For local development
- Clone the repository with submodules
git clone --recurse-submodules https://github.com/ijas9118/fleetOS.git
cd fleetOSIf you already cloned without submodules:
git submodule update --init --recursive- Install dependencies for each service
# Install dependencies for all services
cd services/auth-service && pnpm install && cd ../..
cd services/fleet-service && pnpm install && cd ../..
cd services/inventory-service && pnpm install && cd ../..
cd services/shipment-service && pnpm install && cd ../..
cd services/notification-service && pnpm install && cd ../..
cd client && pnpm install && cd ..Skaffold provides a streamlined development workflow with automatic rebuilding, redeploying, and log streaming.
- Fast Inner Loop: Automatic file sync for TypeScript changes without full rebuilds
- Live Reload: Changes reflect immediately in running containers
- Integrated Logging: Stream logs from all services in one terminal
- Simplified Workflow: Single command to start entire stack
- Ensure Docker Desktop Kubernetes is enabled
Go to Docker Desktop β Settings β Kubernetes β Enable Kubernetes
- Start development environment
skaffold devThis command will:
- Build Docker images for all services
- Deploy to your local Kubernetes cluster
- Set up file syncing for
src/**/*.tsfiles - Stream logs from all pods
- Automatically rebuild on file changes
- File Sync Configuration
Skaffold is configured to sync TypeScript files without rebuilding:
sync:
manual:
- src: 'src/**/*.ts'
dest: /appChanges to .ts files are synced instantly. For dependency changes (package.json), restart skaffold dev.
# Development mode with file sync and log streaming
skaffold dev
# Build and deploy without watching
skaffold run
# Build images only
skaffold build
# Deploy existing images
skaffold deploy
# Clean up all deployed resources
skaffold deleteIssue: "context deadline exceeded"
- Increase Docker Desktop resources (Memory >= 8GB)
- Check that all images can be pulled
Issue: File sync not working
- Verify the file path matches the sync pattern in
skaffold.yaml - Restart
skaffold dev
Issue: Services not starting
- Check pod logs:
kubectl logs -f <pod-name> -n fleet-os - Verify environment variables in config maps and secrets
FleetOS uses a namespace-based Kubernetes deployment:
fleet-os (namespace)
βββ Infrastructure
β βββ MongoDB (StatefulSet)
β βββ Redis (Deployment)
β βββ Kafka (StatefulSet)
βββ Core Services
β βββ Auth Service
β βββ Fleet Service
β βββ Inventory Service
β βββ Shipment Service
β βββ Notification Service
βββ Gateway
βββ Kong API Gateway
k8s/
βββ namespaces.yaml # Namespace definition
βββ infrastructure/ # Backing services
β βββ mongo.yaml # MongoDB StatefulSet
β βββ redis.yaml # Redis Deployment
β βββ kafka.yaml # Kafka broker
β βββ mongo-init-config.yaml # MongoDB init scripts
βββ core-services/ # Microservices
β βββ auth.yaml # Auth service deployment
β βββ auth-config.yaml # ConfigMap for auth
β βββ auth-secret.yaml # Secrets for auth
β βββ fleet.yaml
β βββ inventory.yaml
β βββ shipment.yaml
β βββ notification.yaml
βββ gateway/ # API Gateway
βββ kong.yaml
If not using Skaffold, deploy manually with kubectl:
# 1. Create namespace
kubectl apply -f k8s/namespaces.yaml
# 2. Deploy infrastructure
kubectl apply -f k8s/infrastructure/
# 3. Deploy core services
kubectl apply -f k8s/core-services/
# 4. Deploy gateway
kubectl apply -f k8s/gateway/View all resources:
kubectl get all -n fleet-osCheck pod status:
kubectl get pods -n fleet-osView service logs:
kubectl logs -f <pod-name> -n fleet-os
# Example
kubectl logs -f auth-service-7d9f8b6c4-xhjk2 -n fleet-osDescribe a pod (for debugging):
kubectl describe pod <pod-name> -n fleet-osExecute commands in a pod:
kubectl exec -it <pod-name> -n fleet-os -- /bin/shPort forward to access services:
# Forward local port to service
kubectl port-forward svc/auth-service 3001:3001 -n fleet-os
kubectl port-forward svc/mongo 27017:27017 -n fleet-osView ConfigMaps and Secrets:
kubectl get configmaps -n fleet-os
kubectl get secrets -n fleet-os
# View contents
kubectl describe configmap auth-config -n fleet-osRestart a deployment:
kubectl rollout restart deployment/auth-service -n fleet-osDelete all resources:
kubectl delete namespace fleet-osServices are exposed via ClusterIP by default. Use port forwarding to access:
# Auth Service
kubectl port-forward svc/auth-service 3001:3001 -n fleet-os
# Fleet Service
kubectl port-forward svc/fleet-service 3004:3004 -n fleet-os
# Inventory Service
kubectl port-forward svc/inventory-service 3005:3005 -n fleet-os
# Shipment Service
kubectl port-forward svc/shipment-service 3003:3003 -n fleet-os
# MongoDB (for database access)
kubectl port-forward svc/mongo 27017:27017 -n fleet-os
# Redis
kubectl port-forward svc/redis 6379:6379 -n fleet-osStream logs from all pods:
skaffold dev # Automatically streams all logsView specific service logs:
kubectl logs -f deployment/auth-service -n fleet-osView logs from all replicas:
kubectl logs -l app=auth-service -n fleet-os --all-containers=true -fEach service has its own test suite. Run tests individually:
cd services/auth-service
pnpm testOr run all tests:
# Run tests for all services
for dir in services/*/; do
(cd "$dir" && pnpm test)
done- JWT Authentication: RS256 asymmetric encryption
- Secrets Management: Kubernetes Secrets for sensitive data
- RBAC: Role-based access control across all services
- Multi-Tenancy: Complete data isolation per organization
- API Gateway: Centralized security with Kong
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.