FleetCo is a technology-driven solution transforming fleet management in Tanzania. Our platform integrates vehicle tracking, fuel monitoring, and location-based analytics to help businesses reduce costs, improve efficiency, and ensure compliance.
# Fleet Management System
Comprehensive fleet management application for tracking vehicles, managing drivers, monitoring trips, and analyzing fleet operations in real-time.
## Features
- **Vehicle Management**: Track and manage fleet vehicles with detailed information
- **Driver Management**: Manage driver profiles, licenses, and assignments
- **Trip Tracking**: Monitor trips with real-time location updates
- **Maintenance Scheduling**: Track vehicle maintenance and service history
- **Fuel Management**: Monitor fuel consumption and costs
- **User Management**: Role-based access control for team members
- **Real-time Tracking**: Live vehicle location updates via WebSocket
- **Analytics Dashboard**: Comprehensive fleet insights and reports
- **Multi-tenant**: Company-based data isolation
## Prerequisites
- Node.js 18+ and pnpm
- PostgreSQL database (shared with fleet-management-portal)
- IoT Backend server (for real-time vehicle tracking)
- Resend API key (for password reset emails)
## Installation
1. **Clone the repository**
```bash
git clone
cd fleetmanagement
```
2. **Install dependencies**
```bash
pnpm install
```
3. **Set up environment variables**
```bash
cp .env.example .env
```
Edit `.env` and configure:
```env
# Database (shared with admin portal)
LOCAL_DATABASE_URL=postgresql://user:password@host:port/database
# Auth Secrets (generate with: openssl rand -base64 32)
AUTH_SECRET=your-auth-secret-key-here
JWT_SECRET=your-jwt-secret-key-here
# Email Service
RESEND_API_KEY=re_your_resend_api_key_here
# Backend API
BACKENDBASE_URL=
http://your-production-back…
LOCAL_BACKENDBASE_URL=
localhost
# IoT Backend (Real-time Tracking)
NEXT_PUBLIC_IOT_BACKEND_URL=
localhost
NEXT_PUBLIC_IOT_WEBSOCKET_URL=ws://localhost:3002/ws
```
4. **Set up the database**
```bash
# Generate migration files
pnpm drizzle-kit generate
# Run migrations
pnpm drizzle-kit migrate
```
5. **Ensure you have a company and user set up**
- Use …