2. System Architecture Diagram
flowchart TD
A[User]
B[Frontent]
subgraph System["Docker Container"]
subgraph Backend["Spring Boot API"]
C[Controller Layer]
D[Service Layer]
E[DAO Layer]
F[Transaction Logger]
end
end
H[(SQL Database)]
A --> B
B --> Backend
D --> F
C --> D
D --> E
E --> H
F --> H
Components
- User
The system begins with the User, who interacts with the application through a user interface.
- Frontend
The Frontend acts as the presentation layer.
It receives user input and sends requests to the backend system.
It is responsible for displaying data and handling user interactions.
- Backend (Spring Boot API)
The backend is implemented using Spring Boot and runs inside a Docker container.
It follows a layered architecture consisting of:
a. Controller Layer
Entry point for incoming requests from the frontend.
Handles HTTP requests and routes them to the appropriate service methods.
b. Service Layer
Contains business logic and application rules.
Processes data received from the controller.
Coordinates interactions with the data access layer.
Sends logs to both the Logger and Transaction Logger.
c. DAO Layer (Data Access Object)
Responsible for interacting with the database.
Performs CRUD operations and abstracts database access from the service layer.
d. Logger
Used for general application logging.
Captures system events and debugging information.
e. Transaction Logger
Specifically logs transactional activities.
Helps track and audit database-related operations.
- Docker Container
The entire backend system is encapsulated within a Docker container, ensuring:
Portability
Consistent runtime environment
Simplified deployment
- SQL Database
A relational database used for persistent data storage.
Accessed exclusively via the DAO layer.
Stores application data in structured tables.
Data Flow
The User interacts with the Frontend.
The Frontend sends requests to the Spring Boot Backend.
Requests first reach the Controller Layer.
The Controller Layer forwards requests to the Service Layer.
The Service Layer:
Applies business logic.
Logs activity using the Logger and Transaction Logger.
Calls the DAO Layer for data operations.
The DAO Layer interacts with the SQL Database to retrieve or store data.
The response travels back through the layers:
DAO → Service → Controller → Frontend → User.