Skip to content

Latest commit

Β 

History

43 Commits

Folders and files

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

Repository files navigation

πŸͺ‘ Rento β€” Party & Event Equipment Rental Platform

A full-stack Spring Boot web application for renting party and event equipment.
Built for CSE 3220 Software Engineering Lab β€” complete professional workflow demonstration.


πŸ”— Links

Resource URL
Live App https://rento-e8w1.onrender.com/
GitHub Repo https://github.com/commoner02/Rento

πŸ“ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Thymeleaf Views                   β”‚
β”‚          (templates/auth, products, rentals)        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ HTTP
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Controllers (4)                    β”‚
β”‚  AuthController β”‚ ProductController β”‚ RentalController β”‚ AdminController
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Service Layer                      β”‚
β”‚  UserService β”‚ ProductService β”‚ RentalService β”‚ PaymentService
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ JPA
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Repository Layer (JPA)                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚             PostgreSQL Database                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tech Stack: Java 17 Β· Spring Boot 3.2 Β· Spring Security Β· Thymeleaf Β· Spring Data JPA Β· PostgreSQL Β· Maven Β· Docker Β· GitHub Actions


πŸ—„οΈ ER Diagram

users ──────────────── rentals ────────────── rental_items ──── products
  id (PK)                id (PK)                 id (PK)           id (PK)
  email (unique)         user_id (FK) ←          rental_id (FK) ←  name
  password               rental_date             product_id (FK) ←  category
  first_name             return_date             quantity           daily_rate
  last_name              actual_return_date      daily_rate_at_     total_quantity
  phone                  status                  rental             available_quantity
  role                   total_amount            returned_qty       replacement_value
  created_at             deposit_amount          condition_notes
                         notes                   damage_fee
                         created_at
                              β”‚
                              └──── payments
                                      id (PK)
                                      rental_id (FK)
                                      amount
                                      payment_type
                                      payment_method
                                      status
                                      transaction_date

Relationships:

  • users β†’ rentals : One-to-Many (1:M)
  • rentals β†’ rental_items : One-to-Many (1:M)
  • products β†’ rental_items : One-to-Many (1:M)
  • rentals β†’ payments : One-to-One (1:1)
  • users ↔ products : Many-to-Many (via rental_items)

πŸ”‘ Roles & Permissions

Role Permissions
ADMIN Manage products (CRUD), manage users & roles, view all rentals, view payments, process refunds
SELLER Confirm/activate rentals, process returns, log damage fees, view all rentals
BUYER Browse products, create rentals, view own rentals, cancel own rentals

🌐 API Endpoints

Auth

Method URL Access Description
GET /auth/login Public Login page
POST /auth/login Public Process login
GET /auth/register Public Register page
POST /auth/register Public Create account
POST /auth/logout Any Logout

Products

Method URL Access Description
GET /products Authenticated List all products
GET /products/{id} Authenticated Product detail
GET /products/new ADMIN Create product form
POST /products/new ADMIN Create product
GET /products/edit/{id} ADMIN Edit product form
POST /products/edit/{id} ADMIN Update product
POST /products/delete/{id} ADMIN Delete product

Rentals

Method URL Access Description
GET /rentals Authenticated List rentals (buyers: own; others: all)
GET /rentals/{id} Owner/SELLER/ADMIN Rental detail
GET /rentals/new BUYER New rental form
POST /rentals/new BUYER Create rental
POST /rentals/{id}/confirm SELLER/ADMIN Confirm rental
POST /rentals/{id}/activate SELLER/ADMIN Activate rental
POST /rentals/{id}/cancel Owner/SELLER/ADMIN Cancel rental
GET /rentals/{id}/return SELLER/ADMIN Return form
POST /rentals/{id}/return SELLER/ADMIN Process return

Admin

Method URL Access Description
GET /admin/users ADMIN Manage users
POST /admin/users/{id}/role ADMIN Update user role
POST /admin/users/{id}/delete ADMIN Delete user
GET /admin/payments ADMIN View all payments
POST /admin/payments/{id}/refund ADMIN Refund payment

▢️ Run Locally

Prerequisites

  • Java 17+
  • Maven 3.8+
  • Docker & Docker Compose

Option 1: Docker Compose (Recommended)

# Clone the repo
git clone https://github.com/commoner02/rento.git
cd rento

# Create environment file
cp .env.example .env
# Edit .env with your values if needed

