The Cloth Business Management System is a comprehensive, full-stack Spring Boot application designed to manage all aspects of a cloth trading business. It supports inventory, sales, purchases, stakeholders, users, roles, reporting (Excel/PDF), and more. The system is highly modular, secure, and extensible, with a focus on real-world business workflows.
- User Authentication & Authorization (JWT-based, role-based access)
- Inventory Management (Products, Stock, Categories)
- Sales & Purchase Management
- Stakeholder Management (Suppliers, Customers, etc.)
- Store Management
- Comprehensive Reporting (Excel and PDF, with JasperReports)
- Role & Permission Management
- RESTful API (with OpenAPI/Swagger UI)
- Caching (Spring Cache, Redis)
- Custom Fonts & Multilingual Support (Bengali fonts for reports)
- Image Management (logos, product images, etc.)
- Java 17
- Spring Boot 3.3.2
- Spring Data JPA (MySQL)
- Spring Security (JWT)
- Spring Cache (with Redis)
- Apache POI (Excel report generation)
- JasperReports (PDF report generation)
- ModelMapper (DTO mapping)
- Lombok
- Swagger/OpenAPI (API documentation)
- ZXing (QR code generation)
- Custom Bengali Fonts (for PDF reports)
Cloth-Business-Management-System/
├── src/
│ ├── main/
│ │ ├── java/com/cloth/business/
│ │ │ ├── controllers/ # REST controllers (API endpoints)
│ │ │ ├── services/ # Service interfaces
│ │ │ ├── servicesImple/ # Service implementations
│ │ │ ├── repositories/ # Spring Data JPA repositories
│ │ │ ├── entities/ # JPA entities (data model)
│ │ │ ├── payloads/ # DTOs and response/request objects
│ │ │ ├── DTO/ # Additional DTOs
│ │ │ ├── configurations/ # Security, JWT, Redis, etc.
│ │ │ ├── helpers/ # Utility classes
│ │ │ └── ClothBusinessManagementSystemApplication.java # Main entry point
│ │ └── resources/
│ │ ├── application.properties # Main config
│ │ ├── static/
│ │ │ ├── images/ # Logos, product images, etc.
│ │ │ └── reports/pdfTemplates/ # JasperReports templates
│ │ └── fonts/ # Custom fonts
│ └── test/
│ └── java/com/cloth/business/ # Basic test class
├── pom.xml # Maven build file
└── README.md # Project documentation
- JWT-based authentication (see
AuthController,SecurityConfig) - Role-based access control (custom roles, permissions)
- Passwords hashed with BCrypt
- Custom user details and security expressions
- Controllers: Handle API requests for products, stock, sales, purchases, users, roles, stakeholders, reports, etc.
- Services: Business logic for each domain (purchase, sale, stock, user, etc.)
- Repositories: Data access using Spring Data JPA
- Entities: Data model for all business objects
- Excel Reports: Generated using Apache POI (see
ReportExcelServiceImple) - PDF Reports: Generated using JasperReports (see
ReportPDFServicesImple) - Custom Templates: JasperReports
.jrxmlfiles inresources/static/reports/pdfTemplates/ - Fonts: Bengali and other fonts for multilingual support
- QR Codes: Generated for purchase orders
- Store and serve images for products, users, stores, stakeholders
- Logo used in reports
- Spring Cache abstraction
- Redis integration for performance
- Java 17+
- Maven
- MySQL (or compatible DB)
- Redis (for caching)
git clone <repo-url>
cd Cloth-Business-Management-SystemEdit src/main/resources/application.properties with your MySQL credentials and DB name.
mvn clean installmvn spring-boot:run- API base URL:
http://localhost:8080/api/v1/ - Swagger UI:
http://localhost:8080/swagger-ui/index.html
POST /api/v1/auth/register— Register a new userPOST /api/v1/auth/login— Login and receive JWT token
GET /api/v1/users— List usersPOST /api/v1/users— Create userGET /api/v1/user-roles— List roles
GET /api/v1/products— List productsPOST /api/v1/products— Add productGET /api/v1/stock— View stock
POST /api/v1/purchases— Create purchaseGET /api/v1/purchases/{id}/{po}— Get purchase detailsGET /api/v1/sales— List sales
GET /api/v1/stakeholders— List stakeholders
POST /api/v1/reports/profitability— Download profitability report (Excel)GET /api/v1/purchases/generate-pdf/{id}/{po}— Download purchase order report (PDF)
- Generated using Apache POI
- Profitability and transaction reports
- Download via
/api/v1/reports/profitability
- Generated using JasperReports
- Custom templates in
resources/static/reports/pdfTemplates/ - Bengali font support
- QR code and logo included
- Download via
/api/v1/purchases/generate-pdf/{id}/{po}
- JWT token required for most endpoints
- Role-based access (e.g.,
ROLE_ADMIN,ROLE_PURCHASE_CREATE, etc.) - BCrypt password hashing
- Custom security expressions and method-level security
- Add new reports: Create new JasperReports templates and corresponding service methods
- Add new roles/permissions: Update
UserRolesListand related logic - Add new entities: Create new JPA entities, repositories, services, and controllers
- Change branding: Replace logo in
resources/static/images/logo-single.png - Multilingual reports: Add new fonts to
resources/fonts/and update report templates
- Custom Bengali fonts included for PDF reports
- Images for products, users, stores, stakeholders
- Logo used in all reports
- Basic Spring Boot test in
src/test/java/com/cloth/business/ClothBusinessManagementSystemApplicationTests.java - Extend with more unit and integration tests as needed
See pom.xml for a full list. Highlights:
- Spring Boot, Spring Data JPA, Spring Security, Redis, Apache POI, JasperReports, ZXing, ModelMapper, Lombok, Swagger/OpenAPI, MySQL Connector, JWT, custom fonts
- Ensure MySQL and Redis are running before starting the application
- For Bengali/multilingual reports, ensure font JARs are present in
lib/ - API is stateless (no session), uses JWT for authentication
- Swagger UI is enabled for easy API exploration
This project is for educational purpose only. If you want to use the project for business purpose, please see the contact information below.
- Email: shubratodn44985@gmail.com
- Phone: +8801759458961