Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use an official Python runtime as a parent image
FROM python:3.10-slim

# Set the working directory in the container
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Expose port 5000 for the Flask app
EXPOSE 5000

# Set the FLASK_APP environment variable to point to financial.py
ENV FLASK_APP=financial.py

# Run the application, binding to all interfaces
CMD ["flask", "run", "--host=0.0.0.0"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Tshenolo Mos

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
101 changes: 101 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Financial Dashboard in Python

A Flask-based financial dashboard that enables users to upload CSV files containing transaction data and view insightful summaries and visualizations of their income, expenses, and savings. The dashboard provides monthly breakdowns, income and expense charts, and savings metrics.

![Screenshot](screenshot.png)

## Features

- **Upload CSV Files:** Easily upload a CSV file with your transaction data.
- **Monthly Income and Expense Tracking:** View your monthly income and expenses in grouped bar charts.
- **Category-wise Expense Breakdown:** Analyze expenses by category, excluding "Savings" from the breakdown.
- **Total Income, Expenses, and Savings Summary:** Get a snapshot of total income, total expenses, and total savings with an intuitive indicator display.
- **Savings Percentage Calculation:** Understand the percentage of income saved.

## Installation

1. Clone this repository:
```bash
git clone https://github.com/Incipiens/FinancialDashboardPython.git
```

2. Navigate to the project directory:
```bash
cd FinancialDashboardPython
```

3. Create a Python 3.10 virtual environment:
```bash
python3.10 -m venv env310
```


4. Activate the virtual environment:
- On Windows:
```bash
env310\Scripts\activate
```

- On macOS/Linux:
```bash
source env310/bin/activate
```

5. Install required packages within the activated environment:
```bash
pip install -r requirements.txt
```

6. Run the app:
```bash
python financial.py
```
The app will be available at http://localhost:5000/.

## Docker Deployment
To run the Financial Dashboard application using Docker:
1. Build the Docker image:
```bash
docker build -t financial-dashboard .
```

2. Run the Docker container:
```bash
docker run -p 5000:5000 financial-dashboard
```

3. Access the application: Open your browser and navigate to http://localhost:5000/.
This will start the application in a Docker container, making it accessible on port 5000 of your local machine.

## Usage
1. Navigate to the homepage of the application.
2. Upload a CSV file with columns Date, Category, and Amount:
- Date: The date of the transaction (format: YYYY-MM-DD).
- Category: The category for each transaction (e.g., Groceries, Rent).
- Amount: The transaction amount, where positive values indicate income and negative values indicate expenses.
3. View the financial summaries and insights, including:
- Income vs. Expenses Chart: A grouped bar chart of income and expenses by month.
- Expenses by Category: A pie chart of expenses by category, excluding savings.
- Savings Summary: Displays total income, total expenses, and savings with the savings percentage.

## Files
- financial.py: Main application file with routes and logic for processing the CSV file and generating graphs.
- templates/index.html: Template for displaying the dashboard with charts.
- requirements.txt: Dependencies for the project.

## Example CSV Format
```csv
Date,Category,Amount
2024-01-01,Salary,2000
2024-01-10,Rent,-800
2024-01-15,Groceries,-150
2024-02-01,Salary,2000
2024-02-10,Rent,-800
2024-02-15,Entertainment,-120
```

## Contributing
Feel free to open issues or submit pull requests for improvements and new features!

## License
This project is open-source and available under the MIT License.
Binary file added favicon.ico
Binary file not shown.
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Flask==2.1.3
Werkzeug==2.0.3
pandas==1.5.3
numpy==1.23.5
plotly==5.6.0
Binary file added screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.