refactor: rename Wizamart to Orion across entire codebase
Replace all ~1,086 occurrences of Wizamart/wizamart/WIZAMART/WizaMart with Orion/orion/ORION across 184 files. This includes database identifiers, email addresses, domain references, R2 bucket names, DNS prefixes, encryption salt, Celery app name, config defaults, Docker configs, CI configs, documentation, seed data, and templates. Renames homepage-wizamart.html template to homepage-orion.html. Fixes duplicate file_pattern key in api.yaml architecture rule. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
# Database Initialization Guide
|
||||
|
||||
**Wizamart Platform - Database Management Documentation**
|
||||
**Orion Platform - Database Management Documentation**
|
||||
|
||||
This guide covers the database initialization, seeding, and management workflows for the Wizamart multi-tenant e-commerce platform.
|
||||
This guide covers the database initialization, seeding, and management workflows for the Orion multi-tenant e-commerce platform.
|
||||
|
||||
---
|
||||
|
||||
@@ -23,7 +23,7 @@ This guide covers the database initialization, seeding, and management workflows
|
||||
|
||||
### Database Initialization Philosophy
|
||||
|
||||
The Wizamart platform uses a **two-tier initialization system**:
|
||||
The Orion platform uses a **two-tier initialization system**:
|
||||
|
||||
1. **Production Initialization** (`init_production.py`)
|
||||
- Creates essential platform infrastructure
|
||||
@@ -112,7 +112,7 @@ ENVIRONMENT=development # development | staging | production
|
||||
# =============================================================================
|
||||
# ADMIN INITIALIZATION
|
||||
# =============================================================================
|
||||
ADMIN_EMAIL=admin@wizamart.com
|
||||
ADMIN_EMAIL=admin@orion.lu
|
||||
ADMIN_USERNAME=admin
|
||||
ADMIN_PASSWORD=admin123 # ⚠️ CHANGE IN PRODUCTION!
|
||||
ADMIN_FIRST_NAME=Platform
|
||||
@@ -185,7 +185,7 @@ if warnings:
|
||||
# 1. Configure environment
|
||||
cat > .env << EOF
|
||||
ENVIRONMENT=production
|
||||
DATABASE_URL=postgresql://user:pass@localhost/wizamart
|
||||
DATABASE_URL=postgresql://user:pass@localhost/orion
|
||||
ADMIN_EMAIL=admin@yourmerchant.com
|
||||
ADMIN_USERNAME=admin
|
||||
ADMIN_PASSWORD=SecurePassword123!
|
||||
@@ -373,10 +373,10 @@ Edit `scripts/seed/init_production.py` to add new platform settings:
|
||||
```python
|
||||
def create_admin_settings(db: Session) -> int:
|
||||
"""Create essential admin settings."""
|
||||
|
||||
|
||||
default_settings = [
|
||||
# ... existing settings ...
|
||||
|
||||
|
||||
# Add your new setting
|
||||
{
|
||||
"key": "your_new_setting",
|
||||
@@ -396,13 +396,13 @@ Edit `scripts/seed/seed_demo.py` to extend demo data creation:
|
||||
```python
|
||||
def seed_demo_data(db: Session, auth_manager: AuthManager):
|
||||
"""Seed demo data for development."""
|
||||
|
||||
|
||||
# ... existing steps ...
|
||||
|
||||
|
||||
# Add your new demo data
|
||||
print_step(7, "Creating your demo data...")
|
||||
create_your_demo_data(db, stores)
|
||||
|
||||
|
||||
# ... commit
|
||||
```
|
||||
|
||||
@@ -411,7 +411,7 @@ Create a new function for your data:
|
||||
```python
|
||||
def create_your_demo_data(db: Session, stores: List[Store]) -> List[YourModel]:
|
||||
"""Create demo data for your feature."""
|
||||
|
||||
|
||||
items = []
|
||||
for store in stores:
|
||||
# Create demo items for this store
|
||||
@@ -421,7 +421,7 @@ def create_your_demo_data(db: Session, stores: List[Store]) -> List[YourModel]:
|
||||
)
|
||||
db.add(item)
|
||||
items.append(item)
|
||||
|
||||
|
||||
db.flush()
|
||||
print_success(f"Created {len(items)} demo items")
|
||||
return items
|
||||
@@ -436,12 +436,12 @@ Edit `app/core/config.py`:
|
||||
```python
|
||||
class Settings(BaseSettings):
|
||||
# ... existing settings ...
|
||||
|
||||
|
||||
# Your new settings
|
||||
your_new_setting: str = "default_value"
|
||||
your_numeric_setting: int = 42
|
||||
your_boolean_setting: bool = True
|
||||
|
||||
|
||||
# Optional with validation
|
||||
your_list_setting: List[str] = ["item1", "item2"]
|
||||
```
|
||||
@@ -473,7 +473,7 @@ Edit the `DEMO_STORES` list in `scripts/seed/seed_demo.py`:
|
||||
```python
|
||||
DEMO_STORES = [
|
||||
# ... existing stores ...
|
||||
|
||||
|
||||
# Your new demo store
|
||||
{
|
||||
"store_code": "YOURSHOP",
|
||||
@@ -680,7 +680,7 @@ make migrate-status
|
||||
**Solution**: No action needed. This message confirms the admin user exists.
|
||||
|
||||
```
|
||||
⚠ Admin user already exists: admin@wizamart.com
|
||||
⚠ Admin user already exists: admin@orion.lu
|
||||
✓ All changes committed
|
||||
```
|
||||
|
||||
@@ -688,7 +688,7 @@ make migrate-status
|
||||
|
||||
**Cause**: Correct behavior - safety feature working
|
||||
|
||||
**Solution**:
|
||||
**Solution**:
|
||||
- If you're in development: Set `ENVIRONMENT=development` in `.env`
|
||||
- If you're in production: Don't seed demo data! Create stores via admin panel
|
||||
|
||||
@@ -712,7 +712,7 @@ pip list | grep pydantic
|
||||
|
||||
**Cause**: Running seed scripts multiple times without checking existence
|
||||
|
||||
**Solution**:
|
||||
**Solution**:
|
||||
- Use `make seed-demo-reset` for fresh data
|
||||
- Check scripts for proper idempotent checks
|
||||
- Verify database state before seeding
|
||||
@@ -778,7 +778,7 @@ python -c "from app.core.config import settings; print(f'Env: {settings.environm
|
||||
URL: http://localhost:8000/admin/login
|
||||
Username: admin
|
||||
Password: admin123 (⚠️ CHANGE IN PRODUCTION!)
|
||||
Email: admin@wizamart.com
|
||||
Email: admin@orion.lu
|
||||
```
|
||||
|
||||
#### Demo Stores (After `make seed-demo`)
|
||||
@@ -793,7 +793,7 @@ Store 3: store3@example.com / password123
|
||||
### File Locations
|
||||
|
||||
```
|
||||
wizamart/
|
||||
orion/
|
||||
├── .env # Environment configuration
|
||||
├── Makefile # Command definitions
|
||||
├── app/
|
||||
@@ -845,8 +845,8 @@ Complete list of database-related environment variables:
|
||||
| Variable | Type | Default | Description |
|
||||
|----------|------|---------|-------------|
|
||||
| `ENVIRONMENT` | string | `development` | Environment mode (development/staging/production) |
|
||||
| `DATABASE_URL` | string | `sqlite:///./wizamart.db` | Database connection string |
|
||||
| `ADMIN_EMAIL` | string | `admin@wizamart.com` | Platform admin email |
|
||||
| `DATABASE_URL` | string | `sqlite:///./orion.db` | Database connection string |
|
||||
| `ADMIN_EMAIL` | string | `admin@orion.lu` | Platform admin email |
|
||||
| `ADMIN_USERNAME` | string | `admin` | Platform admin username |
|
||||
| `ADMIN_PASSWORD` | string | `admin123` | Platform admin password |
|
||||
| `ADMIN_FIRST_NAME` | string | `Platform` | Admin first name |
|
||||
@@ -1000,6 +1000,6 @@ For questions or issues:
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: 2025
|
||||
**Maintained By**: Wizamart Platform Team
|
||||
**Version**: 2.0
|
||||
**Last Updated**: 2025
|
||||
**Maintained By**: Orion Platform Team
|
||||
**Version**: 2.0
|
||||
|
||||
@@ -68,10 +68,10 @@ make db-reset # rollback + migrate + reset
|
||||
### Required Settings
|
||||
```bash
|
||||
ENVIRONMENT=development # development/staging/production
|
||||
DATABASE_URL=sqlite:///./wizamart.db
|
||||
DATABASE_URL=sqlite:///./orion.db
|
||||
|
||||
# Admin credentials (CHANGE IN PRODUCTION!)
|
||||
ADMIN_EMAIL=admin@wizamart.com
|
||||
ADMIN_EMAIL=admin@orion.lu
|
||||
ADMIN_USERNAME=admin
|
||||
ADMIN_PASSWORD=admin123
|
||||
```
|
||||
@@ -121,35 +121,35 @@ Store 3: store3@example.com / password123
|
||||
## 📊 What Each Command Creates
|
||||
|
||||
### `make init-prod`
|
||||
✅ Platform admin user
|
||||
✅ Admin settings
|
||||
✅ Role templates
|
||||
✅ RBAC schema verification
|
||||
✅ Platform admin user
|
||||
✅ Admin settings
|
||||
✅ Role templates
|
||||
✅ RBAC schema verification
|
||||
|
||||
**Safe for production**: YES
|
||||
**Contains fake data**: NO
|
||||
**Safe for production**: YES
|
||||
**Contains fake data**: NO
|
||||
|
||||
### `make seed-demo`
|
||||
✅ 3 demo stores
|
||||
✅ Demo store users
|
||||
✅ ~45 customers (15 per store)
|
||||
✅ ~60 products (20 per store)
|
||||
✅ Store themes
|
||||
✅ Custom domains
|
||||
✅ 3 demo stores
|
||||
✅ Demo store users
|
||||
✅ ~45 customers (15 per store)
|
||||
✅ ~60 products (20 per store)
|
||||
✅ Store themes
|
||||
✅ Custom domains
|
||||
|
||||
**Safe for production**: NO
|
||||
**Contains fake data**: YES - ALL OF IT
|
||||
**Safe for production**: NO
|
||||
**Contains fake data**: YES - ALL OF IT
|
||||
|
||||
### `make seed-demo-minimal`
|
||||
✅ 1 demo store
|
||||
✅ 1 demo store user
|
||||
✅ ~15 customers
|
||||
✅ ~20 products
|
||||
✅ Store theme
|
||||
✅ Custom domain
|
||||
✅ 1 demo store
|
||||
✅ 1 demo store user
|
||||
✅ ~15 customers
|
||||
✅ ~20 products
|
||||
✅ Store theme
|
||||
✅ Custom domain
|
||||
|
||||
**Safe for production**: NO
|
||||
**Contains fake data**: YES
|
||||
**Safe for production**: NO
|
||||
**Contains fake data**: YES
|
||||
|
||||
---
|
||||
|
||||
@@ -244,4 +244,4 @@ make help-db # Database-specific help
|
||||
**Documentation**:
|
||||
- `database-init-guide.md` - Detailed guide
|
||||
- `MIGRATION_GUIDE.md` - Migration from old system
|
||||
- `README.md` - Project overview
|
||||
- `README.md` - Project overview
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
## Overview
|
||||
|
||||
I've created a comprehensive database seeder for your Wizamart platform that significantly expands coverage beyond your original implementation. The new seeder creates realistic test data across all your database models.
|
||||
I've created a comprehensive database seeder for your Orion platform that significantly expands coverage beyond your original implementation. The new seeder creates realistic test data across all your database models.
|
||||
|
||||
## What's New
|
||||
|
||||
### Original Seeder Coverage
|
||||
- ✓ Admin user
|
||||
- ✓ 2 Stores (TESTSTORE, WIZAMART)
|
||||
- ✓ 2 Stores (TESTSTORE, ORION)
|
||||
|
||||
### Enhanced Seeder Coverage
|
||||
- ✓ Admin user + multiple test users (stores, customers)
|
||||
@@ -88,7 +88,7 @@ python scripts/seed_database.py
|
||||
This creates:
|
||||
- 1 admin user
|
||||
- 3 test users (2 stores, 1 customer)
|
||||
- 3 stores (WIZAMART, FASHIONHUB, BOOKSTORE)
|
||||
- 3 stores (ORION, FASHIONHUB, BOOKSTORE)
|
||||
- 5 marketplace products
|
||||
- 10 store-product links
|
||||
- 4 customers
|
||||
@@ -107,7 +107,7 @@ python scripts/seed_database.py --minimal
|
||||
|
||||
This creates only:
|
||||
- 1 admin user
|
||||
- 1 store (WIZAMART)
|
||||
- 1 store (ORION)
|
||||
|
||||
#### Option C: Reset and Seed (Fresh Start)
|
||||
```bash
|
||||
@@ -133,7 +133,7 @@ This runs:
|
||||
|
||||
| Username | Email | Password | Role |
|
||||
|----------|-------|----------|------|
|
||||
| admin | admin@wizamart.com | admin123 | admin |
|
||||
| admin | admin@orion.lu | admin123 | admin |
|
||||
| store1 | store1@example.com | password123 | store |
|
||||
| store2 | store2@example.com | password123 | store |
|
||||
| customer1 | customer1@example.com | password123 | customer |
|
||||
@@ -142,7 +142,7 @@ This runs:
|
||||
|
||||
| Code | Name | Subdomain | Theme | Custom Domain |
|
||||
|------|------|-----------|-------|---------------|
|
||||
| WIZAMART | WizaMart | wizamart | modern | wizamart.shop |
|
||||
| ORION | Orion | orion | modern | orion.shop |
|
||||
| FASHIONHUB | Fashion Hub | fashionhub | vibrant | fashionhub.store |
|
||||
| BOOKSTORE | The Book Store | bookstore | classic | (none) |
|
||||
|
||||
@@ -218,12 +218,12 @@ python scripts/seed_database.py [--reset] [--minimal]
|
||||
- Password: `admin123`
|
||||
|
||||
### Store Shops
|
||||
- WIZAMART: `http://localhost:8000/shop/WIZAMART`
|
||||
- ORION: `http://localhost:8000/shop/ORION`
|
||||
- FASHIONHUB: `http://localhost:8000/shop/FASHIONHUB`
|
||||
- BOOKSTORE: `http://localhost:8000/shop/BOOKSTORE`
|
||||
|
||||
### Theme Editors
|
||||
- WIZAMART Theme: `http://localhost:8000/admin/stores/WIZAMART/theme`
|
||||
- ORION Theme: `http://localhost:8000/admin/stores/ORION/theme`
|
||||
- FASHIONHUB Theme: `http://localhost:8000/admin/stores/FASHIONHUB/theme`
|
||||
- BOOKSTORE Theme: `http://localhost:8000/admin/stores/BOOKSTORE/theme`
|
||||
|
||||
@@ -231,7 +231,7 @@ python scripts/seed_database.py [--reset] [--minimal]
|
||||
|
||||
```
|
||||
╔════════════════════════════════════════════════════════════════════╗
|
||||
║ WIZAMART DATABASE SEEDER ║
|
||||
║ ORION DATABASE SEEDER ║
|
||||
╚════════════════════════════════════════════════════════════════════╝
|
||||
|
||||
STEP 1: Verifying database...
|
||||
@@ -248,9 +248,9 @@ STEP 1: Creating users...
|
||||
✓ User 'customer1' created (ID: 4)
|
||||
|
||||
STEP 2: Creating stores...
|
||||
✓ WIZAMART created (ID: 1)
|
||||
✓ ORION created (ID: 1)
|
||||
✓ Theme 'modern' applied
|
||||
✓ Custom domain 'wizamart.shop' added
|
||||
✓ Custom domain 'orion.shop' added
|
||||
✓ FASHIONHUB created (ID: 2)
|
||||
✓ Theme 'vibrant' applied
|
||||
✓ Custom domain 'fashionhub.store' added
|
||||
@@ -285,7 +285,7 @@ You can customize the seeder by editing the configuration constants at the top o
|
||||
|
||||
```python
|
||||
# Admin credentials
|
||||
DEFAULT_ADMIN_EMAIL = "admin@wizamart.com"
|
||||
DEFAULT_ADMIN_EMAIL = "admin@orion.lu"
|
||||
DEFAULT_ADMIN_USERNAME = "admin"
|
||||
DEFAULT_ADMIN_PASSWORD = "admin123"
|
||||
|
||||
@@ -414,7 +414,7 @@ make db-setup
|
||||
|
||||
## Security Notes
|
||||
|
||||
⚠️ **IMPORTANT**:
|
||||
⚠️ **IMPORTANT**:
|
||||
- Default passwords are simple for development convenience
|
||||
- Change ALL default passwords in production environments
|
||||
- The admin password is intentionally weak for local development
|
||||
|
||||
Reference in New Issue
Block a user