A modern, cyberpunk-themed Capture the Flag platform built with Nuxt.js, featuring interactive challenges, real-time leaderboards, and comprehensive progress tracking.
- Cyberpunk UI: Immersive 3D background with Three.js and futuristic design
- Challenge System: 8 diverse CTF challenges including web exploitation, steganography, forensics, and cryptography
- User Management: Registration system with unique callsigns
- Progress Tracking: Real-time completion tracking with points and timing
- Leaderboard: Dynamic ranking system for competitive play
- Admin Panel: Administrative controls for managing users and completions
- Responsive Design: Optimized for desktop and mobile devices
- Frontend: Nuxt.js 4, Vue 3, TypeScript
- 3D Graphics: Three.js
- Backend: Nuxt Server API
- Database: PostgreSQL with Prisma ORM
- Styling: Custom CSS with cyberpunk theme
- Build Tool: Vite
- Node.js 18+
- PostgreSQL database
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/catmoreak/Capturetheflag.git cd Capturetheflag -
Install dependencies
npm install
-
Database Setup
- Create a PostgreSQL database
- Copy
.env.exampleto.envand configure your database URL:DATABASE_URL="postgresql://username:password@localhost:5432/ctf_db"
-
Initialize Database
npx prisma generate npx prisma db push
-
Start Development Server
npm run dev
The application will be available at
http://localhost:3000
├── app/
│ ├── pages/ # Vue pages (challenges, leaderboard, index)
│ └── components/ # Reusable Vue components
├── server/
│ └── api/ # Server API endpoints
│ ├── challenges/ # Challenge completion endpoints
│ ├── leaderboard/# Leaderboard data
│ ├── users/ # User registration and progress
│ └── admin/ # Administrative functions
├── prisma/
│ └── schema.prisma # Database schema
├── lib/
│ └── prisma.ts # Prisma client configuration
├── types/ # TypeScript type definitions
└── public/ # Static assets
The platform includes 8 CTF challenges:
- BASIC_RECON - Web reconnaissance basics
- CAESAR_DECRYPT - Classical cryptography
- WEB_EXPLOIT - Web security exploitation
- STEGANOGRAPHY - Hidden data extraction
- JS_OBFUSCATION - JavaScript reverse engineering
- FORENSICS_ANALYSIS - Digital forensics
- REVERSE_ENGINEERING - Binary reversing and analysis challenges
- NETWORK_PWN - Network/service exploitation and pwn-style tasks
POST /api/users/register- Register new userGET /api/users/progress- Get user progress
POST /api/challenges/complete- Submit challenge completion
GET /api/leaderboard- Get leaderboard data
GET /api/admin/users/[id]- User managementGET /api/admin/completions/[id]- Completion management
id: Unique identifiername: Unique callsigncreatedAt/updatedAt: Timestamps
id: Unique identifieruserId: Reference to userchallengeId: Challenge number (1-6)points: Points earnedcompletionTime: Time taken (seconds)completedAt: Completion timestamp
-
Build the application
npm run build
-
Preview production build
npm run preview
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run generate- Generate static site
npx prisma studio- Open Prisma Studionpx prisma db push- Push schema changes to databasenpx prisma generate- Generate Prisma client
The application uses a cyberpunk color scheme. Colors can be modified in the CSS variables within component files.
Add new challenges by:
- Updating the challenge list in the frontend
- Adding corresponding API logic
- Updating the database schema if needed
Points and timing calculations can be adjusted in the challenge completion API endpoint.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License