# rajuljha/iitr-byte_club architecture

> Architecture diagram of the GitHub repository rajuljha/iitr-byte_club, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rajuljha/iitr-byte_club
- Repository: https://github.com/rajuljha/iitr-byte_club

## Overview

##### Main Components
- Web Client: Represents the browser interface that users interact with.
- Django Backend Server: The core server handling HTTP requests, templating (via Jinja2), routing, and rendering pages. This will include multiple Django apps (courses, eduai, home, users) which each serve specific purposes.
- ChatBot Service: A separate service responsible for handling chatbot interactions (found in the ‘BrainByte/chatbot’ directory). Although the README mentions Flask as part of the tech stack, note that the chatbot service is a distinct component that may run on a separate lightweight framework if needed.
- Database: The application uses an SQLite database (db.sqlite3) to store application data such as user profiles, course details, and learning paths.
- Static Content & Templates: Managed under the ‘static’ and ‘templates’ directories, which provide assets and front-end page layouts that are referenced by the Django apps.
- External Services: Such as the YouTube API (YOUTUBE_API_v3 key is required) and any third-party APIs tied to the generative AI or natural language processing aspects.

##### Relationships and Interactions
- The Web Client sends requests to the Django server.
- The Django server handles routing (via urls.py in each app) and interacts with its various applications (courses, eduai, home, users) to render appropriate views.
- The Django backend communicates with the SQLite database for CRUD operations.
- The ChatBot service, which may be triggered either through a dedicated URL route or from embedded widgets, interacts with the LLM backend to answer queries.
- External API calls (for YouTube content or AI functionalities) are initiated by either the Django backend or the ChatBot service, depending on the use case.

##### Architectural Patterns and Principles
- Use of Django’s MVC (or MTV – Model, Template, View) structure: Each Django app (courses, eduai, home, users) represents a module in the overall platform.
- Separation of Concerns: The chatbot functionality is isolated in its own module, which can be scaled independently from the main web application.
- Microservices/Modularization: Although not a fully distributed microservices suite, the separation of the chatbot and the modular app structure implies that clear boundaries exist between components.
- CI/CD Integration: GitHub workflows in the .github/workflows directory indicate automated testing, SBOM generation, and security scanning considerations.

##### Relevant Technologies
- Django: Core web backend framework.
- Flask (for the chatbot if applicable, or as a lighter companion): Indicates a choice to handle some interactions differently.
- Tailwind CSS: For styling the user interface.
- Jinja2: As the templating language.
- SQLite: The database engine for development (and possibly production, though it might be switched to another RDBMS later).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Web Client Subgraph
    subgraph "Web Client"
        WB["User Browser"]:::frontend
        Static["Static Assets"]:::frontend
        Templates["Templates"]:::frontend
    end

    %% Django Backend Subgraph
    subgraph "Django Backend"
        DS["Django Server"]:::backend
        Courses["Courses Module"]:::module
        EduAI["EduAI Module"]:::module
        Home["Home Module"]:::module
        Users["Users Module"]:::module
    end

    %% Other Components
    ChatBot["ChatBot Service"]:::service
    DB["SQLite Database"]:::database
    ExAPI["External APIs"]:::external
    CICD["CI/CD Pipelines"]:::ci

    %% Relationships
    WB -->|"sends request"| DS
    DS -->|"manages"| Courses
    DS -->|"manages"| EduAI
    DS -->|"manages"| Home
    DS -->|"manages"| Users
    DS -->|"performs CRUD"| DB
    DS -->|"calls"| ExAPI
    DS -->|"integrates with"| ChatBot
    ChatBot -->|"calls"| ExAPI
    CICD -->|"deploys"| DS
    CICD -->|"deploys"| ChatBot

    %% Click Events
    click Static "https://github.com/rajuljha/iitr-byte_club/tree/main/BrainByte/static"
    click Templates "https://github.com/rajuljha/iitr-byte_club/tree/main/BrainByte/templates"
    click DS "https://github.com/rajuljha/iitr-byte_club/tree/main/BrainByte/BrainByte"
    click Courses "https://github.com/rajuljha/iitr-byte_club/tree/main/BrainByte/courses"
    click EduAI "https://github.com/rajuljha/iitr-byte_club/tree/main/BrainByte/eduai"
    click Home "https://github.com/rajuljha/iitr-byte_club/tree/main/BrainByte/home"
    click Users "https://github.com/rajuljha/iitr-byte_club/tree/main/BrainByte/users"
    click ChatBot "https://github.com/rajuljha/iitr-byte_club/tree/main/BrainByte/chatbot"
    click DB "https://github.com/rajuljha/iitr-byte_club/blob/main/BrainByte/db.sqlite3"
    click CICD "https://github.com/rajuljha/iitr-byte_club/tree/main/.github/workflows"

    %% Styles
    classDef frontend fill:#a7d8ff,stroke:#1a73e8,stroke-width:2px;
    classDef backend fill:#ffadad,stroke:#ff4d4d,stroke-width:2px;
    classDef module fill:#ffe6a7,stroke:#e8aa1c,stroke-width:2px;
    classDef service fill:#caffbf,stroke:#4caf50,stroke-width:2px;
    classDef database fill:#cce5ff,stroke:#339af0,stroke-width:2px;
    classDef external fill:#ffc9de,stroke:#e63946,stroke-width:2px;
    classDef ci fill:#e0e0e0,stroke:#757575,stroke-width:2px;
```
