How rukayaafrin/inventory_management_system_using_spring_boot works
Project Type and Purpose
• This is a full-stack Java web application built with Spring Boot.
• Purpose: an Inventory Management System with user roles (Admin, Mechanic, Supplier), product/catalogue management, stock usage reporting, and email notifications.
File Structure Analysis
• src/main/java/com/team9/motors:
• controller – HTTP entry points (AdminController, ProductController, etc.)
• service – business logic implementations (CatalogueImplementation, ProductImplementation, etc.)
• repository – Spring Data JPA interfaces for CRUD (ProductRepository, InventoryRepository, etc.)
• model – JPA entity classes (Product, Inventory, User, StockUsage, Supplier, etc.) and supporting classes (DateSelector, Role)
• springSecurity – authentication & authorization (SecurityConfiguration, MainUser)
• mail – email utility (JavaMailUtil)
• interfacemethods – defines service contracts (CatalogueInterface, UserInterface, etc.)
• src/main/resources:
• application.properties – DB connection/config
• CreateUser.sql – initial data load script
• static – CSS/JS/fonts/images served to the client
• templates – Thymeleaf HTML views organized into layouts & pages
• Tests: JUnit tests under src/test for application and data bootstrap.
• Build and packaging via Maven (pom.xml) with embedded Tomcat.
README Insights
• Uses MySQL (“team9” schema).
• Generates reports to disk paths configured in service classes.
• Spring Boot run with embedded server.
• JUnit test bootstraps sample data.
a. Main Components
• Client Browser with HTML/CSS/JS (Thymeleaf-rendered views)
• Spring Boot Application
– Presentation Layer (Controllers + Thymeleaf)
– Service Layer (Catalogue, Product, Inventory, Supplier, User, StockUsage logic)
– Data Access Layer (Spring Data JPA Repositories)
– Security Module (Spring Security)
– Mail Module (JavaMailUtil)
• MySQL Database (“team9” schema)
• File System (for report files)
• External SMTP Server (for email notifications)
b. Relationships & Interactions
1. User browser sends HTTP request → Controller
2. Controller invokes Service via interface → applies business rules
3. Service calls Repository → executes SQL on MySQL
4. Service may write report file to disk or send email via JavaMailUtil → SMTP
5. Controller returns model + Thymeleaf template → rendered HTML to client
6. Spring Security intercepts requests → enforces authentication/authorization
c. Architectural Patterns & Principles
• Layered (MVC + Service + Repository)
• Dependency Injection (Spring Beans)
• Convention-over-Configuration (Spring Boot auto-config)
• Interface-driven design (services defined by interfaces)
• Template layout (Thymeleaf reusable layout files)
d. Key Technologies/Frameworks
• Spring Boot (web starter, security, data-jpa)
• Thymeleaf templates
• Spring Data JPA (Hibernate)
• MySQL
• JavaMail (for notifications)
• Maven
Detail Level
• Drill down controllers by logical modules (UserMgmt, ProductMgmt, Inventory, Reporting).
• Interfaces between layers.
• Security filter chain intercepting HTTP requests before controllers.
• Where static resources are served (directly by Spring’s resource handler).