A Python-based Financial Advisor app that supports multi-user login and personalized financial tracking. Users can register, log in, add income and expenses, view their transaction history, generate financial summaries, and save their data to a MySQL database. The project uses CSV files per user and MySQL tables linked by foreign keys to keep data separated and secure.
- User registration and login with unique usernames and passwords
- Passwords securely hashed using bcrypt
- Individual user transaction data stored in user-specific CSV files
- Persistent storage of users and transactions in MySQL database
- Database schema includes users table and TransactionsData table linked by foreign key with cascade delete
- Simple and easy to use menu navigation
- Input validation for financial entries
- Automatic creation of database tables on first run
- Data synchronization between CSV and database for each user
- Python 3.11.0
- MySQL 8.0.43 with SQLAlchemy 2.0.44
- bcrypt for password hashing
- python-dotenv for environment variable management
- Built-in CSV module for file storage
- Datetime module for date management
- Install Python 3.11.0 if not already installed
- Ensure MySQL server is installed, running and connected
- Create a MySQL database named
budget_app - Install required Python packages:
pip install sqlalchemy pymysql python-dotenv bcrypt- Create a
.envfile in the project root using.env.exampleas a template:
DB_USERNAME=root
DB_PASSWORD=your_password
DB_HOST=localhost
DB_NAME=budget_app
Navigate to the project folder in your terminal and run:
python main.py- Register a new user or login with existing credentials
- Use the menu to add income, expenses, view transactions, calculate summary, or save data
- Each user's records are isolated in a CSV file and corresponding database entries
- The system enforces data integrity using foreign keys and cascades deletions automatically
- To exit, choose the exit option from the menu
your-project/
├── .env ← your credentials
├── .env.example ← template
├── .gitignore
├── database.py
├── entry_model.py
├── file_store.py
├── main.py
├── user.py
├── requirements.txt
├── budget_app.sql
└── saves/ ← auto-created, stores user CSV files
- Passwords are hashed using bcrypt before storing in the database
- Database credentials are stored in a
.envfile and never committed to version control - The
saves/folder containing user CSV files is excluded from Git via.gitignore
- Ensure MySQL server is running before starting the application
- Never share or commit your
.envfile