Spendora - Personal Expense Tracker
Full-stack Django personal expense tracking app with authentication, category management, filtering, dashboard statistics, and Chart.js visualizations.
Overview
Spendora is a full-stack personal expense tracking web application built with Django, Django Templates, and Tailwind CSS. It allows users to securely manage their personal expenses, organize them by category, filter records by date, and visualize spending patterns through a dashboard with monthly statistics and charts. The application also includes an optional REST API using Django REST Framework.
The Problem
Managing daily expenses manually can make it difficult to track spending patterns, identify high-expense categories, and understand monthly financial activity. Traditional spreadsheets and manual records can also become difficult to maintain as the number of transactions increases. Spendora addresses this by providing a centralized platform where users can record and manage expenses, organize them by categories, filter by category and date range, view total and monthly spending, and analyze spending through visual charts - all while keeping each user's data isolated and protected.
Approach
- Implemented user authentication (registration, login, logout) with LoginRequiredMixin to keep all expense functionality restricted to authenticated users.
- Designed normalized Category and Expense models with ForeignKey relationships, linking every expense to both a category and its owning user for strict data isolation.
- Built complete CRUD operations using class-based views, ensuring users can only add, edit, and delete their own expenses.
- Added category and date-range filtering with pagination to make browsing large expense lists fast and manageable.
- Developed a dashboard with total expenses, current-month spending, total entries, recent transactions, and monthly statistics using Django ORM aggregations (Sum, Count, TruncMonth).
- Integrated Chart.js to visualize monthly expenses using dynamically generated Django query data.
- Exposed an optional authenticated REST API using Django REST Framework with CRUD endpoints scoped to the logged-in user.
Technical Stack
| Layer | Technology |
|---|---|
| Backend | Python 3, Django 5 |
| Frontend | Django Templates, HTML, Tailwind CSS 3.4 |
| Database | SQLite |
| Forms & Auth | Django Forms, Django Authentication |
| Charts | Chart.js |
| API | Django REST Framework |
| Fonts | Manrope, Fraunces |
What I learned
- Implementing user authentication and authorization with Django's built-in auth system and user-scoped querysets for data isolation.
- Designing relational models with Django ORM, ForeignKey relationships, and constraints for per-user data ownership.
- Building full CRUD workflows using Django class-based views and protecting them with LoginRequiredMixin.
- Creating dashboard statistics using ORM aggregations (Sum, Count, TruncMonth) and integrating them into Chart.js visualizations.
- Building advanced filtering with category and date-range queries plus pagination for larger datasets.
- Exposing authenticated REST APIs with Django REST Framework scoped to the logged-in user.
- Customizing Django Admin with search, filters, and list displays for managing categories and expenses.