How webclub-nitk/atlas works
Main Components
• Frontend Client:
• Represented by the “frontend” folder. It includes React components, layouts, pages (both public and admin/user), API service modules, and a Vite configuration.
• This part handles user interactions, rendering challenges, authentication pages, and admin interfaces.
• Backend Application:
• Inside the “backend” directory, notice two sub-folders. One contains the Django app (atlas_backend) that defines models, views, serializers, and migrations. The other contains project-level settings (Django’s settings, asgi, wsgi).
• This is responsible for business logic, REST APIs, authentication, and challenge management.
• Database:
• While not explicitly defined in the file tree, the README and environment variables (DB_USER, DB_PASSWORD, DB_NAME) indicate the use of a relational database (likely PostgreSQL) that stores persistent data (users, challenges, teams, etc.).
• Docker Orchestration / Challenge Containers:
• The project uses Docker for running both the backend and the frontend. Additionally, files like “challenge.Dockerfile”, “docker-compose.yml”, and “docker_plugin.py” indicate there’s dynamic management of separate challenge environments inside containers.
• This component manages spinning up and tearing down containers that host individual CTF challenges.
Relationships and Interactions
• The Frontend communicates with the Backend via HTTP API calls (see all the API modules inside “frontend/src/api”).
• The Backend interacts with the Database (via Django ORM) to retrieve and store data such as challenges, user profiles, scores, etc.
• When a challenge is triggered or needs to run, the Backend leverages Docker APIs (as suggested by docker_plugin.py and assorted Dockerfiles) to orchestrate challenge containers.
• An admin route in the Frontend is available to manage challenges, teams, and users, interfacing with the backend’s admin panel.
Architectural Patterns and Principles
• Separation of Concerns:
• Clear splitting between frontend and backend services.
• MVC (or similar) in the Backend:
• Django’s organization in “atlas_backend” (models, views, serializers) indicates a classic separation of controllers, views, and models.
• Containerization:
• Extensive use of Docker for deployment, local development (with docker-compose) and dynamic container management for challenge execution.
• API-Driven Communication:
• The frontend uses a well-organized API layer (e.g., admin.js, auth.js, challenges.js, etc.) to communicate with the backend services.
Incorporate Relevant Technologies and Tools
• Frontend: React, Vite, TailwindCSS, and possibly ESLint for code quality.
• Backend: Django (with RESTful APIs), Docker for container orchestration, and PostgreSQL (or another relational DB as suggested by the env variables).
• Docker & Deployment: Dockerfiles, docker-compose, and scripts like “entrypoint.sh” to manage service startup.
• Additional Libraries: Provided coding style guidelines denote Python docstrings and comments, meaning code documentation is an important part of the implementation.