# shivamrawat1/techtonic architecture

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

- Interactive diagram: https://gitdiagram.com/shivamrawat1/techtonic
- Repository: https://github.com/shivamrawat1/techtonic

## Overview

##### Project type and purpose
- This is a full-stack Django web application for simulating both technical and behavioral interviews, providing structured feedback (STAR, UMPIRE) and candidate assessment.
- Key domains/modules: “users” (authentication, dashboard, landing pages), “interview_technical”, “interview_behavioral”, “assessments” (analysis & scoring).

##### File structure
- Top-level:
- manage.py, Dockerfile, cloudbuild.yaml, deploy.sh: orchestration and deployment
- capstone_django/: core Django settings, middleware, URL routing
- users/, interview_technical/, interview_behavioral/, assessments/: four Django apps
- staticfiles/: collected static assets
- node_modules/: front-end assets for any JS build
- Each app follows Django’s MVC/MVT: models.py, views.py, templates/, static/, services/ or utils.
- “openai_client.py”, “deepgram_service.py”, “gtts_service.py”: external AI/voice integrations.
- CI/CD: cloudbuild.yaml, crontab, Dockerfile, Procfile, start.sh indicate Docker/GCP/Heroku pipeline plus scheduled tasks.

##### README for additional insights
- Uses Python 3.12, pip, npm.
- Runs migrations, collects static files, then launches via Django’s runserver (but production likely through Docker + Gunicorn).
- Environment variables loaded from .env.local.

