How neco3coffee/exit_cheat_bs works
Main components
• Frontend layer
• Next.js App Router (React)
• Next API Routes (server-side middleware)
• Backend layer
• Ruby on Rails “API” application (app/controllers/api/v1, services, jobs, mailers)
• Background-job system (ActiveJob with configured adapter via config/queue.yml)
• Storage adapter (ActiveStorage → AWS S3 via config/storage.yml)
• Data layer
• MySQL database (defined in backend/config/database.yml)
• Infrastructure & orchestration
• Docker Compose (frontend, backend, mysql containers)
• Kamal hooks for build/deploy lifecycle
• GitHub Actions (ci.yml, deploy.yml, playwright.yml)
• Testing & monitoring
• Playwright E2E tests (in e2e/)
• RSpec & Rails tests (backend/spec/)
Relationships & data flows
• Browser → Next.js frontend over HTTPS (port 3001 locally)
• Static assets, SSR pages, client components
• Calls Next.js API routes (app/api/v1/…) for session/auth, player lookup, reports, stats
• Next.js API Routes → Rails API over HTTP (port 3000 locally)
• JSON requests/responses between web and backend
• Rails API → MySQL
• CRUD via ActiveRecord migrations/models/controllers
• Rails API → S3
• Uploading user-submitted game videos via ActiveStorage
• Rails API → Background queue
• Enqueue jobs (e.g. SavePlayerJob, UpdatePlayerNamesJob)
• Background workers → MySQL (read/write updates)
• GitHub Actions → Docker Compose & Deploy hooks
• CI: run linters, tests, build images
• CD: push containers, trigger Kamal deploy scripts
• Local E2E runner (Playwright) → Next.js / Rails endpoints
Architectural patterns & design principles
• MVC pattern in Rails (models, controllers, services)
• Server-side rendering + client components in Next.js (app router, React)
• API-first approach: clear separation between UI (Next) and data services (Rails)
• Container-driven dev/test/prod parity via Docker Compose
• Hook-based deployment lifecycle (Kamal) for repeatable deploys
• Background processing for I/O-bound tasks (ActiveJob)
Deployment & CI/CD
• “GitHub” → “GitHub Actions”
• Actions → “Docker Hub / Container Registry” → “Kamal deploy hooks”
• Environments: dev, staging, prod