How namanshah01/qbag-backend works
Based on our analysis of the file structure and README file, this project is the backend for a full-stack Question Bank Generator application built with Django and Django REST Framework. It’s clearly structured around two core Django apps – one for authentication and another for managing questions – with a main project module (qbag_api) handling settings, routing, and integration of these apps.
Main Components
• Client (Frontend): Although this project is exclusively backend, the README points to a separate frontend. Represent “QBaG Frontend” as an external client that interacts with your backend via REST API calls.
• Django Server/Backend: A single server that hosts multiple apps.
• Authentication Module: Contains modules like models (authentication/models.py), views (authentication/views.py), serializers, and utilities. This module handles registration, login, email verification, token management (using Simple JWT), and password resets.
• Questions Module: Contains modules for question management such as question creation, retrieval, voting, and paper generation. It has its own models, views, serializers, and even migration scripts.
• Core Project Layer: The qbag_api directory houses the main Django configuration (settings.py), URL routing, middleware (if any), and WSGI/ASGI configurations that tie the apps together.
• Database: Although not directly visible in the file tree, Django projects typically interact with a database (through models in both Authentication and Questions apps). Represent this as the underlying central data store.
• Within the Django Server component, show two sub-components (Authentication and Questions) and illustrate that the main router (qbag_api/urls.py) delegates incoming API requests to either the authentication or questions app based on endpoint patterns.
Architectural Patterns/Design Principles
• Separation of Concerns: Each Django app (Authentication and Questions) is self-contained and follows the typical Model-View-Serializer (or MVC-like) pattern.
• Modular Design: Emphasize that the main project ties together multiple apps; each has its own directory with migrations and tests.
• RESTful API Design: Clearly indicate the API endpoints from the README for authentication (login, logout, token refresh, etc.) and for questions (create, retrieve, vote, etc.).