This guide provides step-by-step instructions for setting up the CTF Platform for local development.
- Node.js: Version 25.x (Recommended)
- Docker: For running MongoDB and challenge containers
- Git: For cloning repositories
The CTF Platform requires a dedicated Docker network for challenges to communicate securely.
docker network create ctf_ssrf_raceBefore starting the platform, you must build the challenge images.
-
Clone the Challenge Repository:
git clone https://github.com/sfeedbackx/ssrf-race.git cd ssrf-race -
Build Challenge Images:
# Build backend cd backend && docker build -t ctf_ssrf_race_backend . # Build frontend cd ../frontend && docker build -t ctf_ssrf_race_frontend .
Use Docker Compose to start essential services like MongoDB and the Docker access proxy.
-
Navigate to Backend:
cd ctf_platform/backend -
Configure Compose: Ensure
compose.yamlhas the ports exposed for development as needed. -
Start Services:
# From root or backend (until moved to root) docker compose up -d[!NOTE] For local development,
compose.yaml(currently inbackend/) starts the entire platform, including the Frontend asapp-frontend.
-
Environment Setup:
cp env.example .env
Note: The default
DB_URLinenv.exampleassumes you are running the backend on your host while MongoDB is in Docker. If running both in Docker, use themongodbservice name. -
Install & Migrate:
npm install npm run migrate # Seeds the database with CTF challenges -
Start Development Server:
npm run dev
-
Navigate to Frontend:
cd ../frontend -
Environment Setup:
cp env.example .env
-
Install & Start:
npm install npm run dev
The frontend will be available at
http://localhost:5173.
+------------------+ +------------------+
| User Browser | | Docker Daemon |
+--------+---------+ +--------+---------+
| |
| (HTTP/8080) | (Docker API)
v v
+------------------+ Internal +------------------+
| CTF Frontend | <----------> | CTF Backend |
| (Exposed) | Network | (Internal) |
+------------------+ (ctf_ssrf) +------------------+
^ ^
| |
+-------------+--------------+
|
+--------+---------+
| CTF Platform |
| Backend |
+------------------+
If the backend fails to connect to MongoDB, ensure the DB_URL in .env matches the credentials in compose.yaml. The default is mongodb://root:password@mongodb:27017/ctf_platform?authSource=admin.
Ensure the Docker daemon is running and the docker-socket-proxy container is active if you are using it.