The Expense Tracker Service is a comprehensive system designed to help users manage their personal finances effectively. It enables users to track their income, expenses, and savings, providing insights into their spending habits and assisting them in achieving their financial goals.
- User Authentication: Secure login and registration system to safeguard user data.
- Expense Management: Add, edit, and delete expenses with categories such as food, transportation, entertainment, etc.
- Income Tracking: Record and categorize income sources.
- Budgeting: Set monthly budgets and monitor progress.
- Goal Management: Define and track personalized financial goals, such as saving for a vacation, paying off debt, or building an emergency fund.
expense-tracker/
|── apps/ # Sub-applications for modular design
│ ├── expenses_system/ # Expense tracking functionality
│ ├── user_profile/ # User profile management
│ ├── user_budget/ # Budgeting functionality
│ └── user_auth/ # User authentication and authorization
|
├── expenseTracker/ # Main Django application directory
│ ├── __init__.py # Package initialization
│ ├── settings.py # Django settings
│ ├── urls.py # URL routing
│ ├── wsgi.py # WSGI application
│ └── asgi.py # ASGI application
|
├── manage.py # Django management script
├── requirements.txt # Python dependencies
├── .env # Environment variables
├── .pg_service.conf # Database Configuration
├── .gitignore # Git ignore file
└── README.md # Project documentation
The system is built using a modular architecture to ensure scalability and maintainability.
- Framework: Django with Django REST Framework for building RESTful APIs.
- Database: PostgreSQL for storing user data, expenses, and budgets.
- Authentication: JSON Web Tokens (JWT) for secure user authentication.
- Clone the repository:
git clone https://github.com/your-username/Expense-Tracker-Service.git
- Navigate to the project directory:
cd expense-tracker - Create a python virtual environment:
- Windows:
python -m venv venv - Linux:
python3 -m venv venv
- Windows:
- Activate the python virtual environment:
- Windows:
.\venv\Scripts\activate
- Linux:
venv/bin/activate
- Windows:
- Install dependencies:
- Windows:
pip install -r requirements.txt - Linux:
pip3 install -r requirements.txt
- Windows:
- Set up environment variables in a
.envfile:DJANGO_SECRET_KEY=<secret key for Django> - Configure Database Connectivity:
- Create a
.pg_service.conffile to store the database configuration:[my_service] host=<hosting> # Default: localhost port=<database connection port number> # Default: 5432 user=<database username> # Default: postgres dbname=<database name> # Create a database and specify its name password=<database password> - Test the database connection:
import os import django from django.db import connections from django.db.utils import OperationalError # Set the DJANGO_SETTINGS_MODULE to your project's settings module os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'expenseTracker.settings') # Replace 'expenseTracker' with your project's name # Initialize Django django.setup() # Test the database connection try: connection = connections['default'] connection.connect() print("Database connection successful!") except OperationalError as e: print(f"Database connection failed: {e}") except Exception as e: print(f"An unexpected error occurred: {e}")
- Create a
- Start the development server:
- Windows:
python manage.py runserver
- Linux:
python3 manage.py runserver
- Windows:
For detailed API specifications and usage examples, refer to the Postman documentation:
This documentation provides a comprehensive guide to all available endpoints, request/response formats, and authentication requirements.
- Register a new account or log in with existing credentials.
- Add your income and expenses with appropriate categories.
- Set a monthly budget to monitor your spending.
- View detailed reports and insights on the dashboard.