Project Expense, Analysis and Reporting System (PEARS) is a web-based financial management application for small-scale projects and companies. Developed using Python integrated with PostgreSQL, the app enables efficient project cost control by creating a centralized database for multiple projects, allowing users to formulate budgets, track monthly expenses, and ensure financial transparency.
Open for installation guide
To run this project locally, please follow these steps:
git clone https://github.com/josh-rdc/PEARS-dashapp
-
Ensure PostgreSQL is installed on your machine. Follow this PostgreSQL Tutorial Page if not.
To check if the app is installed and added to your environment variables properly, run the version inquiry in the terminal:
psql --version
-
Create the Database
To create the database, log in to your PostgreSQL server:
psql -U postgres
Run the following command to create the database
PEARSdb
:CREATE DATABASE PEARSdb;
Exit the psql shell:
\q
-
Build the Schema tables
Navigate to the
App Files
folder from the cloned repository:cd "C:\Users\Josh\000 Files\010 Portfolio\04 PEARS-dashapp\App Files"
Run the following terminal command to create the required tables from the
create_tables.sql
file:psql -U postgres -d PEARSdb -f create_tables.sql
-
Update the
apps/dbconnect.py
file with your PostgreSQL connection details:db = psycopg2.connect( host='localhost', # Update if running on a different host database='PEARSdb', # Database name user='your_username', # PostgreSQL username port=5432, # Default PostgreSQL port password='your_password' # PostgreSQL password )
-
Install the required libraries:
pip install -r requirements.txt
-
Run the application:
python app.py
-
Each user has an individual account to log in to the application.
-
User credentials (user ID and password) are created and managed by the application admin to control access.
-
User roles are divided into two:
- Top Management (TM) which has access to all projects and could add new projects.
- Project-In-Charge (PIC) which has only access to specific projects assigned to them.
PostgreSQL Table Sample
Sample `users` table:  -
After logging in, users are directed to the homepage which includes:
- Details about the report generation process.
- Descriptions of the application's features and how to use them.
- Definitions of available pages and their contents.
-
Project Profile displays project name, contract amount, total budgeted amount, scope, location, client, start and end date.
-
Commercial Management Overview
- Target Profit: Shows the difference between the total contract amount and the budgeted amount, providing an estimate of the project’s profit margin.
- Remaining Budget: Indicates the total budgeted amount minus the current total running expenses, helping forecast the final profit.
- Main Items: Lists the top five items with the highest allotted budget and their current running total expenses for effective monitoring.
-
Monthly Project Expense compares planned expenses (total budget divided by the number of months) with actual expenses on a monthly basis.
Only TM accounts can add new projects.
- Click the “ADD” button to open the project creation interface.
- Fill in the basic project details: project name, contract amount, scope, location, client name, and schedule.
- Assign a project In-Charge from a drop-down list of users.
- Ensure all non-null fields are completed to avoid errors.
PostgreSQL Table Sample
- Project ID is a 5-digit number automatically generated by the system; takes the form of YYXXX (last two digit of the year then three-digit number starting from 001)
- A project In-charge ID can be assigned to multiple projects
-
General Interface
- Access the "MANAGE" tab from the navigation bar.
- Select the project to manage from the project form.
- TM accounts can edit data for all projects, while PIC accounts can only edit their assigned projects.
-
- Toggle to
“Budget”
mode. - Enter budget data directly into the table or upload a CSV file.
- Based on needed action, table contents could be cleared or saved to the project budget.
PostgreSQL Table Sample
- Budget ID is automatically generated based on the Project ID and takes the form “b-YYXXX” (adds a prefix “b-“ to the Project ID for easy recognition)
- Items database will take all the items across different projects. Item ID is also automatically generated via the “Serial” method in SQL. Perform checks whenever a budget is uploaded, if an item name already exist in the database, similar item ID is used, if new item ID is uploaded, assign a new item ID.
- Toggle to
-
- Toggle to
“Expense”
mode. - Enter expenses into the table or upload a CSV file.
- Based on needed action, table contents could be cleared or saved to the project expenses.
- Ensure expenses are budgeted and item names match the budget exactly.
PostgreSQL Table Sample
- Expense ID is also an automatically generated ID based from the Budget ID which takes the form “b-YYXXX-XXX" (simply adds “-XXX” starting from -001 to the Budget ID). This enables the user to add multiply expenses to the project while emphasizing the source budget.
- Item ID automatically matches the Item Name from the Item Database.
- When an item name not listed in the budget is attempted to be saved in the database, an error will occur indicating the that expenses should be budgeted.
- This also add the constraint that the item name should perfectly match the names initially indicated in the budget. For example, Indirect Labor indicated in budget cannot be saved as Indirect in the expense.
- Toggle to