A Flask-based registration platform for Open Day events, with:
- Multi-game registration
- CTF team flow (leader/member)
- CTF capacity limit (max 15 participants)
- Email invitation after successful registration (SMTP)
- Password-protected admin page
- CSV export for CTF registrations
app.py: Flask backend and routestemplates/index.html: Main landing and registration pagetemplates/email_invite.html: Invitation email templatetemplates/admin_log.html: Admin dashboard for CTF teamsstatic/js/main.js: Frontend logicstatic/css/style.css: Main page stylesstatic/css/email_invite.css: Email stylesinstance/database.db: SQLite database (generated at runtime)
- Python 3.9+
- Flask
Install dependencies:
pip install flaskCreate .env in project root:
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=your_email@example.com
SMTP_PASSWORD=your_app_password
SMTP_FROM_EMAIL=your_email@example.com
SMTP_USE_TLS=trueNotes:
- Use an app password for Gmail SMTP.
- Registration returns an error if confirmation email cannot be delivered.
python3 app.pyOpen in browser:
http://127.0.0.1:5000/
- Maximum total CTF participants: 15
- Team size: up to 3
- Team leader creates team name
- Team members join an existing team
- If limit is reached, users see:
تم الوصول إلى الحد الأقصى
Admin page:
/ayad/test/khenchela/dz/log
CSV export:
/ayad/test/khenchela/dz/log/export.csv
HTTP Basic Auth credentials:
- Username:
openday - Password:
opendayzoui404
GET /ctf-count: current CTF count and full statusGET /available-teams: available teams for joiningPOST /register: submit registration
idname(unique)leader_emailleader_first_nameleader_last_namecreated_at
idfirst_name,last_nameemail(unique)phone,majorgamesctf_modeteam_nameteam_idis_team_leadersuggestiontimestamp
Syntax check:
python3 -m py_compile app.pyCTF status check:
python3 - <<'PY'
from app import app
client = app.test_client()
print(client.get('/ctf-count').get_json())
PY