Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

61 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Rentify β€” Car Rental Management System

A full-stack Car Rental Management System built with Java 17 and Spring Boot 3.2.5. Evolved from a console application into a production-ready web platform featuring a 3-layer architecture, H2 database persistence, PDF receipt generation, Chart.js analytics, loyalty discounts, and an AI assistant powered by OpenRouter.

Version Java Spring Boot License


Architecture & System Design

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    PRESENTATION LAYER                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚Thymeleaf β”‚  β”‚ HTML/CSS β”‚  β”‚Chart.js  β”‚  β”‚  AI Chatbot β”‚ β”‚
β”‚  β”‚Templates β”‚  β”‚  (RWD)   β”‚  β”‚(Analytics)β”‚  β”‚ (Markdown)  β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚       β”‚              β”‚              β”‚                β”‚       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    CONTROLLER LAYER                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚           RentalController (HTTP Routes)                 β”‚  β”‚
β”‚  β”‚  /  /rent  /return  /history  /charts  /cars  /customer β”‚  β”‚
β”‚  β”‚  /about  /agreement/{id}  /activity  /export/csv        β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚              ChatController (AI - REST API)              β”‚  β”‚
β”‚  β”‚  POST /api/chat  β†’  OpenRouter (Free LLM Models)        β”‚  β”‚
β”‚  β”‚  Injects live DB context β†’ Intelligent responses        β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    SERVICE LAYER                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚              CarRentalSystem (Business Logic)             β”‚  β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚  β”‚
β”‚  β”‚  β”‚ Fleet Mgmtβ”‚ β”‚Rental    β”‚ β”‚Customer β”‚ β”‚ Analytics  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚ CRUD      β”‚ β”‚Booking   β”‚ β”‚Loyalty  β”‚ β”‚ Insights   β”‚  β”‚  β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚  β”‚
β”‚  β”‚  β”‚ PDF Gen   β”‚ β”‚Activity  β”‚ β”‚ Rating & Review       β”‚  β”‚  β”‚
β”‚  β”‚  β”‚ (iText)   β”‚ β”‚ Logging  β”‚ β”‚ System                β”‚  β”‚  β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    REPOSITORY LAYER (Spring Data JPA)           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚  β”‚ CarRepository β”‚  β”‚ RentalRepo   β”‚  β”‚ CustomerRepo     β”‚    β”‚
β”‚  β”‚ (CRUD + Query)β”‚  β”‚ (Overlap +   β”‚  β”‚ (Phone Search)   β”‚    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  Status)     β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚         β”‚          β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚               β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    DATABASE LAYER                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚              H2 Database (Embedded SQL)                   β”‚  β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚  β”‚
β”‚  β”‚  β”‚   cars    β”‚  β”‚ customers β”‚  β”‚      rentals        β”‚  β”‚  β”‚
β”‚  β”‚  β”‚ ────PK   β”‚  β”‚ ────PK   β”‚  β”‚ ────PK               β”‚  β”‚  β”‚
β”‚  β”‚  β”‚ car_id    β”‚  β”‚ id        β”‚  β”‚ car_id (FK β†’ cars)  β”‚  β”‚  β”‚
│  │  │ brand     │  │ name      │  │ customer_id (FK→cus)│  │  │
β”‚  β”‚  β”‚ model     β”‚  β”‚ phone     β”‚  β”‚ start_date          β”‚  β”‚  β”‚
β”‚  β”‚  β”‚ price     β”‚  β”‚ rental_cntβ”‚  β”‚ end_date            β”‚  β”‚  β”‚
β”‚  β”‚  β”‚ category  β”‚  β”‚ discount  β”‚  β”‚ total_price         β”‚  β”‚  β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚ status (ACTIVE/    β”‚  β”‚  β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”‚ RETURNED)           β”‚  β”‚  β”‚
β”‚  β”‚  β”‚ activity  β”‚                 β”‚ rating, notes       β”‚  β”‚  β”‚
β”‚  β”‚  β”‚ _log      β”‚                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                          β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Design Patterns

Pattern Usage
3-Layer Architecture Controller β†’ Service β†’ Repository β€” clean separation of concerns
Dependency Injection Spring Boot DI for all services and repositories
Repository Pattern Spring Data JPA for database abstraction
DTO Pattern Model entities used across layers
Template Method Thymeleaf layouts for consistent UI
Strategy Pattern Fallback model strategy for AI chatbot

Features

Core Features

Feature Description
Fleet Management Add, delete, and view cars with categories and pricing
Date-Based Booking Rent cars with date picker, live price preview, and double-booking prevention
One-Click Return Return any active rental instantly
Rental History Complete record of active and completed rentals
PDF Receipts Professional PDF receipt for every booking via iText
Revenue Charts Monthly revenue bar chart + category doughnut chart via Chart.js
CSV Export Download complete rental history as CSV

Advanced Features

Feature Description
Customer Profiles Search customers by phone, view full rental history with stats
Customer Ratings Rate returned rentals (1-5 stars), average rating per car
Loyalty Discounts 3 rentals β†’ 5% off, 5 rentals β†’ 10% off, 10+ rentals β†’ 15% off
Activity Log Track all actions β€” add/delete/rent/return with timestamps
Booking Notes Add special requests when renting (baby seat, preferred color, etc.)
Dashboard Insights Most rented car, top customer, busiest month, avg rental duration
Print Agreement Print-friendly rental agreement with full terms and conditions
AI Assistant Intelligent chatbot that knows everything about the fleet and system
Dark/Light Theme Toggle between dark and light mode with persistence

Tech Stack

Backend

