PayFlow is designed to provide a secure, efficient, and user-friendly payroll management system for organizations. It enables employees, HR, and admins to manage payroll activities seamlessly, including salary calculations, tax deductions, and paycheck generation.
- User Authentication (Employee, HR, Admin) Secure login for employees, HR personnel, and admins with role-based access control to ensure that each user only access their relevant data
- Salary Calculation and Tax Deductions Automatically calculate employee salaries, including tax deductions, bonuses, and overtime, ensuring accurate payroll processing
- Paycheck PDF Generation Generate downloadable PDF paychecks for employees, complete with salary breakdown, taxes, and deductions, providing a professional, paperless solution
- Role-Based Access Control Restrict access to sensitive payroll data based on user roles (employee, HR, admin), ensuring data security and proper authorization for each action
-
Python (Flask)
- Flask - Lightweight Python web framework for building the API and managing server-side logic
- Routing - Manages URL routing to different endpoints for user login, payroll management, and paycheck generation
- User Authentication - Implements secure login and registration processes, handling multiple roles (employee, HR, admin)
- Session Management - Uses Flask's session management to maintain logged-in status and ensure secure access to protected routes
- Salary Calculation Logic - Contains Python functions for salary computation, tax calculations, and deductions, streamlining payroll processing
-
SQLite
- Database - Stores user data (employee, HR, admin roles) and payroll information (salary details, tax calculations, pay periods)
- Lightweight - SQLite is a file-based database that offers a simple and portable solution for the project's database needs
- Data Integrity - Handles transactinal data, ensuring accurate payroll records with rollback capabilities for error handling
- Query Operations - Manages all CRUD operations (Create, Read, Update, Delete) related to user and payroll data
-
ReportLab
- PDF Generation - Generates downloadable paycheck PDFs with detailed breakdowns of the salary, deductions, and taxes
- Dynamic Content - Customizes paycheck layout based on user data, ensuring a professional and clear format for employees
- Integration - Integrates seamlessly with the backend to generate and serve the PDFs directly to users upon request
-
HTML
- Structure - Provides the fundamental structure for the website's page, including the login page, payroll dashboard, and paycheck detail page
- Forms - Facilitates user input through forms (login, registration, salary requests) for efficient data capture
- Dynamic Content - Displays user-specific payroll data using placeholders that are dynamically filled by the backend
-
CSS
- Styling - Provides a clean and modern visual design for the user interface, ensuring an intuitive experience for users
- Responsive Design - Ensures the application looks great on all devices, from desktops to mobile phones, using responsive grid layouts and media queries
- Notifications - Styles notification messages (e.g. success, warning, error) for user feedback, ensuring clarity and ease of understanding
-
JavaScript
- Interactivity - Adds interactive elements, such as handling the "Download Paycheck (PDF)" button, confirmation prompts, and error handling on the frontend
- AJAX Requests - Makes asynchronous requests to the backend for dynamic updates without requiring page reloads
- Client-Side Validation - Validates form inputs (e.g., login credentials) to provide immediate feedback to users before submitting the data to the backend
- User Notification - Implements notifications to inform users of successful or failed actions (e.g. paycheck generation) for better UX
- Python 3.x
- Flask
- ReportLab (for PDF generation)
- Clone the Repository
git clone https://github.com/thaokvu/PayFlow.git- Create and activate a virtual environment (optional but recommended)
python3 -m venv venv
# For Unix-based platforms (Linux and macOS)
source venv/bin/activate
# For Windows
venv\Scripts\activate- Install Dependencies
pip install -r requirements.txt
# If you don't have a requirements.txt, manually install the dependencies
pip install flask reportlab- Run the Flask Application
python app.py
# By default, the app will be running at http://127.0.0.1:5000/-
Access the Application
- Login Page
http://127.0.0.1:5000/- Admin
- Username - admin
- Password - adminpassword
- Employee
- Username - employee
- Password - employeepassword
- Manager
- Username - manager
- Password - managerpassword
- Admin
- Dashboard Page
http://127.0.0.1:5000/dashboard/<username>- Admin
http://127.0.0.1:5000/dashboard/admin - Employee
http://127.0.0.1:5000/dashboard/employee - Manager
http://127.0.0.1:5000/dashboard/manager
- Admin
- Paycheck Details Page
http://127.0.0.1:5000/paycheck_details/<username>- Admin
http://127.0.0.1:5000/paycheck_details/admin - Employee
http://127.0.0.1:5000/paycheck_details/employee - Manager
http://127.0.0.1:5000/paycheck_details/manager
- Admin
- Login Page
app.py- Contains the main Flask application logic, including the routes for login, dashboard, and paycheck PDF generationtemplates/- Contains the HTML files (e.g.,index.html,dashboard.html,paycheck_details.html) used for rendering the web pagesstatic/- Contains the static files such as images or stylesheetsrequirements.txt- Lists the Python dependencies for the application
- Homepage (
/)
- Method -
GET - Displays the login form for users
- Login (
/login)
- Method -
POST - Handles user login
- Upon success, redirects the user to their dashboard
- Dashboard (
/dashboard/<username>)
- Method -
GET - Displays the user-specific dashboard based on the username
- It shows details like role and provides a link to generate a paycheck
- Generate Paycheck PDF (
/generate_paycheck/<username>)
- Method -
GET - Generates and downloads the paycheck PDF for the user, including the payroll details like salary, tax deductions, and net pay
- Paycheck Details (
/paycheck_details/<username>)
- Method -
GET - Displays detailed paycheck information (salary, deductions, etc.) in a clean, readable format on the web page
PayFlow.Demo.mp4
- Add More Roles - You can add additional roles (e.g., "HR", "Contractor", etc) by adding corresponding payroll data in the
payroll_datadictionary inapp.py. - Modify the PDF Style - The PDF generation logic can be customized to match your company's branding (e.g., colors, fonts, layout).
- Authentication Logic - Right now, the app uses a simple username check, but you can replace this with proper authentication (e.g., using Flask-Login for session management).
- Fork the repository.
- Create a new branch (
git checkout -b feature-xyz). - Make changes and commit (
git commit -am 'Add new feature'). - Push to the branch (
git push orgin feature-xyz). - Create a new pull request.