Skip to content

atuljha-tech/Logistics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SmartLogistics πŸš€πŸŒ

Landing Page

AI-Powered Supply Chain Operating System

Modern logistics platform with real-time tracking, predictive analytics, and intelligent route optimization

Next.js TypeScript Tailwind CSS Framer Motion Express Supabase

Features β€’ Screenshots β€’ Tech Stack β€’ Getting Started β€’ API Docs


πŸ“– About The Project

SmartLogistics is a next-generation supply chain management platform that reimagines how businesses track, analyze, and optimize their logistics operations. Built with cutting-edge technologies, it combines real-time tracking, AI-powered route recommendations, predictive analytics, and an intuitive role-based dashboard system.

Whether you're managing a fleet of delivery vehicles, coordinating international shipments, or optimizing warehouse operations, SmartLogistics provides the tools and insights you need to make data-driven decisions and improve operational efficiency.

🎯 Why SmartLogistics?

  • Real-Time Visibility: Track every shipment from origin to destination with live GPS updates
  • AI-Powered Intelligence: Gemini AI analyzes weather, traffic, and route conditions to recommend optimal paths
  • Predictive Analytics: Identify risks before they become problems with advanced forecasting
  • Role-Based Access: Tailored experiences for administrators, operators, and end users
  • Production-Ready: Built with enterprise-grade architecture, fallback systems, and error handling

✨ Key Features

πŸŽ›οΈ Dynamic Role-Based Dashboards

  • Admin Dashboard: Complete system oversight with user management, shipment approvals, system analytics, and alert monitoring
  • User Dashboard: Personalized view with my shipments, tracking, notifications, performance metrics, and action items
  • Seamless Role Switching: Toggle between admin and user views with a single click

πŸ€– AI Route Optimization (Gemini API)

  • 5-Key Fallback System: Automatic rotation through 5 Gemini API keys with intelligent cooldown management
  • Weather Integration: Real-time weather analysis using WeatherAPI.com (rainfall, wind, visibility, storms)
  • Smart Recommendations: AI suggests optimal routes considering safety, speed, and risk factors
  • Rule-Based Fallback: When all API keys are exhausted, intelligent rule-based logic provides recommendations
  • Caching System: 10-minute result caching per shipment to optimize API usage

πŸ“Š Advanced Analytics & Visualization

  • Interactive Charts: Revenue trends, efficiency metrics, and performance indicators using Recharts
  • Risk Prediction: ML-based risk scoring for each shipment based on weather, traffic, and route conditions
  • Performance Rings: Animated circular progress indicators showing delivery accuracy, response time, and documentation quality
  • Real-Time Statistics: Live counters for active shipments, in-transit packages, and delivery rates

πŸ—ΊοΈ Supply Chain Tracking

  • Interactive Timeline: Visual journey from pickup to delivery with real-time location updates
  • Route Visualization: Animated maps showing origin, waypoints, and destination
  • Risk Breakdown: Detailed analysis of weather impact, traffic conditions, and overall risk scores
  • Route Comparison: Side-by-side comparison of original vs. AI-optimized routes with time/cost savings

πŸ”” Smart Alerts & Notifications

  • Real-Time Alerts: Instant notifications for delays, route changes, and critical events
  • Priority Badges: Visual indicators for urgent actions requiring immediate attention
  • Flip Card Interactions: Hover to reveal detailed alert information and action buttons
  • Alert Filtering: Filter by type (success, warning, error) and shipment status

🎨 Premium UI/UX Design

  • Antigravity Flip Cards: 3D flip animations revealing detailed information on hover
  • Glassmorphism: Frosted glass panels with backdrop blur effects over dynamic backgrounds
  • World Map Background: Animated dotted world map with flowing connection lines between logistics hubs
  • Sharp Corner Aesthetic: Industrial design language with precise, non-rounded corners
  • Smooth Animations: Framer Motion powers every interaction with buttery-smooth 60fps animations
  • Dark Mode Optimized: High-contrast color palette with neon accents (Cyan, Emerald, Amber, Violet)

