This repository hosts the API for a Capture The Flag (CTF) challenge. The API provides endpoints for user authentication, challenge management, and score tracking.
- User authentication (Register, validate, login and password management)
- Challenge management (create, update, delete challenges)
- Score tracking and leaderboard
- Node.js
- Express
- MongoDB
-
Clone the repository:
git clone https://github.com/IvanGranero/CTF-Challenge-API.git cd CTF-Challenge-API
-
Install the dependencies:
npm install
-
Set up the environment variables. Create a .env file in the project root and add the following:
PORT=5000 MONGODB_URI=mongodb://localhost:27017/ctf JWT_SECRET=your_jwt_secret
-
Start the MongoDB server:
mongod
- Run the Express application:
npm start
- The API will be available at http://localhost:4600/.
- POST
/api/login
: User login - POST
/api/register
: User registration
- POST
/api/submitkey
: Submit SSH key (authentication required)
- GET
/api/verify/:id/:token
: Verify email
Feel free to submit issues and pull requests. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License.