Files
Commander-Deck-App-backup/PROJECT_STATE.md
T
2026-06-22 17:36:26 -06:00

77 lines
2.7 KiB
Markdown

# MTG Commander Deck Builder — Project State
## Overview
Self-hosted, AI-powered Magic: The Gathering Commander deck builder.
Runs as a Docker Compose stack managed via Portainer, exposed externally via Cloudflare Tunnel + Traefik.
**Stack:** FastAPI (Python 3.12) · React/Vite (TypeScript) · PostgreSQL 16 · Redis 7 · Nginx · Docker Compose
---
## Build Progress
### ✅ Step 1 — Project scaffold
### ✅ Step 2 — Database schema
### ✅ Step 3 — Auth + user management
### ✅ Step 4 — Collection import
### ✅ Step 5 — Claude AI integration
### ✅ Step 6 — React frontend
### ✅ Step 7 — First deployment
App is live at http://commander.bussenet.ca
---
## Deployment Architecture
- Cloudflare Tunnel → Traefik (port 80) → nginx container
- Portainer stack ID: 52 (commander-forge)
- Backend container manually created outside Portainer — needs reconciliation
- Admin login: busse.daniel@gmail.com / Admin1234
## Known fixes applied
- passlib replaced with bcrypt==4.1.3
- npm ci replaced with npm install in frontend Dockerfile
- package-lock.json added to repo
- nginx baked into image via nginx/Dockerfile
- docker-compose.yml uses Traefik labels, no port 80 binding
- DATABASE_URL and REDIS_URL passed explicitly as env vars
- UserRole enum uses values_callable for lowercase storage
- Portainer git source caches aggressively — use --no-cache --pull for rebuilds
## Infrastructure
- Gitea: http://192.168.0.62:3001 / https://gitea.bussenet.ca
- GitHub mirror: https://github.com/danbusse/Commander-Deck-App (private)
- Portainer MCP: fixed, using custom mcp-portainer:latest image with -- entrypoint fix
- Cloudflare tunnel: degraded (region2 unreachable, ISP routing issue), region1 stable
## Environment Variables (Portainer stack env)
- SECRET_KEY: changeme (needs replacing)
- POSTGRES_PASSWORD: changeme (needs replacing)
- DATABASE_URL: postgresql+asyncpg://mtg:changeme@db:5432/mtgdb
- REDIS_URL: redis://cache:6379
- ANTHROPIC_API_KEY: in Vault at secret/anthropic
- ADMIN_EMAIL: busse.daniel@gmail.com
- ADMIN_PASSWORD: Admin1234
## Next Session — Start Here
**Priority 1 — Portainer housekeeping:**
Backend container was manually created outside Portainer stack. Needs clean redeploy.
**Priority 2 — Harden credentials:**
- SECRET_KEY → openssl rand -hex 32
- POSTGRES_PASSWORD → strong password
- DATABASE_URL → update to match
**Priority 3 — Test end to end:**
- Try building a deck via Generate mode
- Test collection import with Archidekt export
- Verify admin approval flow
**Priority 4 — GitHub mirror sync:**
When committing from Windows: push to both Gitea and GitHub
git push origin master
git push github master
Or set up automatic mirror push from Gitea.