This repository contains the digital implementation of the "Operation Pacific Shield" (OPS) wargame, a culminating capstone exercise for the Officer Training School (OTS). The application provides an experiential learning environment for Officer Trainees (OTs) to plan, brief, and execute a joint scheme of maneuver in a high-intensity, contested, and operationally limited environment.
The primary goal is to employ Agile Combat Employment (ACE) concepts in a fictional conflict. Players manage resources, establish Forward Operating Sites (FOS), and coordinate between different command teams to achieve mission objectives and accumulate Mission Points (MP).
- Multi-Team Gameplay: Supports distinct teams, including a Combined Air Operations Center (CAOC), a Combined Space Operations Center (CSpOC), and multiple Main Operating Bases (MOBs), each with unique roles and responsibilities.
- Real-time Game State: Utilizes WebSockets to ensure all players have a live, synchronized view of the game board, assets, and events.
- Persistent Game Sessions: Game states are saved to a database, allowing for sessions to be paused and resumed.
- Complex Rule Enforcement: The system is designed to programmatically enforce the game's complex rules for movement, combat, logistics, and scoring.
- Dynamic Scenarios: Simulates the fog and friction of war through event cards, political shifts, and resource constraints.
This project is a monorepo managed by Nx.
- Frontend (
pac-shield): An Angular application providing the main user interface, game board visualization, and player controls. - Backend (
pac-shield-api): A NestJS application that manages game logic, API endpoints, and WebSocket communication. - Database: A PostgreSQL database managed with Prisma as the Object-Relational Mapper (ORM).
- Real-time Communication: Handled by the
EventsGatewayin the NestJS API using WebSockets.
This guide will walk you through setting up a complete development environment from scratch, assuming you're starting with a fresh Windows machine.
- Download VS Code from https://code.visualstudio.com/
- Run the installer and follow the setup wizard
- Important: During installation, check "Add to PATH" option
- Install these recommended extensions:
- Angular Language Service
- Prisma
- GitLens
- Docker
- WSL (if using Windows)
- Download Git from https://git-scm.com/downloads
- During installation, use default options but use VS Code as the default editor
- Configure Git with your information:
git config --global user.name "Your Name" git config --global user.email "your.email@example.com"
- Open PowerShell as Administrator
- Enable WSL and Virtual Machine features:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
- Restart your computer
- Download and install the WSL2 Linux kernel update package from Microsoft
- Set WSL2 as default:
wsl --set-default-version 2
- Install Ubuntu from Microsoft Store and complete initial setup
- Open PowerShell as Administrator
- Set execution policy to allow script running:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
- Type
Ywhen prompted to confirm
- Download Docker Desktop from https://docs.docker.com/desktop/
- Run the installer
- Important: During installation, ensure "Use WSL 2 instead of Hyper-V" is selected (Windows)
- Restart your computer when prompted
- Start Docker Desktop and complete the initial setup
- Verify installation:
docker --version docker-compose --version
- Download Node.js LTS from https://nodejs.org/
- Run the installer and follow the setup wizard
- Important: Check "Automatically install necessary tools" during installation
- Verify installation:
node --version npm --version
-
Remove any existing global package managers (recommended):
npm uninstall -g yarn pnpm
-
Enable Corepack (included with Node.js):
corepack enable -
Install Corepack if missing (some Node.js distributions may not include it):
npm install -g corepack corepack enable -
Verify Corepack and Yarn installation:
# Check if Corepack is working yarn exec env # Check Yarn version (should show version specified in package.json) yarn --version
Note: This project uses Yarn 4.9.4 as specified in package.json. Corepack will automatically use the correct version when you run Yarn commands in the project directory.
- Open terminal in your project directory
- Start the database:
docker-compose up -d
- Verify it's running:
docker-compose ps
git clone <repository-url>
cd pacsimyarn install# Generate Prisma client and DTOs
npx nx prisma-generate pac-shield-api
# Apply database schema
npx nx prisma-db-push pac-shield-api# Open Prisma Studio to view your database
npx nx prisma-studio pac-shield-apiOpen two terminal windows/tabs:
Terminal 1 - Backend API:
npx nx serve pac-shield-apiTerminal 2 - Frontend UI:
npx nx serve pac-shield- Frontend: http://localhost:4200
- Backend API: http://localhost:3000
- Prisma Studio: http://localhost:5555
- "yarn command not found": Run
corepack enableto activate Corepack - "corepack command not found": Install Corepack with
npm install -g corepack - Yarn version mismatch: Corepack will automatically use Yarn 4.9.4 as specified in package.json
- Permission errors: On Windows, run terminal as Administrator when enabling Corepack
- Corepack not working: Remove global Yarn first:
npm uninstall -g yarn pnpm
- "Docker daemon not running": Start Docker Desktop application
- Port conflicts: Stop other services using port 5432 or change the port in docker-compose.yml
- Connection refused: Ensure PostgreSQL container is running with
docker-compose ps - Authentication failed: Check credentials in
.envfile match docker-compose.yml
- "Execution of scripts is disabled": Run
Set-ExecutionPolicy RemoteSignedas Administrator
- "WSL not found": Enable WSL feature and install a Linux distribution from Microsoft Store
- Docker not working in WSL: Ensure Docker Desktop has WSL integration enabled
After completing this setup, you should have:
- ✅ Visual Studio Code with recommended extensions
- ✅ Git configured with your credentials
- ✅ WSL2 enabled (Windows)
- ✅ PowerShell execution policy configured (Windows)
- ✅ Docker Desktop running
- ✅ Node.js installed with Corepack enabled for Yarn 4.9.4
- ✅ PostgreSQL running in Docker
- ✅ Project dependencies installed
- ✅ Database schema applied
- ✅ Both frontend and backend servers running
Here are the most common commands for managing the workspace after initial setup.
- Run Frontend:
npx nx serve pac-shield - Run Backend:
npx nx serve pac-shield-api - Build Frontend:
npx nx build pac-shield - Build Backend:
npx nx build pac-shield-api - Run API Tests:
npx nx test pac-shield-api - Run Frontend Tests:
npx nx test pac-shield - Run E2E Tests:
npx nx e2e pac-shield-e2e - Run API E2E Tests:
npx nx e2e pac-shield-api-e2e
All database commands are targeted at the pac-shield-api project.
- Generate Prisma Client: (Run this after changing
schema.prisma)npx nx prisma-generate pac-shield-api
- Apply Schema Changes: (Pushes non-destructive changes to the DB)
npx nx prisma-db-push pac-shield-api
- Reset the Database: (Clears all data and re-applies migrations)
npx nx prisma-db-reset pac-shield-api
- Open Prisma Studio: (A GUI for viewing and editing database records)
npx nx prisma-studio pac-shield-api
- Start PostgreSQL:
docker-compose up -d postgres - Stop PostgreSQL:
docker-compose down - View container status:
docker-compose ps - View database logs:
docker-compose logs postgres
- Lint Frontend:
npx nx lint pac-shield - Lint Backend:
npx nx lint pac-shield-api - Format code:
npx nx format:write - Check formatting:
npx nx format:check
Run npx nx graph to see a visual diagram of the projects and their dependencies.
For AI/ML features, you can optionally run Qdrant:
docker run -p 6333:6333 qdrant/qdrant- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes following the project's coding standards
- Test your changes thoroughly
- Submit a pull request with a clear description of your changes
If you encounter issues during setup or development:
- Check the troubleshooting section above
- Review the project's issue tracker
- Ensure all prerequisites are properly installed
- Verify that Docker containers are running with
docker-compose ps
For specific technical questions, please refer to the individual framework documentation: