# CoopCoins: Our Family Media Rewards Welcome to our private media rewards system for the Hoboken Chicken family and friends! It's powered by Solana and integrates with our Plex, Tautulli, and Overseer setup. Earn CoopCoins ($COOP) for enjoying media, and use them to request new content! ## System Architecture ``` ┌─────────────────────────────────────────────────────────────────────────────┐ │ coop.hobokenchicken.com │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌─────────────────┐ │ │ │ Next.js │ │ Express │ │ PostgreSQL │ │ Solana Devnet │ │ │ │ Frontend │◄─┤ API │◄─┤ Database │◄─┤ $COOP SPL │ │ │ │ │ │ │ │ │ │ Token │ │ │ └──────────────┘ └──────────────┘ └──────────────┘ └─────────────────┘ │ │ ▲ ▲ │ │ │ │ │ │ Plex OAuth Tautulli Webhooks │ │ │ │ │ │ ▼ ▼ │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │ │ Plex Server │ │ Tautulli │ │ Overseer │ │ │ │ (Content) │ │ (Analytics) │ │ (Requests) │ │ │ └──────────────┘ └──────────────┘ └──────────────┘ │ └─────────────────────────────────────────────────────────────────────────────┘ ``` ## Quick Start ```bash # 1. Clone and install dependencies git clone coop-credits cd coop-credits npm install # 2. Set up environment cp .env.example .env # Edit .env with your values # 3. Create public directory mkdir -p frontend/public # 4. Start services docker-compose up -d --build # 5. Initialize database (first time only) docker-compose exec backend npx prisma db push # 6. Configure Caddy (see docs/CADDY-CONFIG.md) # Services expose ports 3000 (frontend) and 3001 (backend) on localhost ``` See `docs/CADDY-CONFIG.md` for reverse proxy setup. ## Project Structure ``` coop-credits/ ├── anchor-program/ # Solana Anchor program for $COOP token ├── backend/ # Express API server ├── frontend/ # Next.js dashboard ├── shared/ # Shared types and utilities ├── docs/ # Documentation │ └── CADDY-CONFIG.md # Reverse proxy setup ├── docker-compose.yml # Docker orchestration (no nginx) └── .env.example # Environment template ``` **Note:** No internal reverse proxy. Use Caddy/Nginx/Traefik externally. ## User Flow 1. **Login** → User visits coop.hobokenchicken.com, authenticates with Plex 2. **Wallet** → Auto-created Solana wallet or connect existing 3. **Watch** → Viewing on Plex → Tautulli triggers → $COOP minted 4. **Earn** → Real-time balance updates on dashboard 5. **Spend** → Request content on Overseer → $COOP deducted 6. **History** → Full transaction history visible on dashboard ## Admin Features - System overview and analytics - User management and balance adjustments - Minting rate controls - Spending controls and promotions - Emergency pause and recovery ## Environment Variables See `backend/.env.example` and `frontend/.env.local.example` for full configuration.