##### Elements
- Clear labels for: Browser, CDN, Load Balancer, Nginx, Gunicorn, Django apps (users, interview_technical, interview_behavioral, assessments), Database, External APIs, Scheduler, CI/CD
– HTTP(S) requests/responses
– Data flow between views → services → external APIs → models
– Build/deploy flow
– Another for core app layer (Django + Gunicorn)
– Another for persistence (Database)
– Another for external services (OpenAI, Deepgram, GTS)
– A different style for CI/CD pipeline

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User-Facing Layer
    Browser["Browser"]:::userlayer
    CDN["CDN / Static Host"]:::userlayer
    click CDN "https://github.com/shivamrawat1/techtonic/tree/master/staticfiles/"

    Browser -->|HTTP Request| CDN
    Browser -->|HTTP Request| LB

    %% Web & Orchestration
    subgraph "Web & Orchestration"
        LB["Load Balancer"]:::userlayer
        NGINX["Nginx Web Server"]:::userlayer
        GUNICORN["Gunicorn App Server"]:::applayer
        Dockerfile["Dockerfile"]:::userlayer
        Procfile["Procfile"]:::userlayer
        StartSh["start.sh"]:::userlayer
    end
    click Dockerfile "https://github.com/shivamrawat1/techtonic/tree/master/Dockerfile"
    click Procfile "https://github.com/shivamrawat1/techtonic/tree/master/Procfile"
    click StartSh "https://github.com/shivamrawat1/techtonic/blob/master/start.sh"

    LB -->|Forward| NGINX
    NGINX -->|Proxy| GUNICORN

    %% Application Core
    subgraph "Django Application Layer"
        Core["Django Core"]:::applayer
        Manage["manage.py"]:::applayer
        subgraph "Django Core Files"
            Settings["settings.py"]:::applayer
            Urls["urls.py"]:::applayer
            Middleware["middleware.py"]:::applayer
            Context["context_processors.py"]:::applayer
        end
    end
    click Settings "https://github.com/shivamrawat1/techtonic/blob/master/capstone_django/settings.py"
    click Urls "https://github.com/shivamrawat1/techtonic/blob/master/capstone_django/urls.py"
    click Middleware "https://github.com/shivamrawat1/techtonic/blob/master/capstone_django/middleware.py"
    click Context "https://github.com/shivamrawat1/techtonic/blob/master/capstone_django/context_processors.py"
    click Manage "https://github.com/shivamrawat1/techtonic/blob/master/manage.py"

    GUNICORN --> Core
    Core --> Settings
    Core --> Urls
    Core --> Middleware
    Core --> Context
    Core --> Manage

    %% Django Apps
    subgraph "Users App" 
        UApp["users/"]:::applayer
        UModels["models.py"]:::applayer
        UViews["views.py"]:::applayer
        UUrls["urls.py"]:::applayer
        UServices["services.py"]:::applayer
        UCleanup["cleanup_expired_codes.py"]:::applayer
        UCreate["create_user_profiles.py"]:::applayer
        UTemplates["templates/users/"]:::applayer
        UStatic["static/users/"]:::applayer
    end
    click UApp "https://github.com/shivamrawat1/techtonic/tree/master/users/"
    click UModels "https://github.com/shivamrawat1/techtonic/blob/master/users/models.py"
    click UViews "https://github.com/shivamrawat1/techtonic/blob/master/users/views.py"
    click UUrls "https://github.com/shivamrawat1/techtonic/blob/master/users/urls.py"
    click UServices "https://github.com/shivamrawat1/techtonic/blob/master/users/services.py"
    click UCleanup "https://github.com/shivamrawat1/techtonic/blob/master/users/management/commands/cleanup_expired_codes.py"
    click UCreate "https://github.com/shivamrawat1/techtonic/blob/master/users/management/commands/create_user_profiles.py"
    click UTemplates "https://github.com/shivamrawat1/techtonic/tree/master/users/templates/users/"
    click UStatic "https://github.com/shivamrawat1/techtonic/tree/master/users/static/users/"

    subgraph "Technical Interview App"
        TApp["interview_technical/"]:::applayer
        TModels["models.py"]:::applayer
        TViews["views.py"]:::applayer
        TUrls["urls.py"]:::applayer
        TOpenAI["openai_client.py"]:::ext
        TController["services/controller.py"]:::ext
        TDeepgram["services/deepgram_service.py"]:::ext
        TGtts["services/gtts_service.py"]:::ext
        TSrHandler["services/speech_recognition_handler.py"]:::ext
        TTemplates["templates/interview_technical/"]:::applayer
        TStatic["static/interview_technical/"]:::applayer
    end
    click TApp "https://github.com/shivamrawat1/techtonic/tree/master/interview_technical/"
    click TModels "https://github.com/shivamrawat1/techtonic/blob/master/interview_technical/models.py"
    click TViews "https://github.com/shivamrawat1/techtonic/blob/master/interview_technical/views.py"
    click TUrls "https://github.com/shivamrawat1/techtonic/blob/master/interview_technical/urls.py"
    click TOpenAI "https://github.com/shivamrawat1/techtonic/blob/master/interview_technical/openai_client.py"
    click TController "https://github.com/shivamrawat1/techtonic/blob/master/interview_technical/services/controller.py"
    click TDeepgram "https://github.com/shivamrawat1/techtonic/blob/master/interview_technical/services/deepgram_service.py"
    click TGtts "https://github.com/shivamrawat1/techtonic/blob/master/interview_technical/services/gtts_service.py"
    click TSrHandler "https://github.com/shivamrawat1/techtonic/blob/master/interview_technical/services/speech_recognition_handler.py"
    click TTemplates "https://github.com/shivamrawat1/techtonic/tree/master/interview_technical/templates/interview_technical/"
    click TStatic "https://github.com/shivamrawat1/techtonic/tree/master/interview_technical/static/interview_technical/"

    subgraph "Behavioral Interview App"
        BApp["interview_behavioral/"]:::applayer
        BModels["models.py"]:::applayer
        BViews["views.py"]:::applayer
        BUrls["urls.py"]:::applayer
        BOpenAI["openai_client.py"]:::ext
        BController["services/controller.py"]:::ext
        BDeepgram["services/deepgram_service.py"]:::ext
        BGtts["services/gtts_service.py"]:::ext
        BSrHandler["services/speech_recognition_handler.py"]:::ext
        BTemplates["templates/interview_behavioral/"]:::applayer
        BStatic["static/interview_behavioral/"]:::applayer
    end
    click BApp "https://github.com/shivamrawat1/techtonic/tree/master/interview_behavioral/"
    click BModels "https://github.com/shivamrawat1/techtonic/blob/master/interview_behavioral/models.py"
    click BViews "https://github.com/shivamrawat1/techtonic/blob/master/interview_behavioral/views.py"
    click BUrls "https://github.com/shivamrawat1/techtonic/blob/master/interview_behavioral/urls.py"
    click BOpenAI "https://github.com/shivamrawat1/techtonic/blob/master/interview_behavioral/openai_client.py"
    click BController "https://github.com/shivamrawat1/techtonic/blob/master/interview_behavioral/services/controller.py"
    click BDeepgram "https://github.com/shivamrawat1/techtonic/blob/master/interview_behavioral/services/deepgram_service.py"
    click BGtts "https://github.com/shivamrawat1/techtonic/blob/master/interview_behavioral/services/gtts_service.py"
    click BSrHandler "https://github.com/shivamrawat1/techtonic/blob/master/interview_behavioral/services/speech_recognition_handler.py"
    click BTemplates "https://github.com/shivamrawat1/techtonic/tree/master/interview_behavioral/templates/interview_behavioral/"
    click BStatic "https://github.com/shivamrawat1/techtonic/tree/master/interview_behavioral/static/interview_behavioral/"

    subgraph "Assessments App"
        AApp["assessments/"]:::applayer
        AAnalyzer["interview_analyzer.py"]:::ext
        AModels["models.py"]:::applayer
        AViews["views.py"]:::applayer
        AUrls["urls.py"]:::applayer
        ATemplates["templates/assessments/"]:::applayer
        AStatic["static/assessments/"]:::applayer
    end
    click AApp "https://github.com/shivamrawat1/techtonic/tree/master/assessments/"
    click AAnalyzer "https://github.com/shivamrawat1/techtonic/blob/master/assessments/interview_analyzer.py"
    click AModels "https://github.com/shivamrawat1/techtonic/blob/master/assessments/models.py"
    click AViews "https://github.com/shivamrawat1/techtonic/blob/master/assessments/views.py"
    click AUrls "https://github.com/shivamrawat1/techtonic/blob/master/assessments/urls.py"
    click ATemplates "https://github.com/shivamrawat1/techtonic/tree/master/assessments/templates/assessments/"
    click AStatic "https://github.com/shivamrawat1/techtonic/tree/master/assessments/static/assessments/"

    Core --> UApp
    Core --> TApp
    Core --> BApp
    Core --> AApp

    %% Persistence Layer
    DB[(Database)]:::dblocker
    Settings -->|DB Config| DB
    UApp -->|ORM| DB
    TApp -->|ORM| DB
    BApp -->|ORM| DB
    AApp -->|ORM| DB

    %% External AI/Voice Services
    subgraph "External AI/Voice Services"
        OpenAI["OpenAI API"]:::ext
        Deepgram["Deepgram API"]:::ext
        GTS["Google TTS API"]:::ext
    end
    TOpenAI --> OpenAI
    TDeepgram --> Deepgram
    TGtts --> GTS
    TSrHandler --> Deepgram
    BOpenAI --> OpenAI
    BDeepgram --> Deepgram
    BGtts --> GTS
    BSrHandler --> Deepgram
    AAnalyzer --> OpenAI

    %% Scheduled Tasks
    Scheduler["Scheduler / Cron"]:::ci
    Scheduler --> UCleanup
    Scheduler --> UCreate
    click Scheduler "https://github.com/shivamrawat1/techtonic/tree/master/crontab"

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        CloudBuild["cloudbuild.yaml"]:::ci
        DeploySh["deploy.sh"]:::ci
    end
    click CloudBuild "https://github.com/shivamrawat1/techtonic/blob/master/cloudbuild.yaml"
    click DeploySh "https://github.com/shivamrawat1/techtonic/blob/master/deploy.sh"

    CloudBuild -->|Build & Test| Dockerfile
    CloudBuild -->|Deploy| DeploySh

    %% Styles
    classDef userlayer fill:#AEDFF7,stroke:#333,stroke-width:1px;
    classDef applayer fill:#D5F5E3,stroke:#333,stroke-width:1px;
    classDef dblocker fill:#F9E79F,stroke:#333,stroke-width:1px;
    classDef ext fill:#FADBD8,stroke:#333,stroke-width:1px;
    classDef ci fill:#E8DAEF,stroke:#333,stroke-width:1px;
```