πŸ›‘οΈ Production-Ready Architecture

  • Resilient Backend: Sophisticated mock data fallback when database is unreachable
  • Error Handling: Comprehensive error boundaries and graceful degradation
  • API Retry Logic: Automatic retries with exponential backoff for failed requests
  • Environment Variables: Secure configuration management for API keys and database credentials
  • TypeScript: Full type safety across frontend and backend

πŸ“Έ Screenshots

🏠 Landing Page

Landing Page Premium hero section with animated world map background and floating logistics routes

πŸ“Š Dashboard Overview

Dashboard Role-based dashboard with real-time statistics, flip cards, and quick actions

πŸ”— Supply Chain Management

Supply Chain Comprehensive supply chain view with risk scoring, route optimization, and AI analysis

πŸ“ˆ Analytics & Insights

Analytics Advanced data visualization with interactive charts and performance metrics


πŸ›  Tech Stack

Frontend

Technology Purpose
Next.js 14 React framework with App Router, Server Components, and optimized performance
TypeScript Type-safe development with enhanced IDE support
Tailwind CSS Utility-first CSS framework for rapid UI development
Framer Motion Production-ready animation library for React
Recharts Composable charting library built on React components
Lucide React Beautiful & consistent icon library
shadcn/ui Re-usable component library built with Radix UI

Backend

Technology Purpose
Express.js Fast, unopinionated web framework for Node.js
Supabase Open-source Firebase alternative with PostgreSQL
PostgreSQL Advanced open-source relational database
Google Gemini API AI-powered route recommendations and analysis
WeatherAPI.com Real-time weather data for route optimization

