Student Finance Tracker is a containerized web application designed to help students manage and track their personal finances. Users can log their spending across categories (transportation, books, food, etc) in interactive charts that visualize their spending habits over time. The objective of this project is to encourage financial literacy and provide students with a simple tool to budget and analyze their expenses.
The system consists of three main components:
- Web Application: Built with Flask, providing user authentication, expense tracking, and data visualization.
- MongoDB Database: Stores user accounts, transactions, categories, and budgets.
- DockerHub and Docker Compose Setup: Uses Docker Compose to run everything, and DockerHub to store data for the app and database, keeping deployment much faster.
Our containerized applications are available on Docker Hub:
- Frontend Application: finance-tracker-frontend
- Backend Database: finance-tracker-backend
Follow these steps to get your development environment up and running:
Ensure that pipenv is using Python 3.8. If it is not, reinitialize it:
pipenv --rm
pipenv --python 3.8
pipenv --py # This will show a Python 3.8 pathWe can verify that it works by running:
pipenv --py # This will show a Python 3.8 path cd path-to-5-final-fizzbuzzpipenv installpipenv shelldocker compose up --buildOnce the Docker build is complete, open your browser and go to: http://localhost:8000
MongoDB is automatically started by Docker Compose. Database details:
- Database Name: finance_tracker
- Collection: users, transactions, categories, budgets
- Port: 27017
The database is automatically initialized with default categories when the application starts. The initialization script (database/init_db.py) performs the following tasks:
- Creates necessary indexes for better query performance
- Loads default expense/income categories
If you need to manually initialize the database, you can run:
cd database
python init_db.pyCreate a '.env' file at the project root as these variables are required for the application to connect to MongoDB and manage session security. Example:
MONGO_URI=mongodb://localhost:27017/finance_tracker
FLASK_SECRET_KEY=your_secret_key- Create a feature branch for your changes
- Make your changes and commit them
- Create a pull request
- Get code review from at least one team member
- Merge after approval
All unit tests must pass before merging any changes:
# Run backend tests.
cd app
pytest --cov=app tests/ --cov-report=term-missing --cov-fail-under=80
# Run database tests
cd database
pytest --cov=database tests/ --cov-report=term-missing --cov-fail-under=80