Skip to content

Latest commit

 

History

64 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS Term Fighter

Monorepo bootstrap for the CS Term Fighter stack:

  • frontend/: React + TypeScript (Vite)
  • backend/: Go API service + PostgreSQL + Redis
  • world-server/: Go WebSocket world service
  • shared/: shared cross-service types/interfaces
  • k8s/: future k3s manifests

API docs:

  • Login/Auth API: backend/LOGIN_API.md

Docker-Only Quick Start

Run everything in containers (frontend + backend + world-server + postgres + redis):

docker compose up -d --build

Frontend: http://localhost:5173
Backend health: http://localhost:3001/health
World server health: http://localhost:8080/health

Stop everything:

docker compose down

Local Setup Script (Backup)

If your team wants a host-based fallback setup:

./scripts/setup.sh

Useful flags:

  • ./scripts/setup.sh --with-docker installs deps and starts only postgres/redis.
  • ./scripts/setup.sh --docker-all installs deps and also builds/starts full docker stack.

Manual Local Quick Start

  1. Start local infrastructure:
docker compose up -d
  1. Configure local env files:
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
cp world-server/.env.example world-server/.env
  1. Run frontend:
cd frontend
npm install
npm run dev
  1. Run backend:
cd backend
go run .
  1. Run world server:
cd world-server
go run .

Build Checks

cd frontend && npm run build
cd backend && go build ./...
cd world-server && go build ./...

Automated Tests

Run the full automated test suite for the whole repo with either of these commands from the repo root:

make test

or

./scripts/test-all.sh

Render + Vercel Deployment (Current Setup)

Production endpoints:

  • Frontend: https://cs-term-fighter.vercel.app
  • Backend: https://cs-term-fighter-backend.onrender.com
  • World server: https://cs-term-fighter-world-server.onrender.com

Frontend (Vercel) env vars

  • VITE_API_BASE_URL=https://cs-term-fighter-backend.onrender.com
  • VITE_WORLD_WS_URL=wss://cs-term-fighter-world-server.onrender.com/ws
  • VITE_WORLD_API_BASE_URL=https://cs-term-fighter-world-server.onrender.com

Backend (Render) env vars

  • FRONTEND_ORIGIN=https://cs-term-fighter.vercel.app
  • COOKIE_SECURE=true
  • COOKIE_SAMESITE=none
  • GOOGLE_REDIRECT_URL=https://cs-term-fighter-backend.onrender.com/auth/google/callback
  • Set your existing hidden values for:
    • DATABASE_URL
    • REDIS_URL
    • GOOGLE_CLIENT_ID
    • GOOGLE_CLIENT_SECRET
    • JWT_SECRET

World server (Render) env vars

  • BATTLE_API_BASE_URL=https://cs-term-fighter-backend.onrender.com
  • Set your Redis env:
    • Preferred: REDIS_URL=rediss://... (supported by this branch)
    • Local-style fallback: REDIS_ADDR=host:port

About

Group project for CS130: Software Engineering. This is a portfolio copy.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages