This project is a basic Human Resource Information System (HRIS) built using Flask (Python), MariaDB, HTML, CSS and Javascript. It is designed for small to medium-sized organizations to manage employee records, attendance, leave, organizational structure, and access control. The system prioritizes clarity, simplicity, and direct database-backed workflows over abstractions or external frameworks.
- Backend: Python (Flask)
- Database: MariaDB
- Frontend: HTML (Jinja2 templates)
- Authentication: Flask sessions + password hashing
- Architecture: Monolithic Flask application
- Central employee registry
- Personal and employment details
- Employment status tracking
- CRUD operations for employee records
- Daily clock-in and clock-out records
- Attendance status tracking (present, absent, late)
- Employee-level attendance history
- Leave types (annual, sick, unpaid)
- Leave balances per employee
- Leave request and approval workflow
- Manager-based approvals
- Job roles and departments
- Reporting hierarchy (manager–subordinate relationships)
- Ability to determine “who reports to whom”
- User authentication (login/logout)
- Role-based access control:
- Admin
- HR
- Manager
- Employee
- Password hashing
- Route-level access restrictions
hris/ │ ├── app.py # Application entry point ├── config.py # Database and app configuration ├── requirements.txt # Python dependencies │ ├── database/ │ └── schema.sql # MariaDB table definitions │ ├── routes/ │ ├── auth.py # Authentication and sessions │ ├── employees.py # Employee master data │ ├── attendance.py # Time & attendance │ ├── leave.py # Leave management │ └── roles.py # Roles and reporting structure │ ├── templates/ │ ├── base.html │ ├── login.html │ ├── dashboard.html │ ├── employees/ │ ├── attendance/ │ └── leave/ │ └── static/ └── css/
The system uses a relational schema in MariaDB with foreign key relationships. Core tables include:
usersemployeesrolesdepartmentsattendance_recordsleave_typesleave_requestsreporting_structureAll tables use primary keys and enforce referential integrity.
git clone https://github.com/mule-codex/macaroni-hris.git cd hris
pip install -r requirements.txt
- Create a MariaDB database.
- Update database credentials in
config.py. - Run the schema:
mysql -u username -p database_name < database/schema.sql
python app.py Access the system at: http://127.0.0.1:5000
- Passwords are stored as hashed values.
- Flask sessions are used for authentication.
- Access to routes is restricted based on user roles.
- Employees can only access their own data.
- Managers can approve leave for their subordinates.
- HR and Admin have elevated privileges.
- Single-organization deployment
- No payroll processing
- No external integrations
- Minimal frontend styling
- Local or private network usage