A mobile-friendly Django application for managing bar beverage inventory across multiple locations. The application uses HTMX for smooth SPA-like interactions and Bootstrap for responsive design.
- Multi-location support: Manage inventory across multiple bar locations
- Unit conversion: Track beverages in barrels, trays, or bottles with automatic liter conversion
- Mobile-optimized: Responsive design optimized for smartphone use
- Real-time updates: HTMX-powered interface for smooth, page-refresh-free updates
- Quick adjustments: Fast increment/decrement buttons for rapid stock counting
- Admin panel: Full Django admin for managing beverages, locations, and unit types
- Django 5.0+
- Bootstrap 5.3
- HTMX 1.9
- SQLite (development) / MySQL 8.0 (production)
- Docker & Docker Compose
# Start the application with SQLite
docker-compose up -d
# Run migrations
docker-compose exec web python manage.py migrate
# Create a superuser
docker-compose exec web python manage.py createsuperuserVisit http://localhost:8332 to access the application.
# Edit docker-compose.yml and change DJANGO_ENV to prod:
# environment:
# - DJANGO_ENV=prod
# Start services (includes MySQL)
docker-compose up -d
# Wait for MySQL to be ready, then run migrations
docker-compose exec web python manage.py migrate
# Create a superuser
docker-compose exec web python manage.py createsuperuserpython3 -m venv venv
source venv/bin/activate # On macOS/Linux
# or
venv\Scripts\activate # On Windowspip install -r requirements.txtcd code
python manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython manage.py runserverVisit http://localhost:8000 to access the application.
Go to http://localhost:8000/admin and log in with your superuser credentials.
Add unit types with their liter conversions:
- Barrel: e.g., 50 liters
- Tray: e.g., 12 liters (for a tray of bottles)
- Bottle: e.g., 0.5 liters
Create your bar locations:
- Main Bar
- Pool Area
- VIP Section
- etc.
Create beverages with:
- Name (e.g., "Heineken")
- Unit type (Barrel/Tray/Bottle)
- Available locations (select which locations stock this beverage)
- Select Location: Choose the location where you're counting stock
- View Inventory: See all beverages available at that location with current stock
- Update Stock:
- Use + and - buttons for quick adjustments
- Tap the pencil icon to enter exact quantities
- View Totals: See stock in both units and liters automatically
Use the admin panel to:
- Add/edit/delete beverages, locations, and unit types
- View stock reports
- Manage which beverages are available at which locations
- Name and description
- Active status
- Unit name (Barrel/Tray/Bottle)
- Liters per unit
- Name and description
- Unit type
- Available locations (many-to-many)
- Beverage and location
- Quantity (in units)
- Automatically calculates liters
- Tracks last update time
The application uses the following environment variables:
- DJANGO_ENV: Set to
prodfor production (MySQL) ordevfor development (SQLite). Default:dev - DB_HOST: MySQL host. Default:
db - DB_NAME: MySQL database name. Default:
bar_inventory - DB_USER: MySQL username. Default:
bar_user - DB_PASSWORD: MySQL password. Default:
bar_password - DB_PORT: MySQL port. Default:
3306
The application automatically selects the database based on DJANGO_ENV:
- Development (
DJANGO_ENV=dev): Uses SQLite (file-based, no setup required) - Production (
DJANGO_ENV=prod): Uses MySQL (requires MySQL service)
To switch between databases, simply change the DJANGO_ENV variable in docker-compose.yml.
For production deployment:
- Set
DJANGO_ENV=prodin docker-compose.yml - Set
DEBUG = Falsein settings.py - Configure
ALLOWED_HOSTSwith your domain - Generate a secure
SECRET_KEY - Change default MySQL passwords in docker-compose.yml
- Configure static file serving
- Use a production WSGI server (gunicorn, uWSGI)
- Set up HTTPS with reverse proxy (nginx/Apache)
- Set up regular database backupsucture
bar_inventory/
├── bar_inventory/ # Project settings
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── inventory/ # Main app
│ ├── models.py # Database models
│ ├── views.py # View logic
│ ├── urls.py # URL routing
│ └── admin.py # Admin configuration
├── templates/
│ ├── base.html # Base template
│ └── inventory/ # App templates
├── manage.py
└── requirements.txt
- Modify unit types in the admin panel
- Adjust liter conversion factors per unit type
- Customize styling in base.html
- Add additional fields to models as needed
For production deployment:
- Set
DEBUG = Falsein settings.py - Configure
ALLOWED_HOSTS - Generate a secure
SECRET_KEY - Set up a production database (PostgreSQL recommended)
- Configure static file serving
- Use a production WSGI server (gunicorn, uWSGI)
- Set up HTTPS
This project is provided as-is for bar inventory management purposes.
For issues or questions, refer to the Django documentation at https://docs.djangoproject.com/