Modern web application for tracking beverage consumption and managing debts in households or shared spaces. Built with Django REST Framework backend and React frontend, orchestrated with Docker Compose.
- π Consumption Tracking - Track beers, coffees, and other beverages
- π₯ Person Management - Home members and guests
- π° Automatic Debt Calculation - Per-item or per-gram pricing
- π± Responsive Design - Optimized for mobile and desktop
- π Multi-select Mode - Add transactions for multiple people at once
- π¨ Modern UI - Bootstrap 5 with custom CSS enhancements
- π Admin Panel - Manage items, persons, and transactions
- Django 5.1.4
- Django REST Framework
- PostgreSQL 16
- Python 3.12
- React 18
- Vite
- React Router
- Bootstrap 5
- React Icons
- Docker & Docker Compose
- Multi-stage builds
- Hot reload in dev mode
- Docker
- Docker Compose
- Git
- Clone the repository
git clone https://github.com/BeloIV/drink-counter.git
cd drink-counter- Start the application
docker compose up --build- Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- Admin panel: http://localhost:8000/admin
- Create a superuser (for admin panel)
docker compose exec backend python manage.py createsuperuserdrink-counter/
βββ backend/ # Django REST API
β βββ backend/ # Project settings
β βββ core/ # Main app (models, views, serializers)
β βββ manage.py
β βββ requirements.txt
βββ frontend/ # React application
β βββ src/
β β βββ pages/ # Pages (admin)
β β βββ assets/ # Images, avatars
β β βββ App.jsx # Main component
β β βββ api.js # API client
β βββ public/
β βββ package.json
βββ docker-compose.yaml # Service orchestration
βββ README.md
- Select a person from home members or guests
- Choose category (Beer/Coffee)
- Select specific beverage
- For coffee, enter gram amount
- Debt is automatically added
- Activate "Multiple people" button
- Select multiple persons
- Click "Continue"
- Choose category and beverage
- For coffee, grams are evenly distributed
- Add/edit items
- Manage persons
- View all transactions
- Close/open sessions
- Pay-by-square QR codes
# Access backend container
docker compose exec backend bash
# Create migrations
python manage.py makemigrations
# Apply migrations
python manage.py migrate
# Run tests
python manage.py test# Access frontend container
docker compose exec frontend sh
# Install new dependencies
npm install <package>Both containers have hot reload configured - changes are reflected automatically.
GET /api/persons/- List personsPOST /api/persons/- Create personGET /api/items/- List itemsPOST /api/transactions/- Add transactionGET /api/session/active/- Active session with summaryPOST /api/session/close/- Close session
POSTGRES_DB=drinkdb
POSTGRES_USER=drinkuser
POSTGRES_PASSWORD=drinkpass
POSTGRES_HOST=db
POSTGRES_PORT=5432export const API_BASE = 'http://localhost:8000/api'- Person - Home members and guests
- Category - Beverage categories (Beer, Coffee)
- Item - Specific beverages (price, pricing mode)
- Session - Tracking periods
- Transaction - Individual consumption records
- Person avatars with overlay effect
- Fixed button when scrolling
- Visual checkmarks for multi-person selection
- Progress stepper
- Notice notifications
- Responsive grid layout
Port already in use:
# Change port in docker-compose.yaml
ports:
- "5174:5173" # frontend
- "8001:8000" # backendDatabase won't start:
docker compose down -v # Delete volumes
docker compose up --buildChanges not reflected:
docker compose up --build --force-recreateMIT
Created by: BeloIV
β If you like this project, give it a star on GitHub!