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,6 +1,6 @@
|
||||
# Traditional VPS Deployment
|
||||
|
||||
This guide covers deploying Wizamart to a traditional VPS (Ubuntu 22.04+) without containers.
|
||||
This guide covers deploying Orion to a traditional VPS (Ubuntu 22.04+) without containers.
|
||||
|
||||
**Best for:** Teams who want direct server access and familiar Linux administration.
|
||||
|
||||
@@ -23,15 +23,15 @@ sudo apt update && sudo apt upgrade -y
|
||||
sudo apt install -y nginx postgresql-15 redis-server python3.11 python3.11-venv git curl
|
||||
|
||||
# 2. Create application user
|
||||
sudo useradd -m -s /bin/bash wizamart
|
||||
sudo useradd -m -s /bin/bash orion
|
||||
|
||||
# 3. Setup PostgreSQL
|
||||
sudo -u postgres createuser wizamart_user
|
||||
sudo -u postgres createdb wizamart_db -O wizamart_user
|
||||
sudo -u postgres psql -c "ALTER USER wizamart_user WITH PASSWORD 'your-secure-password';"
|
||||
sudo -u postgres createuser orion_user
|
||||
sudo -u postgres createdb orion_db -O orion_user
|
||||
sudo -u postgres psql -c "ALTER USER orion_user WITH PASSWORD 'your-secure-password';"
|
||||
|
||||
# 4. Clone and setup application
|
||||
sudo su - wizamart
|
||||
sudo su - orion
|
||||
git clone <repository-url> ~/app
|
||||
cd ~/app
|
||||
python3.11 -m venv .venv
|
||||
@@ -46,7 +46,7 @@ nano .env # Edit with production values
|
||||
alembic upgrade head
|
||||
python scripts/seed/init_production.py
|
||||
|
||||
# 7. Exit wizamart user
|
||||
# 7. Exit orion user
|
||||
exit
|
||||
```
|
||||
|
||||
@@ -57,21 +57,21 @@ exit
|
||||
### Main Application
|
||||
|
||||
```bash
|
||||
sudo nano /etc/systemd/system/wizamart.service
|
||||
sudo nano /etc/systemd/system/orion.service
|
||||
```
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Wizamart API Server
|
||||
Description=Orion API Server
|
||||
After=network.target postgresql.service redis.service
|
||||
|
||||
[Service]
|
||||
User=wizamart
|
||||
Group=wizamart
|
||||
WorkingDirectory=/home/wizamart/app
|
||||
Environment="PATH=/home/wizamart/app/.venv/bin"
|
||||
EnvironmentFile=/home/wizamart/app/.env
|
||||
ExecStart=/home/wizamart/app/.venv/bin/uvicorn main:app --host 127.0.0.1 --port 8000 --workers 4
|
||||
User=orion
|
||||
Group=orion
|
||||
WorkingDirectory=/home/orion/app
|
||||
Environment="PATH=/home/orion/app/.venv/bin"
|
||||
EnvironmentFile=/home/orion/app/.env
|
||||
ExecStart=/home/orion/app/.venv/bin/uvicorn main:app --host 127.0.0.1 --port 8000 --workers 4
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
StandardOutput=journal
|
||||
@@ -84,21 +84,21 @@ WantedBy=multi-user.target
|
||||
### Celery Worker
|
||||
|
||||
```bash
|
||||
sudo nano /etc/systemd/system/wizamart-celery.service
|
||||
sudo nano /etc/systemd/system/orion-celery.service
|
||||
```
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Wizamart Celery Worker
|
||||
Description=Orion Celery Worker
|
||||
After=network.target redis.service postgresql.service
|
||||
|
||||
[Service]
|
||||
User=wizamart
|
||||
Group=wizamart
|
||||
WorkingDirectory=/home/wizamart/app
|
||||
Environment="PATH=/home/wizamart/app/.venv/bin"
|
||||
EnvironmentFile=/home/wizamart/app/.env
|
||||
ExecStart=/home/wizamart/app/.venv/bin/celery -A app.core.celery_config worker --loglevel=info -Q default,long_running,scheduled --concurrency=4
|
||||
User=orion
|
||||
Group=orion
|
||||
WorkingDirectory=/home/orion/app
|
||||
Environment="PATH=/home/orion/app/.venv/bin"
|
||||
EnvironmentFile=/home/orion/app/.env
|
||||
ExecStart=/home/orion/app/.venv/bin/celery -A app.core.celery_config worker --loglevel=info -Q default,long_running,scheduled --concurrency=4
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
StandardOutput=journal
|
||||
@@ -111,21 +111,21 @@ WantedBy=multi-user.target
|
||||
### Celery Beat (Scheduler)
|
||||
|
||||
```bash
|
||||
sudo nano /etc/systemd/system/wizamart-celery-beat.service
|
||||
sudo nano /etc/systemd/system/orion-celery-beat.service
|
||||
```
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Wizamart Celery Beat Scheduler
|
||||
Description=Orion Celery Beat Scheduler
|
||||
After=network.target redis.service
|
||||
|
||||
[Service]
|
||||
User=wizamart
|
||||
Group=wizamart
|
||||
WorkingDirectory=/home/wizamart/app
|
||||
Environment="PATH=/home/wizamart/app/.venv/bin"
|
||||
EnvironmentFile=/home/wizamart/app/.env
|
||||
ExecStart=/home/wizamart/app/.venv/bin/celery -A app.core.celery_config beat --loglevel=info
|
||||
User=orion
|
||||
Group=orion
|
||||
WorkingDirectory=/home/orion/app
|
||||
Environment="PATH=/home/orion/app/.venv/bin"
|
||||
EnvironmentFile=/home/orion/app/.env
|
||||
ExecStart=/home/orion/app/.venv/bin/celery -A app.core.celery_config beat --loglevel=info
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
|
||||
@@ -136,21 +136,21 @@ WantedBy=multi-user.target
|
||||
### Flower (Task Monitoring)
|
||||
|
||||
```bash
|
||||
sudo nano /etc/systemd/system/wizamart-flower.service
|
||||
sudo nano /etc/systemd/system/orion-flower.service
|
||||
```
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Wizamart Flower Task Monitor
|
||||
Description=Orion Flower Task Monitor
|
||||
After=network.target redis.service
|
||||
|
||||
[Service]
|
||||
User=wizamart
|
||||
Group=wizamart
|
||||
WorkingDirectory=/home/wizamart/app
|
||||
Environment="PATH=/home/wizamart/app/.venv/bin"
|
||||
EnvironmentFile=/home/wizamart/app/.env
|
||||
ExecStart=/home/wizamart/app/.venv/bin/celery -A app.core.celery_config flower --port=5555
|
||||
User=orion
|
||||
Group=orion
|
||||
WorkingDirectory=/home/orion/app
|
||||
Environment="PATH=/home/orion/app/.venv/bin"
|
||||
EnvironmentFile=/home/orion/app/.env
|
||||
ExecStart=/home/orion/app/.venv/bin/celery -A app.core.celery_config flower --port=5555
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
|
||||
@@ -162,8 +162,8 @@ WantedBy=multi-user.target
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable wizamart wizamart-celery wizamart-celery-beat wizamart-flower
|
||||
sudo systemctl start wizamart wizamart-celery wizamart-celery-beat wizamart-flower
|
||||
sudo systemctl enable orion orion-celery orion-celery-beat orion-flower
|
||||
sudo systemctl start orion orion-celery orion-celery-beat orion-flower
|
||||
```
|
||||
|
||||
---
|
||||
@@ -171,7 +171,7 @@ sudo systemctl start wizamart wizamart-celery wizamart-celery-beat wizamart-flow
|
||||
## Nginx Configuration
|
||||
|
||||
```bash
|
||||
sudo nano /etc/nginx/sites-available/wizamart
|
||||
sudo nano /etc/nginx/sites-available/orion
|
||||
```
|
||||
|
||||
```nginx
|
||||
@@ -200,12 +200,12 @@ server {
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
|
||||
# Logging
|
||||
access_log /var/log/nginx/wizamart.access.log;
|
||||
error_log /var/log/nginx/wizamart.error.log;
|
||||
access_log /var/log/nginx/orion.access.log;
|
||||
error_log /var/log/nginx/orion.error.log;
|
||||
|
||||
# Static files (served directly)
|
||||
location /static {
|
||||
alias /home/wizamart/app/static;
|
||||
alias /home/orion/app/static;
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, immutable";
|
||||
access_log off;
|
||||
@@ -213,7 +213,7 @@ server {
|
||||
|
||||
# Uploaded files
|
||||
location /uploads {
|
||||
alias /home/wizamart/app/uploads;
|
||||
alias /home/orion/app/uploads;
|
||||
expires 7d;
|
||||
add_header Cache-Control "public";
|
||||
}
|
||||
@@ -250,7 +250,7 @@ server {
|
||||
### Enable Site
|
||||
|
||||
```bash
|
||||
sudo ln -s /etc/nginx/sites-available/wizamart /etc/nginx/sites-enabled/
|
||||
sudo ln -s /etc/nginx/sites-available/orion /etc/nginx/sites-enabled/
|
||||
sudo nginx -t
|
||||
sudo systemctl reload nginx
|
||||
```
|
||||
@@ -280,14 +280,14 @@ sudo ufw enable
|
||||
|
||||
```bash
|
||||
# Application logs
|
||||
sudo journalctl -u wizamart -f
|
||||
sudo journalctl -u orion -f
|
||||
|
||||
# Celery logs
|
||||
sudo journalctl -u wizamart-celery -f
|
||||
sudo journalctl -u orion-celery -f
|
||||
|
||||
# Nginx logs
|
||||
sudo tail -f /var/log/nginx/wizamart.access.log
|
||||
sudo tail -f /var/log/nginx/wizamart.error.log
|
||||
sudo tail -f /var/log/nginx/orion.access.log
|
||||
sudo tail -f /var/log/nginx/orion.error.log
|
||||
|
||||
# PostgreSQL logs
|
||||
sudo tail -f /var/log/postgresql/postgresql-15-main.log
|
||||
@@ -296,32 +296,32 @@ sudo tail -f /var/log/postgresql/postgresql-15-main.log
|
||||
### Restart Services
|
||||
|
||||
```bash
|
||||
sudo systemctl restart wizamart
|
||||
sudo systemctl restart wizamart-celery
|
||||
sudo systemctl restart orion
|
||||
sudo systemctl restart orion-celery
|
||||
sudo systemctl restart nginx
|
||||
```
|
||||
|
||||
### Database Access
|
||||
|
||||
```bash
|
||||
# Connect as wizamart user
|
||||
sudo -u postgres psql wizamart_db
|
||||
# Connect as orion user
|
||||
sudo -u postgres psql orion_db
|
||||
|
||||
# Or with password
|
||||
psql -h localhost -U wizamart_user -d wizamart_db
|
||||
psql -h localhost -U orion_user -d orion_db
|
||||
```
|
||||
|
||||
### Deploy Updates
|
||||
|
||||
```bash
|
||||
sudo su - wizamart
|
||||
sudo su - orion
|
||||
cd ~/app
|
||||
git pull origin main
|
||||
source .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
alembic upgrade head
|
||||
exit
|
||||
sudo systemctl restart wizamart wizamart-celery
|
||||
sudo systemctl restart orion orion-celery
|
||||
```
|
||||
|
||||
---
|
||||
@@ -331,22 +331,22 @@ sudo systemctl restart wizamart wizamart-celery
|
||||
### Database Backup Script
|
||||
|
||||
```bash
|
||||
sudo nano /home/wizamart/backup.sh
|
||||
sudo nano /home/orion/backup.sh
|
||||
```
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
BACKUP_DIR=/home/wizamart/backups
|
||||
BACKUP_DIR=/home/orion/backups
|
||||
DATE=$(date +%Y%m%d_%H%M%S)
|
||||
|
||||
# Create backup directory
|
||||
mkdir -p $BACKUP_DIR
|
||||
|
||||
# Backup database
|
||||
pg_dump -U wizamart_user wizamart_db | gzip > $BACKUP_DIR/db_$DATE.sql.gz
|
||||
pg_dump -U orion_user orion_db | gzip > $BACKUP_DIR/db_$DATE.sql.gz
|
||||
|
||||
# Backup uploads
|
||||
tar -czf $BACKUP_DIR/uploads_$DATE.tar.gz -C /home/wizamart/app uploads/
|
||||
tar -czf $BACKUP_DIR/uploads_$DATE.tar.gz -C /home/orion/app uploads/
|
||||
|
||||
# Keep last 7 days
|
||||
find $BACKUP_DIR -name "*.gz" -mtime +7 -delete
|
||||
@@ -355,18 +355,18 @@ echo "Backup completed: $DATE"
|
||||
```
|
||||
|
||||
```bash
|
||||
chmod +x /home/wizamart/backup.sh
|
||||
chmod +x /home/orion/backup.sh
|
||||
```
|
||||
|
||||
### Cron Job
|
||||
|
||||
```bash
|
||||
sudo -u wizamart crontab -e
|
||||
sudo -u orion crontab -e
|
||||
```
|
||||
|
||||
```cron
|
||||
# Daily backup at 2 AM
|
||||
0 2 * * * /home/wizamart/backup.sh >> /home/wizamart/backup.log 2>&1
|
||||
0 2 * * * /home/orion/backup.sh >> /home/orion/backup.log 2>&1
|
||||
```
|
||||
|
||||
---
|
||||
@@ -383,7 +383,7 @@ curl -s http://localhost:8000/health | jq
|
||||
|
||||
```bash
|
||||
# Check all services
|
||||
systemctl status wizamart wizamart-celery postgresql redis nginx
|
||||
systemctl status orion orion-celery postgresql redis nginx
|
||||
|
||||
# Resource usage
|
||||
htop
|
||||
@@ -405,7 +405,7 @@ Sentry provides real-time error tracking and performance monitoring.
|
||||
```
|
||||
4. **Restart services**:
|
||||
```bash
|
||||
sudo systemctl restart wizamart wizamart-celery
|
||||
sudo systemctl restart orion orion-celery
|
||||
```
|
||||
|
||||
Sentry will now capture:
|
||||
@@ -430,7 +430,7 @@ For production, use Cloudflare R2 instead of local storage for scalability and C
|
||||
R2_ACCOUNT_ID=your_account_id
|
||||
R2_ACCESS_KEY_ID=your_access_key
|
||||
R2_SECRET_ACCESS_KEY=your_secret_key
|
||||
R2_BUCKET_NAME=wizamart-media
|
||||
R2_BUCKET_NAME=orion-media
|
||||
R2_PUBLIC_URL=https://media.yourdomain.com
|
||||
```
|
||||
|
||||
@@ -467,10 +467,10 @@ See [Infrastructure Guide - Troubleshooting](infrastructure.md#troubleshooting-g
|
||||
|
||||
```bash
|
||||
# Is the app running?
|
||||
systemctl status wizamart
|
||||
systemctl status orion
|
||||
|
||||
# Can we connect to the database?
|
||||
pg_isready -h localhost -U wizamart_user
|
||||
pg_isready -h localhost -U orion_user
|
||||
|
||||
# Is Redis running?
|
||||
redis-cli ping
|
||||
@@ -479,5 +479,5 @@ redis-cli ping
|
||||
ss -tlnp | grep -E '(8000|5432|6379|80|443)'
|
||||
|
||||
# View recent errors
|
||||
journalctl -u wizamart --since "1 hour ago" | grep -i error
|
||||
journalctl -u orion --since "1 hour ago" | grep -i error
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user