Design System

  • Typography: Custom fonts (Pepi-Thin for headers, Biotif-Pro for body)
  • Color Palette: Dark mode with neon accents (#0ea5e9 cyan, #10b981 emerald, #f59e0b amber, #8b5cf6 violet)
  • Layout: Sharp corners, glassmorphism, high contrast
  • Animations: 60fps smooth transitions, 3D transforms, micro-interactions

πŸš€ Getting Started

Prerequisites

Ensure you have the following installed:

  • Node.js (v18 or higher)
  • npm or pnpm (package manager)
  • Git (version control)

1️⃣ Clone the Repository

git clone https://github.com/atuljha-tech/Logistics.git
cd Logistics

2️⃣ Setup Frontend

# Install dependencies
npm install

# Create environment file
cp .env.local.example .env.local

# Add your environment variables to .env.local
# NEXT_PUBLIC_API_URL=http://localhost:5000
# NEXT_PUBLIC_BACKEND_URL=http://localhost:5000

# Start the development server
npm run dev

The frontend will be available at http://localhost:3000

3️⃣ Setup Backend

Open a new terminal window:

cd backend

# Install dependencies
npm install

# Create environment file
cp .env.example .env

# Add your credentials to .env:
# SUPABASE_URL=your_supabase_url
# SUPABASE_KEY=your_supabase_anon_key
# PORT=5000
# GEMINI_API_KEY_1=your_gemini_key_1
# GEMINI_API_KEY_2=your_gemini_key_2
# GEMINI_API_KEY_3=your_gemini_key_3
# GEMINI_API_KEY_4=your_gemini_key_4
# GEMINI_API_KEY_5=your_gemini_key_5
# WEATHER_API_KEY=your_weather_api_key

# Start the backend server
npm run dev

The backend API will run on http://localhost:5000

4️⃣ Database Setup (Optional)

If using Supabase:

# Navigate to backend/sql directory
cd backend/sql

# Run the schema files in your Supabase SQL editor:
# 1. setup.sql (creates tables)
# 2. logistics-schema.sql (adds indexes and constraints)

Note: The application works perfectly with mock data if you don't set up the database. The backend automatically falls back to in-memory data.


🧭 Navigation & Routes

Public Routes

  • / - Landing page with hero section, features, pricing
  • /signin - User authentication (sign in)
  • /signup - User registration (sign up)

Admin Routes

  • /admin - Admin dashboard overview
  • /admin/users - User management
  • /admin/shipments - All shipments management
  • /admin/analytics - System-wide analytics
  • /admin/alerts - Alert monitoring center
  • /admin/approvals - Pending approval requests
  • /admin/system - System settings & configuration

User Routes

  • /user-dashboard - User dashboard overview
  • /user-dashboard/my-shipments - My shipments list
  • /user-dashboard/track - Track package by ID
  • /user-dashboard/history - Shipment history
  • /user-dashboard/notifications - Notification center
  • /user-dashboard/actions - Pending actions
  • /user-dashboard/performance - Performance metrics
  • /user-dashboard/profile - User profile settings

Logistics Routes

  • /logistics - All shipments table view
  • /logistics/create - Create new shipment
  • /logistics/track - Track shipment by tracking ID
  • /logistics/[id] - Individual shipment details

Supply Chain Routes

  • /supply-chain - Supply chain overview with risk analysis
  • /supply-chain/[id] - Detailed shipment view with AI route optimization

Dashboard Routes

  • /dashboard - Operations dashboard
  • /dashboard/shipments - Shipments management
  • /dashboard/analytics - Analytics & reports
  • /dashboard/alerts - Alert center
  • /dashboard/settings - Dashboard settings

πŸ“‘ API Documentation

Base URL

Development: http://localhost:5000
Production: https://logistics-85h5.onrender.com

Endpoints

Health Check

GET /health

Returns API health status

Statistics

GET /api/statistics

Returns overall shipment statistics (total, in-transit, delivered, pending, etc.)

Shipments

Get All Shipments

GET /api/shipments?page=1&limit=10&status=in-transit

Query Parameters:

  • page (optional): Page number for pagination
  • limit (optional): Items per page
  • status (optional): Filter by status (in-transit, delivered, pending, etc.)

Get Shipment by ID

GET /api/shipments/:id

Create Shipment

POST /api/shipments
Content-Type: application/json

{
  "sender_name": "John Doe",
  "sender_city": "Mumbai",
  "receiver_name": "Jane Smith",
  "receiver_city": "Delhi",
  "package_type": "Electronics",
  "weight": 2.5,
  "priority": "high"
}

Update Shipment

PUT /api/shipments/:id
Content-Type: application/json

{
  "status": "delivered",
  "current_location": "Delhi Delivery Hub"
}

Delete Shipment

DELETE /api/shipments/:id

Bulk Update

POST /api/shipments/bulk-update
Content-Type: application/json

{
  "ids": ["id1", "id2", "id3"],
  "status": "in-transit"
}

Tracking

GET /api/track/:trackingId

Track shipment by tracking ID (e.g., IND202604280001)

Supply Chain

Get All Supply Chain Shipments

GET /shipments

Predict Risk

GET /predict-risk/:id

Returns risk prediction for a shipment

Optimize Route

GET /optimize-route/:id

Returns optimized route suggestions

AI Route Recommendation (Gemini)

GET /api/supply-chain/ai-route/:id

Returns AI-powered route analysis with weather and traffic data

Response:

{
  "success": true,
  "data": {
    "recommended_route": "Mumbai -> Pune -> Delhi",
    "reason": "Optimal balance of safety and speed",
    "estimated_delay_hours": 1.5,
    "risk_level": "low",
    "suggestions": [
      "Avoid highway sector 12 due to heavy rain",
      "Use alternate toll road for faster delivery"
    ],
    "weather": {
      "origin": { "condition": "Clear", "temp": 28 },
      "destination": { "condition": "Rain", "temp": 22 }
    },
    "source": "gemini-api-key-3"
  }
}

🎨 Design System

Color Palette

/* Primary Colors */
--primary: #0ea5e9;        /* Cyan - Primary actions */
--emerald: #10b981;        /* Success states */
--amber: #f59e0b;          /* Warnings */
--violet: #8b5cf6;         /* AI features */
--red: #ef4444;            /* Errors */

/* Surface Colors */
--background: #0a0a0a;
--surface-container-low: #1a1a1a;
--surface-container: #262626;
--surface-container-high: #333333;

/* Text Colors */
--on-surface: #ffffff;
--on-surface-variant: #a3a3a3;
--on-primary: #ffffff;

Typography

/* Headers */
font-family: 'Pepi-Thin', sans-serif;
font-weight: 100-300;

/* Body Text */
font-family: 'Biotif-Pro', sans-serif;
font-weight: 400-600;

Component Patterns

Glassmorphism

background: rgba(26, 26, 26, 0.3);
backdrop-filter: blur(12px);
border: 1px solid rgba(255, 255, 255, 0.1);

Flip Card

<motion.div
  animate={{ rotateY: flipped ? 180 : 0 }}
  style={{ transformStyle: 'preserve-3d' }}
>
  {/* Front & Back faces */}
</motion.div>

πŸ” Environment Variables

Frontend (.env.local)

NEXT_PUBLIC_API_URL=http://localhost:5000
NEXT_PUBLIC_BACKEND_URL=http://localhost:5000

Backend (.env)

# Database
SUPABASE_URL=your_supabase_project_url
SUPABASE_KEY=your_supabase_anon_key

# Server
PORT=5000

# AI APIs (5 keys for fallback rotation)
GEMINI_API_KEY_1=your_gemini_api_key_1
GEMINI_API_KEY_2=your_gemini_api_key_2
GEMINI_API_KEY_3=your_gemini_api_key_3
GEMINI_API_KEY_4=your_gemini_api_key_4
GEMINI_API_KEY_5=your_gemini_api_key_5

# Weather API
WEATHER_API_KEY=your_weather_api_key

πŸ“¦ Project Structure

logistics/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ admin/                    # Admin dashboard pages
β”‚   β”œβ”€β”€ dashboard/                # Operations dashboard
β”‚   β”œβ”€β”€ logistics/                # Logistics management
β”‚   β”œβ”€β”€ supply-chain/             # Supply chain pages
β”‚   β”œβ”€β”€ user-dashboard/           # User dashboard pages
β”‚   β”œβ”€β”€ signin/                   # Authentication
β”‚   β”œβ”€β”€ signup/                   # Registration
β”‚   β”œβ”€β”€ layout.tsx                # Root layout
β”‚   β”œβ”€β”€ page.tsx                  # Landing page
β”‚   └── globals.css               # Global styles
β”œβ”€β”€ components/                   # React components
β”‚   β”œβ”€β”€ ui/                       # shadcn/ui components
β”‚   β”œβ”€β”€ flip-card.tsx             # 3D flip card component
β”‚   β”œβ”€β”€ route-map.tsx             # Route visualization
β”‚   β”œβ”€β”€ tracking-timeline.tsx     # Shipment timeline
β”‚   └── ...                       # Other components
β”œβ”€β”€ backend/                      # Express.js backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/          # Route controllers
β”‚   β”‚   β”œβ”€β”€ routes/               # API routes
β”‚   β”‚   β”œβ”€β”€ services/             # Business logic
β”‚   β”‚   β”‚   └── geminiService.js  # AI route optimization
β”‚   β”‚   β”œβ”€β”€ utils/                # Helper functions
β”‚   β”‚   β”œβ”€β”€ config/               # Configuration
β”‚   β”‚   └── app.js                # Express app
β”‚   β”œβ”€β”€ sql/                      # Database schemas
β”‚   └── server.js                 # Server entry point
β”œβ”€β”€ public/                       # Static assets
β”‚   β”œβ”€β”€ ss1.png                   # Landing page screenshot
β”‚   β”œβ”€β”€ ss2.png                   # Dashboard screenshot
β”‚   β”œβ”€β”€ ss3.png                   # Supply chain screenshot
β”‚   └── ss4.png                   # Analytics screenshot
└── README.md                     # This file

🚒 Deployment

Frontend (Vercel/Render)

  1. Push your code to GitHub
  2. Connect your repository to Vercel or Render
  3. Add environment variables:
    • NEXT_PUBLIC_API_URL
    • NEXT_PUBLIC_BACKEND_URL
  4. Deploy!

Backend (Render)

  1. Create a new Web Service on Render
  2. Connect your GitHub repository
  3. Set build command: cd backend && npm install
  4. Set start command: cd backend && npm start
  5. Add all environment variables from .env
  6. Deploy!

🀝 Contributing

Contributions are welcome! Please follow these steps:

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

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Atul Jha


πŸ™ Acknowledgments


Built with ❀️ for modern logistics management

⭐ Star this repo if you find it helpful!

About

AI-powered supply chain management platform with real-time tracking, predictive analytics, route optimization, and role-based dashboards. Built with Next.js & Supabase.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors