How prasadbhatane/employee-management-system---flask works
Project type and purpose
• This is a full-stack web application called “Employee Management System” built in Python.
• It consists of two distinct Flask services:
• A RESTful API service (“api” folder) using Flask-RESTful and SQLAlchemy against a MySQL database
• A server-rendered frontend web app (“app” folder) using Flask templates and static assets
File structure
• Top level
• README.md – high-level overview and instructions
• api/
• api.py – Flask-RESTful application entry point
• resources.py – endpoint definitions (e.g. EmployeeResource)
• models.py – SQLAlchemy ORM class definitions
• db.py – database connection/session setup
• settings.py – configuration (DB URI, API settings)
• app/
• app.py – front-end Flask application entry point, defines view routes
• system.py – likely business-logic or API client wrapper
• templates/ – Jinja2 templates (home, login, register, admin, details, edit)
• static/style.css – UI styling
README for additional insights
• The system follows REST API protocols for CRUD operations on employee data.
• Front end and API must be run separately (two processes).
Main components
a. External Actors
• User’s web browser (employee or admin)
b. Frontend Service (“app”)
• Routes (login, register, view/edit details)
• Templates and Static assets
• system.py (business logic or HTTP client)
c. Backend API Service (“api”)
• Flask-RESTful app (api.py)
• Resource layer (resources.py)
• Data layer (models.py + db.py)
• Configuration (settings.py)
d. MySQL Database
• Stores employee records and credentials
Relationships and data flows
• User browser <—HTTP—> Frontend Flask app
• Frontend app (system.py or direct HTTP) <—HTTP—> Backend REST API
• Backend API <—SQLAlchemy calls—> MySQL DB
Architectural patterns and design principles
• Separation of concerns
• Presentation layer (app/templates)
• API/business logic layer (api/resources.py)
• Data access layer (api/models.py + db session)
• RESTful architecture for API
• MVC style in the frontend: Controllers (view functions in app.py), Models (remote API), Views (templates)
Key technologies and frameworks
• Python 3.x
• Flask (both services)
• Flask-RESTful (API routing & resources)
• SQLAlchemy (ORM)
• MySQL (relational database)
• Jinja2 templates, CSS
Detail without over-fragmentation
• Every logical component (configuration, resource layer, templates)
• Dependencies and data flows
User → Frontend Flask App → Backend REST API → MySQL Database,
along with all internal subcomponents and technologies.