Map-based CTF/cyber-range platform.
MapCTF is a map-based CTF/cyber-range platform with:
- A Go backend (API + map service)
- A React + TypeScript frontend
- PostgreSQL and Redis for state/session storage
Warning
MapCTF is under active development. Review configuration and deployment settings before running in production.
The development stack is split into four main runtime components:
mapctf-apion:8081(REST/API workflows)mapctf-mapon:8082(map/gameboard and template/static serving)mapctf-postgreson:5432(persistent relational data)mapctf-redison:6379(cache and session store)
In this repository, frontend development runs separately with Vite (default :3000).
mapctf/
├── backend/
│ ├── cmd/
│ │ ├── api/ # API service entrypoint
│ │ ├── map/ # Map service entrypoint + handlers/templates
│ │ └── cli/ # CLI utilities
│ ├── pkg/
│ │ ├── backend/ # DB layer
│ │ ├── cache/ # Redis/cache primitives
│ │ ├── challenges/ # Challenge domain logic
│ │ ├── config/ # Config types/flags/validation
│ │ ├── teams/ # Team domain logic
│ │ ├── users/ # User/auth domain logic
│ │ └── version/ # Version metadata
│ └── Makefile # Backend build/run/test targets
├── frontend/
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Route/page components
│ │ ├── services/ # API client calls
│ │ ├── contexts/ # React context state
│ │ ├── styles/ # SCSS/CSS modules
│ │ ├── types/ # TS models/types
│ │ └── utils/ # UI helpers
│ ├── public/ # Public assets
│ └── htmls/ # Legacy/static map HTML assets
├── deploy/
│ ├── config/ # Example configuration files
│ └── docker/
│ ├── conf/
│ └── dockerfiles/ # Dev Dockerfiles for api/map/frontend
├── docker-compose-dev.yml # Dev services (api, map, postgres, redis)
├── Makefile # Root convenience targets
└── ARCHITECTURE.md # Deeper architecture notes
- Copy environment defaults:
cp .env.example .env- Start backend services:
docker compose -f docker-compose-dev.yml up --build- Start frontend (separate terminal):
cd frontend
npm install
npm run dev- Open:
- Frontend:
http://localhost:3000 - API:
http://localhost:8081 - Map service:
http://localhost:8082
Start only DB/Redis with Docker:
make up-backendRun services locally:
# API
cd backend
make run_api
# Map service
cd backend
make run_map
# Frontend
cd frontend
npm install
npm run devRoot Makefile:
make docker_dev_buildbuild dev imagesmake docker_dev_uprun compose stackmake docker_dev_downstop compose stackmake docker_dev_logs_apitail API logsmake docker_dev_logs_maptail map logs
Backend Makefile (backend/):
make buildbuild API + map binariesmake run_apirun API withgo runmake run_maprun map service withgo runmake testrun backend package tests
Frontend (frontend/):
npm run devstart Vite dev servernpm run buildproduction buildnpm run lintlint TS/React code
Primary development variables are in .env (see .env.example), including:
- Toolchain/image versions (
GOLANG_VERSION,NODE_VERSION) - Database credentials/ports
- Redis settings
- Bootstrap admin credentials
- Map UUID (
MAP_UUID)
Backend also supports CLI flags and YAML configuration (example: deploy/config/mapctf.example.yaml).
- ARCHITECTURE.md deeper dives into design decisions, data models, and service interactions.
GPL-3.0. See LICENSE.
