# sidarragac/jobjourney architecture

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

- Interactive diagram: https://gitdiagram.com/sidarragac/jobjourney
- Repository: https://github.com/sidarragac/jobjourney

## Overview

##### Project Type and Purpose
- JobJourney is a full-stack web application built using Django. Its key purpose is to assist users in mapping out their career journey with the help of AI. The README explains that it integrates with OpenAI for AI capabilities and Google for OAuth authentication.
- The project is divided into several Django apps (accounts, admin, analytics, roadMap), which handle different aspects such as user registration and profiles (accounts), administrative tasks and analytics (admin, analytics), and career roadmaps (roadMap).

##### File Structure
- Top-level directories: You have distinct directories for each Django app (accounts, admin, analytics, roadMap) and a manage.py file in the root.
- Each app includes standard Django components: migrations, models, views, templates, static assets (e.g., JavaScript and CSS files). This separation implies adherence to the modular Django “app” structure.
- There are management commands provided in several apps (e.g., add_interests_db, add_socialMedias_db) which populate the database with initial data.
- Presence of configuration files (e.g., admin/settings.py) hints at centralized settings for the Django project.

##### README Insights
- The README clarifies that the project involves database migrations and seeding commands, OpenAI API integration for AI-driven functionalities, and Google OAuth for authentication.
- The installation instructions and environment configuration reveal dependencies such as the OpenAI API key and Google OAuth credentials.
- The project is oriented toward both frontend (client-side templates, JavaScript, CSS) and backend (Django apps, databases, API integrations) development.

a. Main Components:
- Web Client (Browser): Displays HTML views that originate from Django templates found in each app.
- Django Backend: The core server hosting apps (accounts, admin, analytics, roadMap) with clearly separated concerns:
- accounts app: Handles user authentication, registration, and profile management.
- admin app: Contains administrative interfaces, analytics, and custom functionalities like chart rendering and OpenAI integration.
- analytics app: Manages user or system analytics and exploration features.
- roadMap app: Facilitates the generation and display of personalized career roadmaps.
- Database: SQLite (created via migrations) which stores user data, interest registries, social media information, and other persistent data.
- External Services:
- OpenAI API: For AI-driven suggestions and career roadmap generation.
- Google OAuth: For handling user authentication and secure login.

b. Relationships and Interactions:
- The Web Client interacts with the Django server through HTTP/HTTPS requests. Requests are routed via Django’s URL configurations within each app.
- Django Views fetch data from the Database via ORM calls and render HTML responses based on the corresponding Templates and Static files.
- The Admin components interact with external services when needed (e.g., invoking the OpenAIManager in admin/ for AI functionalities).
- OAuth and external API calls are triggered during user authentication or when AI-based features are in use.

c. Architectural Patterns & Design Principles:
- Modular design: Each Django app is a self-contained module for a specific domain (accounts, analytics, etc.).
- MVC-like Pattern in Django: Models represent the database, Views handle application logic, and Templates are used for presentation.
- RESTful or AJAX interactions are likely implemented through JavaScript in the static assets for dynamic behavior on the client side.
- Separation of concerns: Clear separation between frontend (templates, JavaScripts, styles) and backend logic (views, models, management commands).

d. Relevant Technologies:
- Python / Django (Backend framework)
- SQLite (Database during development)
- HTML/CSS/JavaScript (Frontend presentation)
- OpenAI API integration (for AI functionalities)
- Google OAuth (for secure authentication)
- Django’s ORM and management commands for handling database seeding and migrations

## Diagram (Mermaid)

```mermaid
flowchart TD

  subgraph "Web Client (Presentation Layer)"
    AT["Accounts Templates"]:::frontend
    ADT["Admin Templates"]:::frontend
    ANT["Analytics Templates"]:::frontend
    RT["RoadMap Templates"]:::frontend
  end

  subgraph "Django Backend (Application Layer)"
    AMod["Accounts Module<br/>(User Auth & Profile)"]:::backend
    AdmMod["Admin Module<br/>(Admin Panel & OpenAI Integration)"]:::backend
    AnMod["Analytics Module<br/>(User/System Analytics)"]:::backend
    RMMod["RoadMap Module<br/>(Career Roadmaps)"]:::backend
    MSC["Add SocialMedias Command"]:::management
    MIC["Add Interests Command"]:::management
  end

  subgraph "Data Layer"
    DB["SQLite Database"]:::database
  end

  subgraph "External Services"
    OA["OpenAI API"]:::external
    GO["Google OAuth"]:::external
  end

  %% Connections from Web Client to Django Backend
  AT -->|"to"| AMod
  ADT -->|"to"| AdmMod
  ANT -->|"to"| AnMod
  RT -->|"to"| RMMod

  %% Connections from Django Backend modules to Database
  AMod -->|"ORM"| DB
  AdmMod -->|"ORM"| DB
  AnMod -->|"ORM"| DB
  RMMod -->|"ORM"| DB

  %% Management commands seeding the Database
  MSC -->|"seed"| DB
  MIC -->|"seed"| DB

  %% External service integrations
  AdmMod -->|"OpenAI"| OA
  AMod -->|"OAuth"| GO

  %% Click Events for Template Directories
  click AT "https://github.com/sidarragac/jobjourney/tree/main/accounts/templates"
  click ADT "https://github.com/sidarragac/jobjourney/tree/main/admin/templates"
  click ANT "https://github.com/sidarragac/jobjourney/tree/main/analytics/templates"
  click RT "https://github.com/sidarragac/jobjourney/tree/main/roadMap/templates"

  %% Click Events for Django Backend Modules
  click AMod "https://github.com/sidarragac/jobjourney/tree/main/accounts/"
  click AdmMod "https://github.com/sidarragac/jobjourney/tree/main/admin/"
  click AnMod "https://github.com/sidarragac/jobjourney/tree/main/analytics/"
  click RMMod "https://github.com/sidarragac/jobjourney/tree/main/roadMap/"

  %% Click Events for Management Commands
  click MSC "https://github.com/sidarragac/jobjourney/blob/main/accounts/management/commands/add_socialMedias_db.py"
  click MIC "https://github.com/sidarragac/jobjourney/blob/main/roadMap/management/commands/add_interests_db.py"

  %% Class definitions for styling
  classDef frontend fill:#D1E8FF,stroke:#0275d8,stroke-width:2px;
  classDef backend fill:#FFF3CD,stroke:#856404,stroke-width:2px;
  classDef database fill:#DFF0D8,stroke:#3c763d,stroke-width:2px;
  classDef external fill:#F2DEDE,stroke:#a94442,stroke-width:2px;
  classDef management fill:#E2E3E5,stroke:#6c757d,stroke-width:2px;
```
