- Introduction
- Project Overview
- Technology Stack
- Project Setup and Development
- Backend Architecture and Pipeline
- Frontend Overview
- Deployment on Render
- Functionalities
- Database Models and Relationships
- Security Considerations
- Challenges and Solutions
- Conclusion
- References
- Contact Information
This project is a Capture The Flag (CTF) web application built using Django. It provides a platform for cybersecurity enthusiasts to participate in CTF challenges, submit flags, and track scores in real-time. The application supports two types of users: Admins and Participants.
- Admins can create and manage questions, flags, and participants.
- Participants can log in, attempt challenges by submitting flags, and view their scores.
- A live scoreboard displays participant rankings in real-time.
- Backend Framework: Django (Python)
- Frontend: Django Templates, HTML, CSS, JavaScript
- Database: Initially SQLite3, migrated to PostgreSQL
- Deployment Platform: Render.com
- Other Tools: Gunicorn, WhiteNoise, dj-database-url, python-dotenv
- Started with SQLite3 for rapid development.
- Migrated to PostgreSQL for production readiness.
- Models include
CTFQuestion
,Flag
, andParticipant
. - Views handle admin and participant functionalities.
- Session management and CSRF protection enabled.
- File uploads supported for challenge files.
- Models represent questions, flags, and participants with relationships.
- Admin views manage CRUD operations for challenges and users.
- Participant views handle login, flag submissions, and score tracking.
- Live scoreboard provides real-time rankings.
- Uses Django templates with custom CSS for styling.
- Responsive and user-friendly interfaces for admin and participants.
- Forms for login, adding/editing questions, flags, and participants.
- Dynamic live scoreboard updates.
- Hosted on Render.com with environment variables configured.
- Gunicorn used as WSGI server.
- WhiteNoise serves static files efficiently.
- Automatic migrations run on startup.
- Secure login and session management.
- Manage questions, flags, participants.
- Upload files for challenges.
- View participant scores.
- Secure login.
- View and attempt challenges.
- Track scores and progress.
- Download challenge files.
- Real-time participant rankings.
- Publicly accessible.
CTFQuestion
has manyFlag
s.Participant
has many solved questions.- Scores update dynamically on correct submissions.
- Passwords stored securely (recommend hashing for production).
- Session and CSRF protections enabled.
- Environment variables secure sensitive data.
- Allowed hosts configured.
- Database migration from SQLite3 to PostgreSQL.
- Secure file upload handling.
- Deployment configuration on Render.
- Full CRUD operations in admin portal.
This project demonstrates a full-stack Django application for CTF challenges, showcasing backend, frontend, and deployment skills. It is scalable and ready for further enhancements.
Your Name
Email: 23020700329@reva.edu.in
GitHub: https://github.com/Tanush-Jain
Below are the ER diagram and Mermaid code diagrams representing the database schema and relationships:
In Linux terminal how to run it : source venv/bin/activate
source venv/bin/activate && python3 manage.py runserver deactivate
Entities & Attributes:
ctf_participant
- id (PK)
- username
- score
- password
ctf_ctfquestion
- id (PK)
- question_text
- created_at
- points
- file
ctf_flag
- id (PK)
- flag_text
- question_id (FK to ctf_ctfquestion)
ctf_participant_solved_questions
- id (PK)
- participant_id (FK to ctf_participant)
- ctfquestion_id (FK to ctf_ctfquestion)
Thank you for exploring this project!