A Capture The Flag (CTF) competition backend built with Express.js and Node.js. This application provides a comprehensive platform for hosting cybersecurity challenges, managing user authentication, tracking scores, and real-time updates through WebSocket connections.
This CTF backend serves as the foundation for cybersecurity competitions, providing:
- User Management: Registration, authentication, and profile management
- Challenge System: Multi-category cybersecurity challenges with dynamic scoring
- Admin Dashboard: Administrative controls for managing competitions, users, and challenges
- Real-time Features: Live scoreboards and notifications via WebSockets
- Secure Architecture: JWT-based authentication with role-based access control
- Node.js (v14 or higher)
- npm or yarn
- MongoDB (for database)
- Git
-
Clone the repository
git clone https://github.com/Pravith1/ctf_backend.git cd ctf_backend
-
Install dependencies
npm install
-
Environment Setup Create a
.env
file in the root directory:PORT=3000 MONGODB_URI=mongodb://localhost:27017/ctf_db JWT_SECRET=your_jwt_secret_key JWT_EXPIRE=24h NODE_ENV=development
-
Database Setup Ensure MongoDB is running on your system or provide a connection string to your MongoDB instance.
npm run dev
npm start
The server will start on http://localhost:3000
(or the port specified in your environment variables).
Swagger UI is available at: http://localhost:5000/api-docs
The CTF Backend includes comprehensive API documentation using Swagger/OpenAPI 3.0. You can:
- View all available endpoints
- Test API calls directly from the browser
- See request/response schemas
- Understand authentication requirements
- Interactive Docs: http://localhost:5000/api-docs
- JSON Spec: http://localhost:5000/api-docs.json
For detailed setup instructions, see SWAGGER_SETUP.md
This table outlines the current sprint's major development components and their responsible owners. Please check off your tasks as you complete them.
Task Component | Owner | Status |
---|---|---|
Authentication, Middleware | Saran,Mugilan | |
Admin Controller | Srimathi | |
Dummy asyncHandler, ApiResponse utilities and middleware have been added temporarily for testing the admin controller. These can be replaced with the official team versions later. |
| User Controller: Category Fetch,Question Fetch | Mugilan |
Note: To mark a task as complete, replace