A comprehensive, secure, and user-friendly multi-tenant SaaS platform designed specifically for Iranian gold and jewelry businesses.
- Multi-tenant Architecture: Complete data isolation using django-tenants
- Persian-native Interface: RTL layout with Shamsi calendar support
- Dual Theme System: Modern light mode and cybersecurity-themed dark mode
- Gold Installment System: Weight-based payment calculations
- Persian Accounting: Complete accounting system with Iranian standards
- Point of Sale: Touch-optimized POS system for jewelry shops
- Advanced Security: 2FA, encryption, and comprehensive audit logging
- Backend: Django 4.2 + Django REST Framework
- Database: PostgreSQL with django-tenants
- Cache: Redis
- Background Tasks: Celery
- Web Server: Nginx
- Containerization: Docker & Docker Compose
- Docker and Docker Compose installed
- Git
- Clone the repository:
git clone <repository-url>
cd zargar-jewelry-saas
- Copy environment variables:
cp .env.example .env
- Build and start services:
docker-compose up --build
- Run migrations:
docker-compose exec web python manage.py migrate
- Create superuser:
docker-compose exec web python manage.py createsuperuser
- Access the application:
- Web interface: http://localhost:8000
- Admin panel: http://localhost:8000/admin
# Run all tests
docker-compose -f docker-compose.test.yml run --rm web pytest
# Run specific test categories
docker-compose -f docker-compose.test.yml run --rm web pytest tests/test_docker_health.py
# Run with coverage
docker-compose -f docker-compose.test.yml run --rm web pytest --cov=zargar --cov-report=html
# Create migrations
docker-compose exec web python manage.py makemigrations
# Apply migrations
docker-compose exec web python manage.py migrate
# Django shell
docker-compose exec web python manage.py shell
# Database shell
docker-compose exec db psql -U zargar -d zargar_dev
# View Celery workers
docker-compose logs celery
# Monitor Celery tasks
docker-compose exec celery celery -A zargar inspect active
zargar-jewelry-saas/
├── zargar/ # Main Django project
│ ├── settings/ # Environment-specific settings
│ ├── core/ # Shared functionality
│ ├── tenants/ # Multi-tenancy models
│ ├── api/ # DRF API endpoints
│ ├── jewelry/ # Jewelry inventory management
│ ├── accounting/ # Persian accounting system
│ ├── customers/ # Customer management
│ ├── pos/ # Point of sale system
│ └── reports/ # Reporting and analytics
├── tests/ # Test suite
├── templates/ # Django templates
├── static/ # Static files
├── docker-compose.yml # Development environment
├── docker-compose.test.yml # Testing environment
└── requirements.txt # Python dependencies
Key environment variables (see .env.example
for complete list):
DATABASE_URL
: PostgreSQL connection stringREDIS_URL
: Redis connection stringCLOUDFLARE_R2_*
: Cloudflare R2 storage credentialsBACKBLAZE_B2_*
: Backblaze B2 storage credentials
The system uses django-tenants for complete data isolation:
- Each jewelry shop gets its own subdomain
- Separate database schemas for each tenant
- Shared authentication and admin functionality
The system supports dual cloud storage:
- Cloudflare R2: Primary storage backend
- Backblaze B2: Backup storage backend
- AES-256 encryption for data at rest
- TLS 1.3 for data in transit
- TOTP-based 2FA
- Comprehensive audit logging
- Rate limiting and suspicious activity detection
- Complete RTL interface
- Shamsi calendar integration
- Persian number formatting
- Iranian accounting terminology
- Persian fonts and typography
- Follow Docker-first development approach
- All commands must run in Docker containers
- Maintain 90%+ test coverage
- Follow Persian localization standards
[License information]
For support and documentation, please refer to the project wiki or contact the development team.