Moneytrail is a Flask-based web application that provides functionality for user registration, login, logout, and managing expenses. This README provides instructions on how to set up, run, and use the application.
To run the application, you'll need Python 3 and MySQL installed. You can set up your environment by following these steps:
-
Clone this repository to your local machine:
git clone <repository-url>
-
Change to the application directory:
cd <application-directory>
-
Set up a virtual environment (optional but recommended):
python3 -m venv venv source venv/bin/activate # On Linux and macOS # On Windows: source venv/Scripts/activate
-
Install the required packages using pip:
pip install -r requirements.txt
-
Update the
app.pyfile with your MySQL database connection details:app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+mysqlconnector://<username>:<password>@<host>:<port>/<database>'
- Replace
<username>,<password>,<host>,<port>, and<database>with your MySQL credentials and database information. - If your password contains special characters (e.g.,
@), make sure to URL encode the password (e.g.,%40for@).
- Replace
-
Set the
SECRET_KEYinapp.py:app.config['SECRET_KEY'] = 'your_secret_key'
- Replace
'your_secret_key'with a secure, random secret key for Flask session management.
- Replace
-
Create the necessary database tables:
python3 main.py
To run the application:
-
Start the Flask development server:
python3 main.py
-
Open your web browser and navigate to
http://localhost:5000to access the application.
The application provides various API endpoints for user and expense management:
/register(POST): Register a new user./login(POST): Log in an existing user./logout(GET): Log out the current user./expenses(GET, POST): Retrieve all expenses for the logged-in user or add a new expense./expenses/<int:expense_id>(PUT, DELETE): Update or delete an existing expense.
Contributions to the application are welcome! To contribute, please fork the repository, create a branch, and submit a pull request.
The application is licensed under the MIT License. See the LICENSE file for more information.