How nieele/invacc_desktop works
And illustrate the primary system components
• Frontend: Represent this with a component labeled “Frontend” containing HTML pages (index, catalog, item, etc.), CSS, JS, and static assets. This layer handles user interaction and presentation.
• Backend: Represent the backend as a service or set of services. Inside the backend, include:
• Command / Server Layer: The main.go file that starts the server.
• Routing Layer: Including the router (router.go) that directs incoming HTTP requests.
• Handlers: For example, auth_handler, customer_handler, item_handler, and rent_handler, which process various API endpoints.
• Middleware: To handle cross-cutting concerns like authentication or logging (found in the middleware directory).
• Business Logic/Services: Auth, Customer, Item, Rent services which encapsulate core business rules.
• Repository Layer: Abstract database interactions (auth_repository, customer_repository, etc.).
• Configuration: The config module that loads and processes settings.
• Utility Modules: Any shared packages, such as the PostgreSQL connection defined in pkg/db.
• Database: A component representing the data persistence layer. Highlight that this is likely a PostgreSQL database, including the relevant SQL scripts found in the “base/createDB” folder for tables, audit, functions, triggers, views, roles, and extensions.
Relationships and interactions between components
• Within the Backend, clearly illustrate how the server’s entry point (main.go) invokes the router which, in turn, calls appropriate handlers.
• That each handler uses the service layer to process business logic and then delegates data operations to the repository layer.
• That some configuration and environmental settings (from config modules or template.yaml) influence how the backend operates.
Architectural patterns and design principles
• That the backend follows a layered (or possibly hexagonal) architecture with clear separation between routing/HTTP handling, business logic (services), and data access (repositories).
• Optionally, highlight the MVC-like division (even though it isn’t strictly MVC, the separation of concerns is evident).
• For the database, note that initialization and schema definitions (SQL scripts in “base/createDB”) are part of the complete system design.
Relevant technologies and integrations
• Frontend: Vanilla HTML, CSS, and JavaScript.
• Backend: Go (with dependency management using go.mod and go.sum), and its standard libraries as well as any third-party packages indicated by the structure.
• Database: PostgreSQL, as implied by the package “pkg/db/postgresql.go” and the SQL scripts.
• Additional modules: Mention any config templating and deployment scripts evident in the project.