Getting Started
Database Setup & Migrations
Managing PostgreSQL schemas, Django migrations, data seeding, and test fixtures.
Database Setup & Migrations
IMPLEMENTED
Sheba ISP ERP utilizes a single-schema, multi-tenant architecture on PostgreSQL 16 (or SQLite for lightweight local offline work).
1. PostgreSQL Database Initialization
If running PostgreSQL locally or via Docker Compose:
docker compose -f backend/docker-compose.yml up -d postgres redisThis spawns:
- PostgreSQL 16 on
localhost:5432(user: sheba_user,pass: sheba_secure_password,db: sheba_erp) - Redis 7 on
localhost:6379
Configure DATABASE_URL in backend/.env:
DATABASE_URL=postgres://sheba_user:sheba_secure_password@localhost:5432/sheba_erp2. Applying Migrations
Execute all app migrations in dependency order:
cd backend
source venv/bin/activate
python manage.py migrateTo inspect migration status:
python manage.py showmigrations3. Seeding Realistic ISP Operations Data
Run the authoritative seed script:
python seed_data.pyThe seed script creates:
- Tenants:
shebafi: Primary ISP tenant (domain:shebafi.net,localhost)speednet: Secondary tenant for multi-tenancy verification
- Staff Accounts:
- Username:
admin(Password:admin123, Superuser, full permissions) - Username:
billing_staff(Password:billing123, role: Billing Staff) - Username:
technician(Password:tech123, role: Field Tech)
- Username:
- Network Hardware:
- 2 MikroTik Core Routers (
MikroTik Core-1,MikroTik Core-2) - 1 OLT Chassis (
VSOL V1600D EPON 4-Port) - 8 Optical ONUs with live signal telemetry
- 2 MikroTik Core Routers (
- Broadband Packages:
Home Bronze (10 Mbps)— 500 BDTHome Silver (20 Mbps)— 800 BDTHome Gold (50 Mbps)— 1500 BDT
- Customers & Subscriptions:
- 50+ realistic ISP customers with PPPoE accounts, IP bindings, and billing balances.