9516f5d570
- Add Docker build troubleshooting section - Update Quick Start with SSL cert and public dir steps - Add prisma db push instruction for database setup - Document common build errors and solutions
4.3 KiB
4.3 KiB
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 (see docs/SETUP-INFRASTRUCTURE.md)
# 3. Create required directories
mkdir -p docker/nginx/ssl
mkdir -p frontend/public
# 4. Generate SSL certificates (self-signed for local dev)
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout docker/nginx/ssl/key.pem \
-out docker/nginx/ssl/cert.pem \
-subj "/CN=localhost"
# 5. Start with Docker Compose
docker-compose up -d --build
# 6. Initialize database (first time only)
docker-compose exec backend npx prisma db push
# 7. Deploy Solana program (optional, for token features)
cd anchor-program
anchor deploy
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
├── docker/ # Docker configurations
├── deployment/ # Deployment scripts
└── docker-compose.yml # Full stack orchestration
User Flow
- Login → User visits coop.hobokenchicken.com, authenticates with Plex
- Wallet → Auto-created Solana wallet or connect existing
- Watch → Viewing on Plex → Tautulli triggers → $COOP minted
- Earn → Real-time balance updates on dashboard
- Spend → Request content on Overseer → $COOP deducted
- 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.