hobokenchicken 1d05bf9cc8 chore: Remove nginx - use direct Caddy routing
- Remove nginx service from docker-compose
- Services bind to localhost:3000/3001 only
- Add Caddy configuration guide
- Update README with simplified structure
- External reverse proxy handles SSL/routing
2026-04-15 14:27:48 -04:00

CoopCredits ($COOP) Media Rewards Ecosystem

A complete Solana-based rewards system integrated with Plex, Tautulli, and Overseer.

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

# 1. Clone and install dependencies
git clone <repository> 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.

S
Description
Watch-to-earn credits for your Plex server. Earn by watching, spend on content requests. Self-hosted economics for media nerds.
Readme 1.6 MiB
Languages
TypeScript 75.2%
Shell 19.8%
Rust 2.6%
CSS 1.3%
Dockerfile 0.9%
Other 0.2%