How highoncarbs/hafta works
Main Components
• Client Side (Frontend):
– User Interface components rendered through HTML templates in the “app/templates” folder.
– Static assets (CSS, JavaScript files, images, and HTML component fragments) found under “app/static.”
– Frontend libraries like Bulma, Vue.js, and Buefy.
• Server Side (Backend):
– The core Flask application initialized in “app/__init__.py” and constructed modularly using Blueprints.
– Modules responsible for specific functionalities:
• Authentication (app/auth)
• Employee management (app/employee)
• Main operations (app/main)
• Master data management (app/master) for handling entities like departments, benefits, and attendance rules.
• Reporting (app/report)
• Transactions (app/transaction) handling payroll, performance, etc.
– Configuration settings in “config.py.”
– The main entry point “run.py” which starts the Flask server.
• Database Layer:
– MySQL as the backend database configured via SQLAlchemy.
– Models that represent business entities, primarily defined in various module-specific model files.
– Migration scripts maintained in the “migrations” folder using Alembic.
• Deployment & Infrastructure:
– Deployment-related configuration (like nginx-site-conf.txt) and service definitions (hafta.service).
– Possible role of external tools (e.g., Nginx as a reverse proxy).
Out Relationships & Interactions
• How requests flow from the client (web browser) to the Flask server.
• That each Blueprint (auth, employee, etc.) handles specific URL routes (visible in “routes.py” files) and interacts with the underlying database via SQLAlchemy.
• Connection from the Flask application to the MySQL database and how migrations fit into this architecture.
• External dependencies: client-side framework libraries (Vue.js, Bulma), and any deployment tools (Nginx).
Architectural Patterns and Important Details
• Modular design provided by Flask Blueprints – each major function (auth, employee, master, report, transaction) is encapsulated into its own module.
• That the project uses Model-View-Controller (MVC) or rather a similar separation; the “models” (both in app/model.py and module-specific model files) handle data, “views” are represented by the HTML templates and routes, and the “controllers” are the logic in the route functions.
• Components such as:
– Controller Layer: route handlers in each module (e.g., app/auth/routes.py, app/main/routes.py).
– Views: HTML templates in “app/templates.”
– Models: Data models in “app/master/model.py”, “app/employee/model.py”, etc.
– Migration and configuration: “migrations” directory and “config.py.”
Relevant Technologies
• Python3 and Flask for the backend.
• SQLAlchemy for data modeling.
• Alembic for database migrations.
• MySQL as the database.
• Frontend technologies: Bulma (CSS), Vue.js (JS framework), and Buefy.
• Additional files such as nginx-site-conf.txt suggest a recommendation for using Nginx in production.