Files
print_forge/.env.prod.example
westfarn dd37a2a268
Deploy Beta / docker (push) Successful in 37s
Deploy Beta / deploy-beta (push) Successful in 2m21s
Deploy Beta / unit-tests (push) Successful in 39s
Customer accounts, order tracking, and purchase reviews (#8)
## Summary
- Slim the public contact form to email, interest, and message. Name, phone, and address live on the customer profile instead.
- Customers can register, sign in, save shipping details, and view order history. Logged-in checkout creates a Stripe Customer and saves cards on Stripe (`setup_future_usage`); we only store `stripe_customer_id`.
- Shipment tracking: EasyPost tracker lookup + webhook, plus paste-in numbers from Pirate Ship/Shippo. Customers see carrier status on their orders; `dispatch_due` refreshes open shipments.
- Product reviews (1–5) only after a paid/fulfilled purchase of that product.

Fixes #7

## Test plan
- [ ] Contact form submits with only email + message; extra name/phone/address fields are ignored
- [ ] Register, sign in, save profile (name/phone/shipping)
- [ ] Guest checkout still works; after signup, prior orders with that email show in history
- [ ] Logged-in checkout prefills shipping and does not collect card data locally
- [ ] Portal: buy label or paste a Pirate Ship tracking number, confirm status/events; customer order page shows tracking
- [ ] Product page: non-buyers cannot review; buyers can leave one 1–5 star review
- [ ] Non-staff users hitting `/portal/` redirect to `/account/`

Reviewed-on: #8
2026-09-07 04:53:41 -07:00

124 lines
3.7 KiB
Bash

# Secret env files for server-infra deploy. Never commit.
# Copy on the control node:
# ~/Documents/secrets/print_forge/print_forge_prod.env
# ~/Documents/secrets/print_forge/print_forge_beta.env
#
# Docker Compose: if a secret contains $ (e.g. DATABASE_URL password), escape
# each $ as $$ or compose will treat $word as a variable.
DJANGO_ENV=prod
DJANGO_DEBUG=false
DJANGO_SECRET_KEY=replace-with-a-long-random-secret
DJANGO_ALLOWED_HOSTS=printforgeprints.com,www.printforgeprints.com
SITE_UNDER_CONSTRUCTION=true
SITE_NAME="Print Forge"
SITE_TAGLINE="Handcrafted 3D printed toys"
PUBLIC_SITE_URL=https://printforgeprints.com
DEFAULT_FROM_EMAIL=Printforgeprints@gmail.com
CONTACT_PHONE=630-632-0202
CONTACT_EMAIL=Printforgeprints@gmail.com
CONTACT_ADDRESS=
CONTACT_SERVICE_AREA=Chicagoland
CREDIT_NAME="AI ML Operations, LLC"
CREDIT_URL=https://aimloperations.com
# Optional catalog features — false unless purchased.
# Turning a flag on later: set true, redeploy, migrate. Do not auto-drop tables.
FEATURE_EMAIL_SMS=true
FEATURE_DIRECT_MAIL=false
FEATURE_BLOG=false
FEATURE_PAYMENTS=true
FEATURE_SOCIAL=false
FEATURE_SOCIAL_AI=false
FEATURE_SHOP=true
FEATURE_POS_SYNC=false
FEATURE_EVENTS=false
FEATURE_SHIPPING=true
# Shared external Postgres (10.0.0.230)
DATABASE_URL=postgres://westfarn:replace-db-password@10.0.0.230:5432/print_forge
WEB_PORT=8007
RECAPTCHA_PUBLIC_KEY=replace-me
RECAPTCHA_PRIVATE_KEY=replace-me
# Required when FEATURE_EMAIL_SMS=true
EMAIL_HOST=mail.smtp2go.com
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=
EMAIL_PORT=2525
EMAIL_USE_TLS=true
SMTP2GO_SMS_API_KEY=
SMTP2GO_WEBHOOK_SECRET=
# Required when FEATURE_DIRECT_MAIL=true
POSTCARD_PROVIDER=pcm
PCM_API_KEY=
PCM_API_SECRET=
PCM_WEBHOOK_SECRETS=
PCM_RETURN_ADDRESS=
# Required when FEATURE_PAYMENTS=true (also requires FEATURE_EMAIL_SMS=true)
STRIPE_SECRET_KEY=
STRIPE_PUBLISHABLE_KEY=
STRIPE_WEBHOOK_SECRET=
STRIPE_CURRENCY=usd
# Required when FEATURE_SHOP=true (also requires FEATURE_EMAIL_SMS + FEATURE_PAYMENTS)
# SHOP_PRINT_QUEUE_LIMIT_MINUTES=0
# Required when FEATURE_POS_SYNC=true in beta/prod (also requires FEATURE_SHOP)
POS_WEBHOOK_SECRET=
POS_API_BASE_URL=
POS_API_TOKEN=
# Optional when FEATURE_SHIPPING=true (also requires FEATURE_SHOP)
EASYPOST_API_KEY=
# Optional. If set, EasyPost tracker webhooks must send it as X-Webhook-Secret or ?token=.
EASYPOST_WEBHOOK_SECRET=
SHIP_FROM_LINE1=
SHIP_FROM_CITY=
SHIP_FROM_STATE=
SHIP_FROM_ZIP=
# Required when FEATURE_SOCIAL=true
META_APP_ID=
META_APP_SECRET=
SOCIAL_TOKEN_ENCRYPTION_KEY=
# Required when FEATURE_SOCIAL_AI=true (requires FEATURE_SOCIAL)
OLLAMA_BASE_URL=http://10.0.0.128:11434
OLLAMA_MODEL=llama3.2
OLLAMA_TIMEOUT_SECONDS=120
# Required in beta/prod when FEATURE_EMAIL_SMS or FEATURE_DIRECT_MAIL is on.
# POST /api/links/ on the API host. Recipients hit https://piha.li/<code>.
# Token must match SHORTENER_API_TOKENS on url_shortening_service (name:secret).
# Generate: python -c "import secrets; print(secrets.token_urlsafe(32))"
SHORTENER_BASE_URL=https://shortener.aimloperations.com
SHORTENER_API_TOKEN=print_forge:replace-me
# UTM_SOURCE=print-forge # optional; default is a slug of SITE_NAME
NOMINATIM_BASE_URL=http://10.0.0.128:8089
NOMINATIM_TIMEOUT_SECONDS=8
NOMINATIM_COUNTRY_CODES=us
TIANJI_ENABLED=true
TIANJI_TRACKER_URL=https://tianji.aimloperations.com/tracker.js
TIANJI_WEBSITE_ID=
GUNICORN_WORKERS=2
GUNICORN_BIND=0.0.0.0:8000
# BETA overrides — print-forge-preview.aimloperations.com
# DJANGO_ENV=beta
# SITE_UNDER_CONSTRUCTION=false
# PUBLIC_SITE_URL=https://print-forge-preview.aimloperations.com
# DATABASE_URL=postgres://westfarn:replace-db-password@10.0.0.230:5432/print_forge_beta
# WEB_PORT=8019
# SHORTENER_BASE_URL=https://shortener-beta.aimloperations.com
# SHORTENER_API_TOKEN=print_forge:replace-with-a-different-token