/var/www/yealinbilling/
├── .env # All secrets — chmod 600 — NEVER commit to git
├── .gitignore # Git ignore rules
├── manage.py # Django management commands
├── requirements.txt # Python dependencies (pinned versions)
├── gunicorn.sock # Unix socket for Nginx ↔ Gunicorn comm
│
├── venv/ # Python virtual environment
│ └── lib/python3.13/ # All installed packages
│
├── config/ # Django project configuration
│ ├── settings/
│ │ ├── base.py # Shared settings (both dev + prod)
│ │ ├── development.py # Dev overrides (DEBUG=True, console email)
│ │ └── production.py # Prod overrides (DEBUG=False, SSL, logging)
│ ├── urls.py # Root URL configuration
│ ├── wsgi.py # WSGI entry point for Gunicorn
│ └── celery.py # Celery configuration
│
├── apps/ # All Django applications
│ ├── core/ # Base models, settings, FX tasks
│ │ ├── models.py # TimeStampedModel, AuditLog, WebhookEvent, Setting
│ │ ├── tasks.py # refresh_fx_rate Celery task
│ │ ├── admin.py # Django admin registration
│ │ └── migrations/ # Database migrations
│ ├── customers/ # Customer management
│ │ ├── models.py # Customer, CustomerGroup, CustomerCLI
│ │ ├── views.py # REST API viewsets
│ │ ├── serializers.py # DRF serializers
│ │ └── migrations/
│ ├── cdr/ # Call Detail Records
│ │ ├── models.py # CallRecord
│ │ ├── views.py # CDR API + reprocess endpoint
│ │ ├── tasks.py # Twilio sync Celery tasks
│ │ ├── pricing.py # Call pricing engine
│ │ ├── normaliser.py # CDR normalisation
│ │ ├── cli_matcher.py # CLI → Customer matching
│ │ ├── destination_classifier.py # Number → Destination matching
│ │ ├── csv_parser.py # CSV import parser
│ │ └── migrations/
│ ├── products/ # Products, destinations, rate cards
│ │ ├── models.py # Category, Tariff, Product, Destination,
│ │ │ # RateCardAdjustment, ServiceCharge
│ │ ├── views.py # REST API viewsets
│ │ └── migrations/
│ ├── billing/ # Billing engine
│ │ ├── models.py # BillingRun, Invoice, InvoiceLineItem
│ │ ├── views.py # Billing API viewsets
│ │ ├── engine.py # Core billing run logic
│ │ ├── pdf.py # WeasyPrint PDF generation
│ │ ├── email.py # Invoice email sender
│ │ └── migrations/
│ ├── payments/ # Payments
│ │ ├── models.py # Payment
│ │ ├── views.py # Payment API + Stripe webhook
│ │ ├── stripe_client.py # Stripe checkout session creator
│ │ └── migrations/
│ ├── portal/ # Customer self-service portal
│ │ ├── models.py # CustomerPortalUser
│ │ ├── views.py # Portal API endpoints
│ │ ├── urls.py # Portal URL routing
│ │ └── migrations/
│ └── api/ # Main API routing
│ ├── views.py # Dashboard, reports, FX, settings views
│ └── urls.py # All API URL patterns
│
├── frontend/ # React frontend source
│ ├── src/
│ │ ├── api/client.js # Axios with JWT auto-attach
│ │ ├── store/auth.js # Zustand auth store
│ │ ├── components/ # Reusable UI components
│ │ └── pages/ # All page components
│ ├── package.json # Node dependencies
│ └── vite.config.js # Vite build config
│
├── staticfiles/ # Collected static files (Django + React build)
│ ├── frontend/ # Built React app (index.html + assets)
│ └── admin/ # Django admin static files
│
├── media/ # User-uploaded files
│ └── invoices/ # Generated PDF invoices
│
├── templates/ # Django HTML templates
│ └── email/ # Email templates
│ ├── invoice_email.html # Branded HTML invoice email
│ └── invoice_email.txt # Plain text fallback
│
└── logs/ # Application logs
├── django-errors.log # Django ERROR+ level logs
├── gunicorn-access.log # HTTP access log
├── gunicorn-error.log # Gunicorn error log
├── celery-worker.log # Celery task execution log
└── celery-beat.log # Celery scheduled task log
/etc/nginx/sites-available/yealinbilling # Nginx site config (billing)
/etc/nginx/sites-available/wikijs # Nginx site config (wiki)
/etc/nginx/sites-enabled/ # Symlinks to active sites
/etc/systemd/system/gunicorn.service # Gunicorn service definition
/etc/systemd/system/celery.service # Celery worker service
/etc/systemd/system/celerybeat.service # Celery beat service
/etc/letsencrypt/live/billing.yealin.com.au/ # SSL cert (billing)
/etc/letsencrypt/live/wiki.yealin.com.au/ # SSL cert (wiki)
/opt/wikijs/docker-compose.yml # Wiki.js Docker config
/opt/wikijs/ # Wiki.js Docker files