Clarity is a modern, AI-powered financial management application designed to help users track expenses and income effortlessly. It provides a clean and intuitive interface for managing personal finances, with secure authentication, real-time transaction tracking, and intelligent expense categorization.
- Framework: React 19 with TypeScript
- Build Tool: Vite 7
- Styling: TailwindCSS 4
- Routing: React Router DOM
- HTTP Client: Axios
- Deployment: Nginx (Docker)
- Framework: Django REST Framework (DRF)
- Authentication: JWT (djangorestframework-simplejwt)
- Database: PostgreSQL 15
- WSGI Server: Gunicorn
- CORS: django-cors-headers
- Filtering: django-filter
- Containerization: Docker & Docker Compose
- Database: PostgreSQL 15 Alpine
- Web Server: Nginx
- Environment Management: python-dotenv
- π Secure Authentication: User registration and login using JWT tokens
- π Dashboard: Real-time overview of total balance, income, and expenses
- πΈ Transaction Management: Add, view, and manage income/expense transactions
- π·οΈ Smart Categorization: Organize transactions by customizable categories
- π€ AI-Powered Suggestions: Intelligent expense categorization (optional)
- π± Responsive Design: Beautiful UI built with TailwindCSS for all devices
- π³ Docker Ready: Fully containerized for easy deployment
- π Real-time Updates: Instant balance and transaction updates
The easiest way to run Clarity is using Docker Compose, which sets up the entire stack (PostgreSQL, Django backend, React frontend) with a single command.
- Docker
- Docker Compose
-
Clone the repository:
git clone <repository-url> cd Clarity
-
Configure environment variables (optional):
Edit
docker-compose.ymlto customize:- Database credentials
- Django secret key
- CORS allowed origins
-
Build and run the containers:
docker-compose up --build
-
Access the application:
- Frontend:
http://localhost - Backend API:
http://localhost/api/
- Frontend:
-
Create a superuser (optional):
docker-compose exec backend python manage.py createsuperuser -
Stop the application:
docker-compose down
- Python 3.8+
- Node.js 16+
- PostgreSQL (or use SQLite for development)
-
Navigate to the backend directory:
cd backend -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
Create a
.envfile in thebackenddirectory:DEBUG=1 SECRET_KEY=your-secret-key-here DATABASE=postgres DB_ENGINE=django.db.backends.postgresql DB_NAME=clarity_db DB_USER=postgres DB_PASSWORD=password DB_HOST=localhost DB_PORT=5432 CORS_ALLOWED_ORIGINS=http://localhost:5173
-
Run database migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Start the development server:
python manage.py runserver
The backend will run at
http://127.0.0.1:8000/
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Configure API endpoint (if needed):
Update the API base URL in
src/api/api.tsif your backend runs on a different port. -
Start the development server:
npm run dev
The frontend will run at
http://localhost:5173/
An API collection is available for testing. Import backend/clarity_api_collection.json into Postman or Insomnia to explore all available endpoints.
POST /api/auth/register/- Register a new userPOST /api/auth/login/- Login and obtain JWT tokensPOST /api/auth/token/refresh/- Refresh access token
GET /api/transactions/- List all user transactionsPOST /api/transactions/- Create a new transactionGET /api/transactions/{id}/- Retrieve a specific transactionPUT /api/transactions/{id}/- Update a transactionDELETE /api/transactions/{id}/- Delete a transaction
GET /api/categories/- List all categoriesPOST /api/categories/- Create a new category
GET /api/dashboard/summary/- Get financial summary (balance, income, expenses)
Clarity/
βββ backend/ # Django backend
β βββ core/ # Project settings
β βββ transactions/ # Transaction app
β βββ users/ # User authentication app
β βββ Dockerfile # Backend Docker configuration
β βββ entrypoint.sh # Docker entrypoint script
β βββ requirements.txt # Python dependencies
βββ frontend/ # React frontend
β βββ src/
β β βββ api/ # API client configuration
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ App.tsx # Main app component
β βββ nginx/ # Nginx configuration
β βββ Dockerfile # Frontend Docker configuration
β βββ package.json # Node dependencies
βββ docker-compose.yml # Docker Compose configuration
βββ README.md # This file
-
Update environment variables in
docker-compose.yml:- Set
DEBUG=0 - Use a strong
SECRET_KEY - Update database credentials
- Configure
CORS_ALLOWED_ORIGINSwith your domain
- Set
-
Build and deploy:
docker-compose up -d --build
-
Collect static files:
docker-compose exec backend python manage.py collectstatic --noinput -
Run migrations:
docker-compose exec backend python manage.py migrate
| Variable | Description | Default |
|---|---|---|
DEBUG |
Django debug mode | 0 |
SECRET_KEY |
Django secret key | changeme_in_prod |
DATABASE |
Database type | postgres |
DB_NAME |
Database name | clarity_db |
DB_USER |
Database user | postgres |
DB_PASSWORD |
Database password | password |
DB_HOST |
Database host | db |
DB_PORT |
Database port | 5432 |
CORS_ALLOWED_ORIGINS |
Allowed CORS origins | http://localhost |
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Built with Django REST Framework and React
- Styled with TailwindCSS
- Containerized with Docker