Files
web_django_template/.env.example
T
westfarn 9cdce7a897 Add shop, POS sync, event ticketing, and shipping catalog apps (#6)
## Summary
- Closes #5
- Optional `shop`, `pos_sync`, `events`, and `shipping` apps gated by `FEATURE_*` flags
- Deps match the catalog: shop/events need email + Stripe; POS/shipping need shop
- Portal inventory, POS webhooks, capacity tickets, EasyPost/Pirate Ship shipping

## Test plan
- [ ] `manage.py test` (152 passed locally)
- [ ] Shop cart + paid order decrements stocked inventory
- [ ] POS inbound webhook decrements SKU; paid order queues outbound reserve
- [ ] Event capacity blocks overbook; paid order emails ticket codes
- [ ] Shipping stub label + Pirate Ship CSV of unshipped paid orders
- [ ] `validate-env.sh` rejects shop without email/payments, POS/shipping without shop

Reviewed-on: #6
2026-09-06 14:00:22 -07:00

129 lines
4.4 KiB
Bash

# Local development defaults. Copy to `.env` (gitignored) — never commit secrets.
# docker compose auto-loads `.env` for ${VAR} substitution into the web container.
#
# After seeding a client: scripts/bootstrap-client.sh <slug> "<Site Name>" <domain>
# then copy this file and fill secrets.
DJANGO_ENV=dev
DJANGO_DEBUG=true
DJANGO_SECRET_KEY=dev-only-change-me
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1,0.0.0.0
# Leave empty for SQLite, or point at local compose Postgres:
# DATABASE_URL=postgres://client_site:client_site@127.0.0.1:5432/client_site
SITE_UNDER_CONSTRUCTION=false
SITE_NAME=Your Company
SITE_TAGLINE=A tagline for the public site
PUBLIC_SITE_URL=http://127.0.0.1:8000
CONTACT_PHONE=
CONTACT_EMAIL=hello@example.com
CONTACT_ADDRESS=
CONTACT_SERVICE_AREA=
CREDIT_NAME=AI ML Operations, LLC
CREDIT_URL=https://aimloperations.com
# ---------------------------------------------------------------------------
# Catalog feature flags
# Local/dev defaults ON so the template is a working seed.
# Client prod/beta secrets: false unless that add-on was purchased.
# Disabled apps are omitted from INSTALLED_APPS (no models, admin, URLs, nav).
# ---------------------------------------------------------------------------
FEATURE_EMAIL_SMS=true
FEATURE_DIRECT_MAIL=true
FEATURE_BLOG=true
FEATURE_PAYMENTS=true
FEATURE_SOCIAL=true
FEATURE_SOCIAL_AI=true
FEATURE_SHOP=true
FEATURE_POS_SYNC=true
FEATURE_EVENTS=true
FEATURE_SHIPPING=true
# reCAPTCHA (optional locally — form skips captcha when empty)
RECAPTCHA_PUBLIC_KEY=
RECAPTCHA_PRIVATE_KEY=
# SMTP2GO — required when FEATURE_EMAIL_SMS=true in beta/prod
EMAIL_HOST=mail.smtp2go.com
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=
EMAIL_PORT=2525
EMAIL_USE_TLS=true
# Inbox From. Docker Compose .env cannot parse: "Name" <addr>
# Use bare address (SITE_NAME is wrapped) OR one quoted string:
# DEFAULT_FROM_EMAIL="Your Company <noreply@example.com>"
DEFAULT_FROM_EMAIL=noreply@example.com
# Console (default in DJANGO_ENV=dev) prints mail to container logs.
# EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
SMTP2GO_SMS_API_KEY=
# Unified SMTP2GO webhook (email + SMS): …/portal/messaging/webhooks/smtp2go/
# Authorization = Bearer + this secret.
SMTP2GO_WEBHOOK_SECRET=
# Postcards — PCM Integrations. Required when FEATURE_DIRECT_MAIL=true in beta/prod
POSTCARD_PROVIDER=pcm
PCM_API_KEY=
PCM_API_SECRET=
# PCM_CHILD_REF_NBR=
PCM_WEBHOOK_SECRETS=
# PCM_WEBHOOK_SECRET=
# Quote JSON (compose/shell break on bare {…, …}).
# PCM_RETURN_ADDRESS='{"firstName":"Jane","lastName":"Doe","address":"123 Main","city":"Town","state":"IL","zipCode":"60189"}'
PCM_RETURN_ADDRESS=
# Stripe — required when FEATURE_PAYMENTS=true
STRIPE_SECRET_KEY=
STRIPE_PUBLISHABLE_KEY=
STRIPE_WEBHOOK_SECRET=
STRIPE_CURRENCY=usd
# Shop — FEATURE_SHOP (requires email/SMS + payments)
# SHOP_PRINT_QUEUE_LIMIT_MINUTES=0
# POS sync — FEATURE_POS_SYNC (requires shop). Required in beta/prod.
POS_WEBHOOK_SECRET=
POS_API_BASE_URL=
POS_API_TOKEN=
# Shipping — FEATURE_SHIPPING (requires shop). EasyPost optional; CSV export always works.
EASYPOST_API_KEY=
SHIP_FROM_LINE1=
SHIP_FROM_CITY=
SHIP_FROM_STATE=
SHIP_FROM_ZIP=
# Social — SOCIAL_TOKEN_ENCRYPTION_KEY required when FEATURE_SOCIAL=true
# LinkedIn / Instagram App ID + Secret: Portal → Social accounts (not env).
META_APP_ID=
META_APP_SECRET=
# Generate: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
SOCIAL_TOKEN_ENCRYPTION_KEY=
# Ollama (LAN) — FEATURE_SOCIAL_AI. Default is the internal host, not public Ollama.
OLLAMA_BASE_URL=http://10.0.0.128:11434
OLLAMA_MODEL=llama3.2
# URL shortener (piha.li). Empty locally = long UTM URLs in campaigns.
# Call the API host, never https://piha.li (that host only 302s).
# Required in beta/prod when FEATURE_EMAIL_SMS or FEATURE_DIRECT_MAIL is on.
SHORTENER_BASE_URL=
SHORTENER_API_TOKEN=
# UTM_SOURCE= # optional override; default is a slug of SITE_NAME
# Local shortener compose:
# SHORTENER_BASE_URL=http://127.0.0.1:8005
# SHORTENER_API_TOKEN=acme:dev-only-token
# Nominatim (LAN) — address autocomplete via Django /api/address-suggest/
NOMINATIM_BASE_URL=http://10.0.0.128:8089
NOMINATIM_TIMEOUT_SECONDS=8
NOMINATIM_COUNTRY_CODES=us
# Tianji analytics (off in local/dev by default)
TIANJI_ENABLED=false
TIANJI_TRACKER_URL=https://tianji.aimloperations.com/tracker.js
TIANJI_WEBSITE_ID=
# DISPATCH_DUE_INTERVAL_SECONDS=15
GUNICORN_WORKERS=2