A lightweight, secure web-based Inventory Management System with barcode/RFID scanning capabilities, featuring a minimalistic Apple-inspired interface.
- Product Management: Add, edit, delete, and search products with bilingual support (English/Bulgarian)
- Barcode/RFID Scanning: Quick lookup and stock operations via USB scanners
- Authentication & Security:
- Secure user authentication with bcrypt password hashing
- Two-Factor Authentication (2FA) with Google Authenticator
- Role-based access control (Admin, Manager, Staff)
- Rate limiting and CSRF protection
- Internationalization: Full bilingual support (English/Bulgarian)
- Dashboard: Real-time inventory stats, low stock alerts, recent activities
- Stock Management: Track stock movements with full audit trail
- Mobile-Responsive: Works seamlessly on phones, tablets, and desktops
- Backend: Python 3.11+ with Flask
- Database: SQLite (development/production)
- Frontend: Tailwind CSS, Vanilla JavaScript
- Authentication: Flask-Security-Too with 2FA
- i18n: Flask-Babel
- DOCKER.md - Docker deployment guide (recommended)
- QUICKSTART.md - Quick start guide for getting up and running
- DEPLOYMENT.md - Comprehensive deployment guide for AWS Lightsail
- TROUBLESHOOTING.md - Common issues and solutions
- CLAUDE.md - Project specification and development guidelines
This project is licensed under the MIT License - see the LICENSE file for details.
Georgi Isaev - georgi-i
The fastest way to get started:
# Clone the repository
git clone https://github.com/georgi-i/light-stock.git
cd light-stock
# Copy environment file and configure
cp .env.docker .env
nano .env # Update SECRET_KEY and other settings
# Start with Docker Compose
docker-compose up -d
# Initialize database
docker-compose exec lightstock python init_db.pyAccess at http://localhost:8000
π Full Docker Guide
Prerequisites:
- Python 3.11 or higher
- pip (Python package manager)
- Virtual environment (recommended)
Setup Steps:
-
Clone the repository
git clone https://github.com/georgi-i/light-stock.git cd light-stock -
Create and activate virtual environment
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
cp .env.example .env
Edit
.envand update the following:SECRET_KEY: Generate a secure random keySECURITY_PASSWORD_SALT: Generate a secure saltSECURITY_TOTP_SECRETS: Generate TOTP secret
To generate secure keys, run:
python -c "import secrets; print(secrets.token_hex(32))"
-
Initialize the database
python init_db.py
This will:
- Create database tables
- Set up default roles (Admin, Manager, Staff)
- Create an admin user (you'll be prompted for credentials)
- Create default product categories
-
Run the application
python run.py
Or using Flask CLI:
flask run
-
Access the application
Open your browser and navigate to:
http://localhost:8000
After initialization, log in with the admin credentials you created during the init_db.py step.
- Navigate to Products β Add Product
- Fill in product details (both English and Bulgarian names)
- Set SKU, barcode, quantity, and other fields
- Click Add Product
- Navigate to Scanner menu
- Choose operation:
- Quick Lookup: Find product by scanning
- Stock In: Add items to inventory
- Stock Out: Remove items from inventory
- Focus the input field and scan with your USB barcode scanner
- The scanner will automatically input the code
- Go to Profile
- Click Enable 2FA
- Scan the QR code with Google Authenticator or similar app
- Enter the 6-digit code to verify
- 2FA is now active for your account
- Navigate to the user menu β Users
- View all users, their roles, and 2FA status
- Users can self-register or be added by admins
light-stock/
βββ app/
β βββ __init__.py # Flask app factory
β βββ models.py # Database models
β βββ auth.py # Authentication routes
β βββ inventory.py # Inventory routes
β βββ scanner.py # Scanner routes
β βββ routes.py # Main routes
β βββ utils.py # Utility functions
β βββ templates/ # HTML templates
β βββ base.html
β βββ dashboard.html
β βββ auth/
β βββ inventory/
β βββ scanner/
βββ config.py # Configuration
βββ run.py # Application entry point
βββ init_db.py # Database initialization
βββ requirements.txt # Python dependencies
βββ .env.example # Environment variables template
βββ README.md # This file
- Password Security: Bcrypt hashing with minimum 12 characters
- Two-Factor Authentication: Optional TOTP-based 2FA
- CSRF Protection: All forms protected against CSRF
- Rate Limiting: Authentication endpoints rate-limited
- Session Security: Secure, HTTPOnly, SameSite cookies
- Audit Logging: All critical actions logged
- Input Validation: All user inputs sanitized
- SQL Injection Protection: Parameterized queries via SQLAlchemy ORM
export FLASK_ENV=development
flask run --debugflask db init
flask db migrate -m "Description of changes"
flask db upgrade-
Extract translatable strings:
pybabel extract -F babel.cfg -o messages.pot . -
Update translations:
pybabel update -i messages.pot -d translations
-
Compile translations:
pybabel compile -d translations
Deployment instructions will be provided in a separate deployment guide. The application is optimized for AWS Lightsail's $3.50-$5/month tier.
This is an open-source project. Contributions are welcome!
MIT License - See LICENSE file for details
For issues, questions, or contributions, please open an issue on the repository.
Built with β€οΈ for efficient inventory management