Technology Purpose
Java 17 Core programming language
Spring Boot 3.2.5 Web framework + dependency injection
Spring Data JPA Database ORM layer
H2 Database Embedded persistent SQL database
iText PDF 5 PDF receipt generation
Maven Build and dependency management

Frontend

Technology Purpose
Thymeleaf Server-side HTML templating
HTML5 + CSS3 Mobile-first responsive design
Vanilla JavaScript Dynamic interactions, price preview
Chart.js Interactive revenue and category charts
Marked.js Markdown rendering in AI chatbot
KaTeX LaTeX math rendering in AI chatbot

Deployment

Platform Method
Render Auto-deploy from GitHub (via render.yaml)
Railway Alternative deployment option

Data Model

erDiagram
    CAR {
        string car_id PK
        string brand
        string model
        double base_price_per_day
        string category
        boolean available
    }
    
    CUSTOMER {
        long id PK
        string customer_id
        string name
        string phone
        int rental_count
        double loyalty_discount
    }
    
    RENTAL {
        long id PK
        string car_id FK
        long customer_id FK
        date start_date
        date end_date
        int days
        double total_price
        string status "ACTIVE | RETURNED"
        int rating
        string notes
    }
    
    ACTIVITY_LOG {
        long id PK
        string action
        string description
        timestamp created_at
    }
    
    CAR ||--o{ RENTAL : "rented in"
    CUSTOMER ||--o{ RENTAL : "rented by"
Loading

Quick Start

Prerequisites

Live Demo

The app is live at: https://rentify-ifs4.onrender.com

Run Locally

# Clone the repository
git clone https://github.com/bikashpubg678-maker/Rentify-java-project.git
cd Rentify-java-project

# Run the application
mvn spring-boot:run

# Open in browser
open http://localhost:8081

Build & Run JAR

mvn clean package
java -jar target/AutoRentWeb-1.0.jar

Environment Variables

Variable Default Description
PORT 8081 Server port
OPENROUTER_API_KEY β€” API key for AI chatbot (optional, free models used otherwise)

API Endpoints

Pages

Method Path Description
GET / Dashboard with fleet overview and insights
GET /rent Car rental form with date picker
POST /rent Submit rental booking
GET /return Car return page
POST /return Submit car return
GET /history Rental history
GET /charts Revenue and category analytics
GET /cars Fleet management
POST /cars/add Add new car
POST /cars/delete Remove car from fleet
GET /customer Customer search
GET /customer/profile?id=X Customer profile
GET /activity System activity log
GET /about Developer information
GET /agreement/{id} Print-friendly rental agreement

Data Endpoints

Method Path Description
GET /receipt/{id} Download PDF receipt
GET /export/csv Download rental history as CSV
POST /api/chat AI chatbot API

Deployment to Render

Automatic (via render.yaml)

  1. Push your code to GitHub
  2. In Render Dashboard β†’ New β†’ Blueprint
  3. Connect your GitHub repository
  4. Render auto-detects render.yaml and deploys

Manual Setup

  1. Create a Web Service on Render
  2. Connect your GitHub repo
  3. Set:
    • Build Command: mvn clean package -DskipTests
    • Start Command: java -jar target/AutoRentWeb-1.0.jar
    • Auto-Deploy: Yes
  4. Add Environment Variable: PORT = 8080

CI/CD Pipeline

graph LR
    A[Git Push] --> B[GitHub]
    B --> C[Render Webhook]
    C --> D[Build: mvn package]
    D --> E[Test: mvn test]
    E --> F[Deploy to Render]
    F --> G[Health Check /]
    G --> H[Live!]
Loading

Every push to the main branch triggers automatic build, test, and deployment.


AI Assistant

The built-in AI chatbot uses OpenRouter's free LLM models with automatic fallback:

  1. Meta Llama 3.3 70B (primary)
  2. OpenRouter Free (fallback)
  3. Google Gemma 2 9B (secondary fallback)
  4. Meta Llama 3.2 3B (last resort)

The AI has live access to the entire database β€” fleet, pricing, rentals, revenue, customer ratings, and loyalty tiers. It can answer questions about:

  • Available cars and pricing
  • Revenue and business insights
  • Customer rental history
  • Loyalty discounts
  • Feature guidance and troubleshooting

Project Structure

Rentify/
β”œβ”€β”€ render.yaml                    # Render deployment config
β”œβ”€β”€ Procfile                        # Process definition
β”œβ”€β”€ pom.xml                         # Maven build
β”œβ”€β”€ README.md                       # This file
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”œβ”€β”€ java/carrental/
β”‚   β”‚   β”‚   β”œβ”€β”€ App.java            # Entry point
β”‚   β”‚   β”‚   β”œβ”€β”€ model/              # JPA entities
β”‚   β”‚   β”‚   β”œβ”€β”€ repository/         # Data access layer
β”‚   β”‚   β”‚   β”œβ”€β”€ service/            # Business logic
β”‚   β”‚   β”‚   └── controller/         # HTTP routes
β”‚   β”‚   └── resources/
β”‚   β”‚       β”œβ”€β”€ templates/          # Thymeleaf pages
β”‚   β”‚       β”œβ”€β”€ static/             # CSS, JS, images
β”‚   β”‚       └── application.properties
β”‚   └── test/
└── target/                         # Build output

Author

Bikash Talukder Second Year Computer Science & Engineering Student

Built with Java + Spring Boot


License

This project is licensed under the MIT License β€” see the LICENSE file for details.


If you found this project useful, please give it a star on GitHub!

About

A full-stack Car Rental Management System built with Spring Boot 3 and Java 17. Evolved from a JavaFX desktop app into a responsive web platform featuring a 3-layer architecture, H2 persistence, iText PDF generation, Chart.js analytics, and an integrated AI assistant.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages