Skip to content

mohammademon10/krishiSeba

Repository files navigation

🌾 KrishiSheba — Agricultural Equipment Rental Platform

Bangladesh's modern platform connecting farmers with certified equipment retailers. Built with Spring Boot 3.2.5 + Thymeleaf + PostgreSQL/H2.


✨ Features

Feature Details
🌾 Farmer Dashboard Browse equipment, filter by type, view images, make rental requests
🏪 Retailer Dashboard List equipment (with photo upload), track rental requests, analytics
🛡 Admin Dashboard Dark glass UI — manage users, approve equipment, view platform stats
🔐 JWT Authentication Secure login with role-based access (FARMER, RETAILER, ADMIN)
📷 Profile Photos Upload profile picture during registration; shown in dashboard avatar
🖼 Equipment Images Retailers can upload equipment photos when listing
📱 Responsive Design Works on desktop and mobile
🗺 Location-aware Equipment listed by city / district

🏗 Tech Stack

  • Backend: Spring Boot 3.2.5, Spring Security + JWT, Spring Data JPA
  • Frontend: Thymeleaf, Vanilla CSS, Bootstrap Icons, Inter font
  • Database: H2 (dev) / PostgreSQL (prod)
  • Build: Maven 3.8+
  • Java: 17+

🚀 Quick Start

Prerequisites

java -version   # must be 17+
mvn -version    # must be 3.8+

Run in Development (H2 in-memory database)

cd krishisheba-master
mvn spring-boot:run -Dspring-boot.run.profiles=dev

App starts at http://localhost:8081

Default Test Accounts

Username Password Role
farmer1 password123 FARMER
retailer1 password123 RETAILER
admin admin123 ADMIN

📌 Key URLs

URL Description
http://localhost:8081/ Landing page
http://localhost:8081/equipment Public equipment listing
http://localhost:8081/dashboard?username=farmer1 Farmer dashboard
http://localhost:8081/dashboard?username=retailer1 Retailer dashboard
http://localhost:8081/dashboard?username=admin Admin dashboard
http://localhost:8081/signup Registration (with profile photo)
http://localhost:8081/login Login

🔌 REST API Endpoints

Public (No Auth Required)

GET  /api/public/equipment          – List all equipment (paginated)
GET  /api/public/equipment/{id}     – Equipment details
GET  /api/public/equipment/search   – Search by type, city, price
GET  /api/public/stats              – Platform statistics

Auth Required

POST /api/auth/login                – Login → returns JWT token
POST /api/auth/register             – Register new user

POST /api/equipment                 – Add equipment (RETAILER)
GET  /api/equipment                 – My equipment (RETAILER)

GET  /api/admin/users               – All users (ADMIN)
PUT  /api/admin/equipment/{id}/approve  – Approve equipment (ADMIN)

🗂 Project Structure

src/
├── main/
│   ├── java/com/krishisheba/
│   │   ├── controller/        # REST + MVC controllers
│   │   ├── model/             # JPA entities (User, Equipment, Rental)
│   │   ├── repository/        # Spring Data JPA repos
│   │   ├── service/           # Business logic
│   │   ├── security/          # JWT filter, SecurityConfig
│   │   └── dto/               # Data Transfer Objects
│   └── resources/
│       ├── templates/         # Thymeleaf HTML pages
│       │   ├── index.html          – Landing page
│       │   ├── farmer-dashboard.html
│       │   ├── retailer-dashboard.html
│       │   ├── admin-dashboard.html
│       │   ├── signup.html         – Registration with profile photo
│       │   ├── login.html
│       │   └── equipment/          – Equipment list & detail pages
│       ├── static/
│       │   ├── css/modern-style.css
│       │   ├── js/modern-app.js
│       │   └── images/             – Farm equipment photos
│       ├── application.yml         – Main config
│       └── db/migration/           – Flyway SQL migrations

🖼 Dashboard Previews

Dashboard Theme Key Feature
Farmer 🟢 Green sidebar Browse equipment with images + Rent
Retailer 🟢 Green sidebar (unified) Add equipment with photo upload
Admin ⚫ Dark glassmorphism Approve equipment, manage users

🔧 Environment Variables (Production)

DATABASE_URL=jdbc:postgresql://localhost:5432/krishisheba
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=yourpassword
JWT_SECRET=your-256-bit-secret-key

📜 License

MIT License — © 2025 KrishiSheba Team

About

Modern Agricultural Equipment Rental Platform | Frontend built with HTML5, CSS3 & JavaScript | Single-file, responsive, and interactive UI | MIT License

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors