Skip to content

Latest commit

Β 

History

131 Commits

Folders and files

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

Repository files navigation

🏒 Lease360 β€” Enterprise Equipment Rental & Lease Security Engine

Next.js 14 MongoDB Tailwind CSS Express.js PWA Ready License: MIT

A full-stack, enterprise-grade equipment rental & lease management system built for the Odoo Hackathon 2026 β€” solving deposit security, automated late fees, condition-based maintenance isolation, live dispatch tracking, and AI-driven ops analytics.

Demo Video Β· Features Β· Architecture Β· Getting Started Β· API Reference


🎬 Demo Video

Watch Lease360 in action β€” full walkthrough of the rental lifecycle, deposit ledger, and AI co-pilot:

▢️ https://youtu.be/j3Vd9Rpr4_I


πŸ“Œ Table of Contents

  1. Executive Summary
  2. Key Features
  3. Architecture & Tech Stack
  4. Database Models & ER Diagram
  5. API Reference
  6. LeaseMind AI Engine
  7. Email Notification System
  8. PWA & Mobile Capabilities
  9. Getting Started
  10. Demo Logins
  11. Contributing
  12. License

πŸš€ Executive Summary

Managing high-value rental equipment (cameras, gimbals, lighting, industrial tools) requires strict control over asset availability, security deposits, damage assessments, and timely returns. Traditional rental software often suffers from disconnected deposit accounting and manual inspection tracking.

Lease360 unifies the complete 360Β° rental lifecycle into a single liquid-glass interface:

Capability What it does
πŸ›‘ Financial Security Automated deposit holds (HELD, PARTIALLY_REFUNDED, FULLY_REFUNDED, FORFEITED) with multi-transaction ledgers
⏱ Automated Late Fees Hourly rate penalization engine with configurable grace periods
πŸ”§ Condition Isolation Damage logging on returns that automatically isolates faulty stock into maintenance workflows
🚚 Live Transit Tracker Dispatch checkpoints, courier contact triggers, and counter pickup QR passes
πŸ€– AI Operational Intelligence Natural-language querying over live MongoDB state via Groq Llama 3 70B & Gemini 1.5 Pro

✨ Key Features

1. πŸ›‘οΈ Security Deposit Ledger & Reconciliation

Holds deposit funds automatically upon order confirmation, and transparently records damage deductions, late fee charges, and partial/full refunds in an immutable transaction history.

2. ⚑ Automated Late-Fee Engine

Calculates late fees dynamically based on return due dates, enforcing configurable grace periods (e.g. 30 minutes) before applying hourly penalty rates.

3. πŸ“„ Quotation Proposal & Conversion System

Enables staff to draft custom equipment quotations with valid-until deadlines. One-click customer acceptance converts quotations into active orders while re-checking and locking inventory stock.

4. 🚚 Live Transit Dispatch Tracker

A 4-stage logistics pipeline: Order Confirmed β†’ Dispatched / In Transit β†’ At Destination β†’ Return & Settled, with express courier contact integration (SHIPPING) and store counter check-in QR pass (STORE_PICKUP).

5. πŸ”© Maintenance Isolation & Condition Scoring

The return process evaluates equipment condition (EXCELLENT, GOOD, DAMAGED, MAJOR_DAMAGE), automatically creating maintenance tickets and isolating damaged items from available inventory.

6. πŸ€– LeaseMind AI Assistant

A conversational AI that executes database queries to answer operational questions like "What orders are overdue?" or "Show revenue for camera gear."

7. πŸ“¬ Multi-Role Email Notification System

Nodemailer + Gmail SMTP integration delivers formatted HTML emails to customers, staff, and admins on order confirmation, pickup dispatch, deposit settlement, and urgent maintenance alerts.


πŸ—οΈ Architecture & Tech Stack

 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚                      Lease360 Client                        β”‚
 β”‚        (Next.js 14 App Router + Tailwind CSS + PWA)         β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                     Next.js Reverse Proxy Rewrites
                                 β”‚
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚              Standalone Express.js API Backend               β”‚
 β”‚          (Port 5001 Β· Max Pool 100 Β· In-Memory Cache)        β”‚
 β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚                       β”‚                       β”‚
 β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”
 β”‚  MongoDB Atlas β”‚      β”‚  LeaseMind AI  β”‚      β”‚  Nodemailer   β”‚
 β”‚ (Mongoose ORM) β”‚      β”‚ (Groq/Gemini)  β”‚      β”‚  (Gmail SMTP) β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

⚑ Architecture highlight β€” decoupled, high-performance backend

All API handlers originally ran inside Next.js serverless API routes. When scaling to 2,000+ heavy equipment items with high-concurrency pagination, cursor searches, and complex aggregation pipelines, Next.js route handlers hit CPU bottlenecks and cold-start latency.

To achieve production-grade performance, all core database endpoints (Products, Orders, Quotations, Checkout, Users, Maintenance, Profile) were decoupled into a standalone Express.js backend (backend/, port 5001). Next.js reverse-proxies /api/* requests to Express, delivering sub-50ms response times, optimized connection pooling (maxPoolSize: 100), and zero UI blocking.

Layer Technology
Frontend Next.js 14 App Router, React 18, Tailwind CSS, Lucide Icons, Sonner Toasts
Backend Service Standalone Express.js (Port 5001), CORS, Cookie-Parser, Mongoose ORM
Database MongoDB Atlas Cluster (2,000+ seeded equipment products)
AI Intelligence Groq API (llama-3.3-70b-versatile) with Google Gemini 1.5 Pro fallback
Transactional Mail Nodemailer with Gmail SMTP transporter & HTML/PDF tax invoice generator

πŸ“Š Database Models & ER Diagram

erDiagram
    USER ||--o{ ORDER : places
    USER ||--o{ QUOTATION : requests
    USER ||--o{ NOTIFICATION : receives
    PRODUCT ||--o{ MAINTENANCE_TICKET : requires
    QUOTATION ||--o| ORDER : converts_to

    USER {
        ObjectId _id
        string name
        string email
        string role "ADMIN | STAFF | PORTAL_USER"
        string phone
        number trustScore
    }

    PRODUCT {
        ObjectId _id
        string name
        string category
        number totalStock
        number availableStock
        number baseDepositAmt
        array accessoryList
    }

    ORDER {
        ObjectId _id
        string orderNumber
        ObjectId userId
        string status "CONFIRMED | PICKED_UP | RETURNED_ON_TIME | RETURNED_LATE"
        number totalAmount
        number depositAmount
        number lateFeeCharged
        date rentalStart
        date rentalEnd
    }

    QUOTATION {
        ObjectId _id
        string quoteNumber
        ObjectId userId
        string status "DRAFT | SENT | ACCEPTED | EXPIRED"
        number totalAmount
        date validUntil
    }

    MAINTENANCE_TICKET {
        ObjectId _id
        string ticketNumber
        ObjectId productId
        string priority "LOW | MEDIUM | HIGH | URGENT"
        string status "OPEN | IN_PROGRESS | RESOLVED"
    }
Loading

πŸ”Œ API Reference

Endpoint Method Description Access
/api/auth/register POST Create new user account Public
/api/auth/login POST Authenticate user & issue JWT cookie Public
/api/auth/me GET Get current logged-in user profile Authenticated
/api/orders GET, POST List orders or create new rental order Authenticated
/api/orders/[id] GET, PATCH Fetch order details or update status Owner / Staff
/api/orders/[id]/pickup POST Mark equipment picked up & start transit Staff / Admin
/api/orders/[id]/return POST Process return inspection & reconcile deposit Staff / Admin
/api/quotations GET, POST List or create rental proposals Authenticated
/api/quotations/[id]/convert POST Convert quotation into confirmed order Owner / Staff
/api/products GET, POST Catalog search and product management Public / Admin
/api/maintenance GET, POST List maintenance tickets or report repair issue Staff / Admin
/api/notifications GET, PATCH Fetch user alerts & mark as read Authenticated
/api/ai/query POST Query the LeaseMind AI co-pilot Authenticated

πŸ€– LeaseMind AI Engine

LeaseMind AI lets team members ask operational questions in plain English:

  • "Show me all orders currently overdue"
  • "What is our total active deposit hold balance?"
  • "List equipment currently isolated in maintenance"

The route handler (/api/ai/query) reads live collections from MongoDB, constructs structured context, and queries the Groq Llama 3 70B model (falling back to Google Gemini if rate-limited) for instant data analysis.


βœ‰οΈ Email Notification System

Integrated via src/lib/mailer.ts using Nodemailer and HTML email templates:

  • Order Confirmation Email β€” delivered upon booking confirmation with itemized summary & deposit breakdown
  • Pickup & Dispatch Alert β€” sent when admin marks an order as picked up, emphasizing the return due date
  • Deposit Settlement Receipt β€” sent after return inspection, detailing deposit hold, late fee deductions, and net refund credited
  • Urgent Maintenance Alert β€” fired to admins when high-priority repair tickets are logged

πŸ“± PWA & Mobile Capabilities

Lease360 is built touch-first with PWA features:

  • Installable β€” full Web App Manifest (public/manifest.json) supporting standalone display on iOS, Android, and Desktop
  • Mobile Bottom Bar β€” native tab bar for rapid navigation on mobile viewports
  • Responsive Layouts β€” touch-friendly card stacks for mobile devices

Read the complete guide in PWA_GUIDE.md.


πŸ› οΈ Getting Started

Prerequisites

  • Node.js v18.x or v20.x
  • npm or pnpm
  • A MongoDB Atlas connection string

1. Clone & Install

git clone https://github.com/senapati484/RMS.git
cd RMS
npm install

2. Configure Environment Variables

Create a .env.local file in the root directory:

MONGODB_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/rms
JWT_SECRET=lease360_super_secret_jwt_key_2026

# Email Dispatcher Credentials (Gmail App Password)
SMTP_EMAIL=your-email@gmail.com
SMTP_PASS=your-gmail-app-password

# AI Co-Pilot API Keys
GROQ_API_KEY=gsk_your_groq_api_key
GEMINI_API_KEY=AIzaSy_your_gemini_key

⚠️ Never commit .env.local β€” keep secrets out of version control.

3. Seed the Database (2,000+ Demo Products)

# Seed initial demo accounts & base products
npx tsx scripts/seed.ts

# Seed 500+ robust enterprise catalog products into MongoDB
npx tsx scripts/seed-500-products.ts 500

4. Run Development Servers

# Starts Next.js frontend (port 3000) and Express backend (port 5001) concurrently
npm run dev:all

Open http://localhost:3000 in your browser. The Express API runs on http://localhost:5001.


πŸ”‘ Demo Logins

Use these seeded accounts to test different roles and permissions:

Role Email Password Scope
Admin admin@lease360.ai admin123 Full system control, revenue analytics, return inspection & maintenance
Staff staff@lease360.ai staff123 Pickup dispatch, return processing & maintenance tickets
Customer user@lease360.ai user123 Catalog browsing, rental order creation & deposit tracking

🀝 Contributing

Contributions are welcome! To get started:

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

Please open an issue first for major changes to discuss what you'd like to change.


πŸ“œ License

This project is licensed under the MIT License. Built for the Odoo Hackathon 2026.

About

Lease360 is a full-stack, enterprise-grade equipment rental & lease management system built for the Odoo Hackathon 2026. It solves critical industry bottlenecks around security deposit holds, automated late-fee calculation, equipment condition scoring.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages