The Personal Finance Web App is a web application that helps users track their saving goals and calculates the monthly deposit needed to achieve those goals. It consists of a back-end built with Django, Django Rest Framework, JWT authentication, and PostgreSQL, and a front-end built with React.
- User registration and login functionality.
- Creation and management of saving goals.
- Calculation of the monthly deposit required to reach a saving goal by a specified deadline.
- Viewing and updating of saving goals.
- Deletion of saving goals.
To run the Personal Finance Web App locally, follow these steps:
- Clone the repository:
git clone <repository_url>
cd personal-finance-web-app
- Set up the virtual environment and install dependencies:
python -m venv env
source env/bin/activate
pip install -r requirements.txt
-
Set up the database:
- Create a PostgreSQL database for the application.
- Update the database settings in the
personal_finance/settings.py
file with your database credentials.
-
Run database migrations:
python manage.py migrate
- Generate a secret key for Django:
python manage.py generate_secret_key
- Copy the generated secret key and replace the
SECRET_KEY
value in thepersonal_finance/settings.py
file.
- Start the development server:
python manage.py runserver
- Access the application at
http://localhost:8000
.
The Personal Finance Web App provides the following API endpoints:
- Endpoint:
/api/auth/register/
- Method:
POST
- Description: Register a new user.
- Request Body:
{
"username": "example_user",
"email": "user@example.com",
"password": "example_password"
}
- Response:
{
"user": {
"id": 1,
"username": "example_user",
"email": "user@example.com"
},
"token": "example_token"
}
- Endpoint:
/api/auth/login/
- Method:
POST
- Description: Log in an existing user.
- Request Body:
{
"username": "example_user",
"password": "example_password"
}
- Response:
{
"user": {
"id": 1,
"username": "example_user",
"email": "user@example.com"
},
"token": "example_token"
}
- Endpoint:
/api/auth/logout/
- Method:
POST
- Description: Log out the currently authenticated user.
- Endpoint:
/api/saving-goals/
- Method:
POST
- Description: Create a new saving goal.
- Request Body:
{
"title": "Example Goal",
"description": "Example goal description",
"amount": 30000,
"deadline": "2025-10-01"
}
- Response:
{
"id": 1,
"title": "
Example Goal",
"description": "Example goal description",
"amount": 30000,
"deadline": "2025-10-01",
"monthly_deposit": 1250
}
- Endpoint:
/api/saving-goals/<goal_id>/
- Method:
PUT
- Description: Update an existing saving goal.
- Request Body:
{
"title": "Updated Goal",
"description": "Updated goal description",
"amount": 40000,
"deadline": "2025-12-01"
}
- Response:
{
"id": 1,
"title": "Updated Goal",
"description": "Updated goal description",
"amount": 40000,
"deadline": "2025-12-01",
"monthly_deposit": 1666.67
}
- Endpoint:
/api/saving-goals/<goal_id>/
- Method:
DELETE
- Description: Delete a saving goal.
The front-end of the Personal Finance Web App is built with React. To set up the front-end development environment, follow these steps:
- Navigate to the
frontend
directory:
cd frontend
- Install the dependencies:
npm install
- Start the development server:
npm start
- Access the front-end at
http://localhost:3000
.
To deploy the Personal Finance Web App, follow these steps:
-
Set up the production database and update the database settings in the
personal_finance/settings.py
file with the production database credentials. -
Collect the static files:
python manage.py collectstatic
-
Set up a web server (e.g., Nginx) to serve the Django application and static files.
-
Build the front-end for production:
cd frontend
npm run build
-
Serve the built front-end files using the web server.
-
Access the deployed application using the appropriate URL.
The Personal Finance Web App is a powerful tool for managing saving goals and calculating monthly deposits. By following the installation instructions and utilizing the provided API endpoints, you can easily set up and deploy the application. For any further assistance, please refer to the documentation or contact the development team.
Enjoy tracking your saving goals with the Personal Finance Web App!