A backend expense tracking application built with Django REST Framework and PostgreSQL.
This project supports multi-user authentication, expense management, analytics, and is designed to later support fuzzy search and natural language expense input.
- Python 3.12
- Django
- Django REST Framework
- PostgreSQL
- psycopg2
- python-dotenv
- User signup (username + email + password)
- Login & logout (session-based authentication)
- Per-user expense isolation
- CRUD operations for expenses
- Category management
- Filtering by:
- Category
- Date range
- Search query
- Category-wise analytics (total + count)
- PostgreSQL-backed database
- Environment-based configuration (.env)
git clone https://github.com/RedK22/expense-tracker
cd expense-trackerpython -m venv venv
source venv/bin/activatepip install -r requirements.txtsudo apt update
sudo apt install postgresql postgresql-contrib
sudo service postgresql startsudo -u postgres psqlInside psql:
CREATE DATABASE expense_tracker;
CREATE USER expense_user WITH PASSWORD '<your_password>';
\c expense_tracker
ALTER SCHEMA public OWNER TO expense_user;
GRANT ALL ON SCHEMA public TO expense_user;
\qDB_NAME=expense_tracker
DB_USER=expense_user
DB_PASSWORD=<your_password>
DB_HOST=localhost
DB_PORT=5432python manage.py migratepython manage.py createsuperuserpython manage.py runserverVisit: Admin: http://127.0.0.1:8000/admin/ API root: http://127.0.0.1:8000/api/
Authentication:
-
POST /api/auth/signup/
-
POST /api/auth/login/
-
POST /api/auth/logout/
Expenses:
-
GET /api/expenses/
-
POST /api/expenses/
-
GET /api/expenses//
-
PUT /api/expenses//
-
DELETE /api/expenses//
Categories:
-
GET /api/categories/
-
POST /api/categories/
Analytics:
- GET /api/analytics/category-summary/
- Frontend with Next.js/React.js
- PostgreSQL trigram-based fuzzy search
- Natural language expense parsing
- AI-assisted expense retrieval
- Pagination
- Docker support