How mahirshahriar1/cse-327-enterprise-resource-planning works
• Frontend/User Interface: Represented by the “views” directory. This includes HTML templates, CSS, and JavaScript files (e.g., index.html, login.html, products.html) that form the client-side interface.
• Backend/Application Server: Comprising the “controllers” directory (and its subdirectories for different features such as Invoice, accounts payable, accounts receivable, attendance, auth, etc.). These handlers implement the business logic and process incoming HTTP requests.
• Models/Data Access Layer: Found in the “models” folder. This includes definitions for data objects (e.g., attendance, customer, invoice, product) and the database connection/migration scripts. This component interacts directly with the PostgreSQL database.
• Database: PostgreSQL is used for data persistence. This external service is set up as described in the README (database creation and migrations).
Architectural patterns and relationships
• Model-View-Controller (MVC): The separation into models (data), controllers (business logic and HTTP handlers), and views (user interface) clearly suggests an MVC pattern.
• Feature-Based Organization: Note that each main domain (invoice, attendance, ledger, etc.) is organized into its own directory under “controllers/handlers”. Each handler typically contains the main logic, tests, and a store file which likely provides persistence or data handling logic.
Relationships and interactions
• User interacts with the application through the browser (UI served by “views”). Their requests are sent to the backend.
• The router (in “controllers/routes”) directs these requests to the appropriate handler.
• Handlers coordinate with middleware for tasks like authentication.
• Handlers then interact with business logic and the models for data retrieval, persistence, and processing.
• The models layer communicates with the PostgreSQL database for storing and fetching data.
• The responses are then rendered back into views and delivered as responses to the user.
Incorporate technical specifics and design principles
• Mention the use of Go as the programming language and the significance of Go modules (evidenced by go.mod and go.sum).
• That the system is structured to separate concerns effectively (each ERP function is modularized).
• Integration with external dependencies such as the PostgreSQL DB server and mention testing as a core part of the system (evidenced by test files for almost every handler).