# Start everything
docker compose up --build

# App runs at http://localhost:8080

Option 2: Local Maven (PostgreSQL required)

# Create PostgreSQL database
createdb rentodb

# Set environment variables
export DATABASE_URL=jdbc:postgresql://localhost:5432/rentodb
export DB_USERNAME=postgres
export DB_PASSWORD=postgres

# Run
mvn spring-boot:run

Demo Accounts

Email Password Role
admin@rento.com admin123 ADMIN
seller@rento.com seller123 SELLER
buyer@rento.com buyer123 BUYER

πŸ§ͺ Running Tests

# Run all tests (uses H2 in-memory database β€” no PostgreSQL needed)
mvn test

# Run only unit tests
mvn test -Dtest="*ServiceTest"

# Run only integration tests
mvn test -Dtest="*ControllerTest"

Test coverage:

  • 24 unit tests across UserServiceTest, ProductServiceTest, RentalServiceTest
  • 11 integration tests across ProductControllerTest, RentalControllerTest
  • Tests run with H2 in-memory database (no external dependencies)

πŸ” CI/CD Pipeline

Push to develop/main
        β”‚
        β–Ό
  [GitHub Actions]
        β”‚
        β”œβ”€ Checkout code
        β”œβ”€ Setup JDK 17
        β”œβ”€ Run tests (H2, no DB needed)
        β”œβ”€ Build JAR
        └─ On main push β†’ Trigger Render deploy

Setup:

  1. In your GitHub repo β†’ Settings β†’ Secrets, add:
    • RENDER_API_KEY β€” from Render account settings
    • RENDER_SERVICE_ID β€” from your Render service URL

🌐 Deployment (Render)

  1. Push to GitHub
  2. Create a new Web Service on render.com
  3. Connect your GitHub repo
  4. Set build command: mvn clean package -DskipTests
  5. Set start command: java -jar target/rento-0.0.1-SNAPSHOT.jar
  6. Add PostgreSQL service on Render, then add env vars:
    • DATABASE_URL β€” from Render PostgreSQL connection string
    • DB_USERNAME β€” your DB user
    • DB_PASSWORD β€” your DB password

🌿 Git Workflow

main          ← production, protected (no direct push)
  └── develop ← integration branch
        β”œβ”€β”€ feature/user-auth
        β”œβ”€β”€ feature/product-crud
        β”œβ”€β”€ feature/rental-flow
        └── feature/admin-panel
  • All features developed on feature/* branches
  • PR required to merge into main
  • At least 1 review approval required
  • CI must pass before merge

πŸ“ Project Structure

rento/
β”œβ”€β”€ src/main/java/com/rento/
β”‚   β”œβ”€β”€ RentoApplication.java
β”‚   β”œβ”€β”€ config/          # SecurityConfig, DataInitializer
β”‚   β”œβ”€β”€ controller/      # Auth, Product, Rental, Admin
β”‚   β”œβ”€β”€ dto/request/     # RegisterRequest, ProductRequest, RentalRequest
β”‚   β”œβ”€β”€ exception/       # Global handler + custom exceptions
β”‚   β”œβ”€β”€ model/           # User, Product, Rental, RentalItem, Payment
β”‚   β”œβ”€β”€ repository/      # JPA repositories
β”‚   β”œβ”€β”€ security/        # UserDetailsServiceImpl
β”‚   └── service/         # Business logic layer
β”œβ”€β”€ src/main/resources/
β”‚   β”œβ”€β”€ application.properties
β”‚   β”œβ”€β”€ static/css/main.css
β”‚   └── templates/       # Thymeleaf HTML templates
β”œβ”€β”€ src/test/
β”‚   β”œβ”€β”€ java/com/rento/
β”‚   β”‚   β”œβ”€β”€ service/     # Unit tests (Mockito)
β”‚   β”‚   └── controller/  # Integration tests (MockMvc + H2)
β”‚   └── resources/
β”‚       └── application-test.properties  # H2 config
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ .env.example
β”œβ”€β”€ .github/workflows/ci-cd.yml
└── pom.xml

πŸ‘₯ Team

Name Student ID Role
Sree Shuvo Kumar Joy 2107116 Backend + Security
Saleheen Uddin Sakin 2107103 Frontend + Testing

About

SpringBoot App for Software Engineering and Project Management Laboratory

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages