How badrobin/ua_team_final_project works
Project Type and Purpose
• This is a full-stack web application designed to automate enterprise order management. It supports creating orders, approval workflows, supplier order management, and integration with external services like DigitalOcean Spaces for cloud storage.
• The README highlights key roles (Administrator, User, Head of Department, Finance, and Supply Manager) and background processes (price list processing, CSV parsing, archiving orders, etc.), which directly influence the system’s architectural elements.
File Structure
• The “src/main” directory houses the Java backend with a clear package structure: config, controllers, dto, models, repositories, and services. This suggests a layered (or MVC) design:
• Controllers: Handle HTTP requests (e.g., ProductController, AppController, SupplierOrderController).
• Services: Encapsulate business logic (e.g., OrderService, SupplierOrderService, DigitalOceanStorageService, EmailService).
• Repositories: Interface with the database using Spring Data JPA (e.g., UserRepository, OrderRepository, SupplierRepository).
• Configuration: Contains DigitalOcean and Security configuration settings.
• “src/main/resources” contains static files (HTML, CSS, JavaScript) and templates, supporting the frontend piece.
• The Maven build configuration (pom.xml, mvnw wrapper scripts, etc.) reinforces that this Java/Spring Boot application is managed via Maven.
a. Main Components:
• Frontend/UI:
• HTML templates (in src/main/resources/templates) and static assets (CSS and JavaScript in src/main/resources/static).
• Acts as the presentation layer, rendering pages for login, order management, and supplier order interfaces.
• Backend Application:
• Controllers: Entry point for incoming HTTP requests.
• Services: Business logic layer implementing workflows (order creation, email notifications, CSV file parsing, etc.).
• Repositories: Data access layer interfacing with MySQL.
• Models/DTOs: Represent data structures for orders, users, and supplier-related entities.
• Security:
• Spring Security configuration manages authentication and role-based access.
• External Components:
• Database (MySQL) for persistent storage.
• Cloud Services (DigitalOcean Spaces) for file storage and server hosting.
• Email Service: To send out supplier orders and order notifications.
b. Relationships and Data Flow:
• Requests from the user’s web browser (frontend) are routed to the backend’s controllers.
• Controllers invoke the appropriate services that encapsulate business logic like order processing or CSV parsing.
• Services interact with repositories for CRUD operations and database persistence.
• The security configuration (via SecurityConfig and CustomUserDetailsService) governs access control across these layers.
• Outgoing communications include:
• EmailService sending notifications/emails (e.g., OrderEmailSender).
• DigitalOceanStorageService managing file uploads/downloads.
Architectural Patterns and Principles
• The system uses a layered (MVC) architecture that cleanly separates concerns:
• The web layer (controllers and templates) is separated from the business logic (services) and data access (repositories).
• The configuration files (such as SecurityConfig and DigitalOceanConfig) indicate dependency injection and external configuration aspects via Spring Boot.