XploitVerse is an advanced, cybersecurity-themed educational platform. It provides an immersive, real-world terminal and lab-based environment where students can master cybersecurity techniques through practical application.
- Interactive Training Labs: On-demand Dockerized lab environments that isolate interactive learning exercises.
- Cybersecurity Terminal Interface: A premium "green-on-black" glassmorphism design system inspired by professional hacking terminals.
- Real-Time Execution: WebSockets provide instantaneous terminal output and interaction directly in the browser.
- Role-Based Access Control: Differentiated dashboards and capabilities for Students, Instructors, and Administrators.
- Language: Go 1.25+
- Framework: Gin (HTTP Web Framework)
- Database: MongoDB (via official Go driver)
- Caching & Pub/Sub: Redis
- Real-Time Communication: Gorilla WebSockets
- Containerization: Docker (dynamic container provisioning for labs)
- Authentication: JWT (JSON Web Tokens)
- Framework: React 18.2
- Build Tool: Vite 5
- Routing: React Router DOM 6
- Styling: TailwindCSS 3.3 (Custom XploitVerse Dark Theme)
- State Management: React Context (
AuthContext) - HTTP/API Client: Axios
- Real-Time UI:
socket.io-client
Ensure you have the following installed before starting local development:
- Go 1.25 or higher
- Node.js 18 or higher (with
npm) - Docker and Docker Compose
- Git
git clone https://github.com/smwlc/xploitverse.git
cd xploitverseThe project ships with a docker-compose.yml that provisions MongoDB and Redis.
docker compose up -dYou can verify the containers are healthy with docker ps.
Navigate to the backend directory and install dependencies:
cd backend
go mod downloadCopy the example environment file and configure it:
cp .env.example .envStart the Go server:
# Depending on your main.go location, usually:
go run cmd/api/main.go
# Alternatively, if you have a pre-built binary:
# ./server.exeThe backend API will run on http://localhost:5000.
Open a new terminal session, navigate to the frontend directory, and install dependencies:
cd client
npm installStart the Vite development server:
npm run devOpen http://localhost:5173 in your browser to view the XploitVerse platform.
xploitverse/
├── backend/ # Go Backend Application
│ ├── cmd/ # Entry points (main.go)
│ ├── internal/ # Private application code (Handlers, Services, Repos)
│ ├── ws/ # WebSocket logic and connection managers
│ ├── .env.example # Template environment config
│ ├── go.mod # Go dependencies
│ └── server.exe # Compiled Windows binary (optional usage)
├── client/ # React Frontend Application
│ ├── src/
│ │ ├── components/ # Reusable UI (ui/, layout/, workspace/)
│ │ ├── context/ # React Context (AuthContext)
│ │ ├── pages/ # View components matching routes
│ │ ├── services/ # Axios API clients
│ │ ├── App.jsx # Root layout and Router
│ │ ├── main.jsx # React DOM mounting
│ │ └── index.css # Tailwind directives and custom UI classes
│ ├── tailwind.config.js # XploitVerse custom dark theme palette
│ └── vite.config.js # Vite bundler config
└── docker-compose.yml # Infrastructure (Mongo, Redis) definition
- Authentication: User logs in via the React frontend. Axios makes a
POSTrequest to/api/auth/login. - Backend Auth: The Gin Go router forwards the request to the auth handler. The user is verified against MongoDB, and a JWT is issued (often via HTTP-only cookie).
- Frontend State:
AuthContexthydrates the user session and selectively renders private routes like/dashboardbased on RBAC (Role-Based Access Control). - Lab Initialization: When a user launches a lab, a request is sent to the Go backend, which invokes Docker via the host daemon to spin up a new isolated container connected to the internal
xploitverse-labsnetwork. - Real-Time I/O: The frontend initiates a WebSocket connection (
socket.io-client). The Go backend bridges this WebSocket directly to the Docker container's TTY over thexploitverse-labsnetwork, providing instantaneous feedback.
| Variable | Description | Example |
|---|---|---|
PORT |
API Server Port | 5000 |
NODE_ENV |
Environment Type | development / production |
MONGODB_URI |
Mongo Connection String | mongodb://localhost:27017/xploitverse |
REDIS_URL |
Redis Connection String | redis://localhost:6379 |
JWT_SECRET |
Secret key for signing tokens | super-secret-key |
JWT_EXPIRES_IN |
Token Lifespan | 7d |
CLIENT_URL |
Frontend URL for CORS | http://localhost:5173 |
(Note: Additional AWS, LLM API, and SMTP variables can be set for Phase 2+ features).
| Command | Description |
|---|---|
npm run dev |
Starts Vite dev server with Hot Module Replacement |
npm run build |
Compiles and optimizes assets for production |
npm run preview |
Locally serves the production build |
npm run lint |
Runs ESLint against project files |
| Command | Description |
|---|---|
go run main.go |
Boots the development server |
go build -o server |
Compiles a production binary |
go test ./... |
Runs the test suite across all internal packages |
XploitVerse uses a stringent Cybersecurity Terminal aesthetic. When contributing to the frontend, abide by the following design system rules:
- Colors: Native components use
bg-gray-950orbg-gray-900for backgrounds. Interactive elements usegreen-500accents. Never use generic Tailwind palettes without consultingtailwind.config.js. - Components: Use global component classes defined in
index.css:.card-glass: Background-blurred layered panels for elevated UI..btn-primary,.btn-danger,.btn-ghost: Standardized button interactions..input-cyber: Branded inputs that glow green on focus.
- Typography: Always rely on the
Interstack for layout, and theJetBrains MonoorFira Codestack for terminal outputs and raw data visualization.
- Cause: The docker containers are either not running or failed to expose ports.
- Fix: Run
docker compose up -din the root directory. Usedocker logs xv-mongoto diagnose boot failures.
- Cause: The backend's
CLIENT_URLdoesn't match the Vite address. - Fix: Open
backend/.envand ensureCLIENT_URL=http://localhost:5173. Restart the Go server.
- Cause: The browser isn't sending the JWT cookie.
- Fix: Ensure your Axios configurations uniformly set
withCredentials: true.
- Cause: Container networking gap, or the Gin router closed the WS handshake due to invalid origins.
- Fix: Ensure the Gorilla WebSocket
CheckOriginconfiguration permits traffic fromhttp://localhost:5173.