Skip to content

πŸ›‘οΈ An interactive game to practise secure Python coding by identifying vulnerable and safe functions.

License

Notifications You must be signed in to change notification settings

Radowan98/Secure-Code-Trainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Secure Code Trainer

Secure Code Trainer is an interactive Python + React game to practise secure coding.
You’ll be shown Python functions and must decide whether they are vulnerable or safe.
Earn points for correct answers, and if you're wrong, you'll learn why and see a secure version.


πŸš€ Quick Start

🧠 Step 1 β€” Start the Backend (FastAPI)

cd backend python3 -m venv venv source venv/bin/activate pip install -r requirements.txt python main.py

Backend will run at: http://localhost:8000


βš™οΈ Step 2 β€” Configure the Frontend (React)

cd ../frontend npm install cp .env.example .env

Update .env with the following line:

REACT_APP_API_URL=http://localhost:8000

🟒 Step 3 β€” Start the Frontend

npm start

Frontend will run at: http://localhost:3000


πŸ“‘ API Endpoints

Method Endpoint Description
GET / Health check
GET /game/question Get a random Python function
POST /game/answer Submit answer and receive feedback
GET /game/score Get current score for a nickname
GET /leaderboard Get top scores
POST /leaderboard/update Add or update a player's score

πŸ“„ License

This project is licensed under the MIT License.


Secure Code Trainer Demo

Feel free to collaborate and let's take it to the next level.

About

πŸ›‘οΈ An interactive game to practise secure Python coding by identifying vulnerable and safe functions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published