An expenses tracking application built in python/Django, Django Rest Framework and postgreSQL database. Supports user registration, authentication, logging and categorization of expenses and budget.
- User Profile
- Budget
- Expense (logging)
- Expense Categories
User (authentication)
UserProfile (monthly budget and user-specific settings)
ExpenseCategory (shared list of categories)
Expense (the actual spending records)
Budget (monthly budget amount and currency)
- Backend: Django, Django REST Framework
- Database: PostgreSQL
- Docs: Swagger / drf-yasg
- Testing: Pytest, pytest-django
- DevOps: Docker, Docker Compose
- Frontend: JavaScript, Css, HTML, Vite, React
git clone https://github.com/Nyaguthii-C/Soldi.git
cd Soldi
python -m venv venv
source venv/bin/activatepip install -r requirements.txtSECRET_KEY=valuehere
POSTGRES_DB=valuehere
POSTGRES_USER=valuehere
POSTGRES_PASSWORD=valuehere
DEBUG=TrueOrFalse
DATABASE_URL=valuehere
ALLOWED_HOSTS=valuehere
Set up PostgreSQL and update .env (see .env.example).
Create a PostgreSQL database and user (if not already created).
Open your terminal and log in to the PostgreSQL command line interface:
psql -U postgres(Replace postgres with your username if you use a different PostgreSQL username.)
To create a new database, run:
CREATE DATABASE your_db_name;Create a user (if it doesn’t exist) with a password:
CREATE USER your_db_user WITH PASSWORD 'your_db_password';Grant all privileges on the database to the user:
GRANT ALL PRIVILEGES ON DATABASE your_db_name TO your_db_user;\q
``` -->
### 6. Run Migrations
```bash
python manage.py makemigrations
python manage.py migratepython manage.py collectstaticgunicorn config.wsgi:applicationpytestAccess Swagger UI at:
http://localhost:8000/swagger/
- Installing Docker and Docker Compose
sudo apt update && sudo apt install docker.io docker-compose -y
sudo systemctl enable docker -->- Build and Run the Containers
sudo docker-compose up --build- Access App
API: http://localhost:8000
Swagger Docs: http://localhost:8000/swagger/- Common Docker Commands
docker-compose downdocker-compose logs -f webdocker-compose exec web bashViews
│
├── register()
├── get_profile()
├── update_profile()
├── log_expense()
│ │
│ └── create_expenses()
│ │
│ └── create_expense()
│
├── list_expenses()
├── update_expense()
├── delete_expense()
│
├── month_total()
│ │
│ └── get_month_total()
│
├── category_summary()
│ │
│ └── get_category_summary()
│
└── monthly_summary()
│
├── get_month_total()
└── get_category_summary()To run tests on the project:
python manage.py test soldi_app.tests