# karippery/smartskill architecture

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

- Interactive diagram: https://gitdiagram.com/karippery/smartskill
- Repository: https://github.com/karippery/smartskill

## Overview

##### Project type and purpose
- This is a Docker-containerized, Django-based full-stack (back-end/API) application called **Smart-Skill**.
- It exposes a REST API (Django REST Framework + JWT), uses Celery for background tasks, Redis for caching/broker, and PostgreSQL as its primary datastore.
- Purpose: manage employee skills, track levels, match candidates to projects, provide secure access, and generate fake/test data.

##### File structure
- Top-level files:
- Dockerfile & docker-compose.yml (build & orchestrate containers)
- manage.py (Django CLI)
- requirements.txt, .flake8, .gitignore
- apps/ – five domain modules (experiences, projects, qualifications, skills, user), each with models, serializers, views, URLs, tests, and management commands to generate fake data.
- core/ – project settings, ASGI/WSGI entrypoints, Celery config, caching utilities, common helpers and exception classes, and site-wide management commands.
- doc/ – proposal, Postman collection, markdown art and images.

##### Insights from the README
- Tech stack: Python 3.10, Django 4.2, DRF, JWT, Celery, Redis, PostgreSQL, Docker, PgAdmin, Swagger/ReDoc.
- Features: JWT-secure login, CRUD APIs, schema & interactive docs, fake data generation, caching, async tasks, email via SendGrid/SMTP.
- Environment variables define DB, email, API version, secrets.

##### Diagramming conventions
- Containers (light blue)
- Datastores (light green)
- External services (light orange)

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Entities
    externalClients["Clients\n(Browsers, Postman, 3rd-party)"]:::external
    externalSMTP["SMTP/SendGrid"]:::external

    %% Docker Compose Layer
    subgraph "Docker Compose Network"
      direction TB
      reverseProxy["NGINX Reverse Proxy"]:::container
      web["Web App Container\n(Django API + Gunicorn/UVicorn + DRF + JWT)"]:::container
      worker["Celery Worker Container"]:::container
      redis["Redis Container"]:::datastore
      postgres["PostgreSQL Container"]:::datastore
      pgadmin["PgAdmin Container"]:::external
    end

    %% Django Application Components
    subgraph "Django Application"
      direction TB
      ASGI["ASGI Entry Point"]:::container
      WSGI["WSGI Entry Point"]:::container
      Settings["Settings (core/settings.py)"]:::container
      URLconf["URL Configuration (core/urls.py)"]:::container
      subgraph "Domain Apps"
        direction TB
        userApp["User App"]:::container
        skillsApp["Skills App"]:::container
        projectsApp["Projects App"]:::container
        experiencesApp["Experiences App"]:::container
        qualificationsApp["Qualifications App"]:::container
      end
      subgraph "Caching Utilities"
        direction TB
        caches["caches.py"]:::container
        decorators["decorators.py"]:::container
        cacheutils["utils.py"]:::container
      end
      celeryConf["Celery Config (core/celery.py)"]:::container
      mgmtCore["Create Fake Data Command"]:::container
    end

    %% Codebase Files
    subgraph "Codebase Files"
      direction TB
      dockerfile["Dockerfile"]:::container
      compose["docker-compose.yml"]:::container
      manage["manage.py"]:::container
      requirements["requirements.txt"]:::container
      flake[".flake8"]:::container
      postman["Postman Collection"]:::external
      proposal["Proposal Doc"]:::external
      art["Art Markdown"]:::external
    end

    %% Connections
    externalClients -->|HTTP/HTTPS| reverseProxy
    reverseProxy -->|Forward| web
    web -->|Serve Requests| ASGI
    ASGI -->|uses| URLconf
    URLconf -->|routes to| userApp
    URLconf -->|routes to| skillsApp
    URLconf -->|routes to| projectsApp
    URLconf -->|routes to| experiencesApp
    URLconf -->|routes to| qualificationsApp
    web -->|ORM| postgres
    web -->|Cache R/W| redis
    web -->|Task Enqueue| celeryConf
    celeryConf -->|Broker| redis
    celeryConf --> worker
    worker -->|Consume Tasks| redis
    worker -->|DB Operations| postgres
    worker -->|Send Emails| externalSMTP
    web -->|Send Emails| externalSMTP
    pgadmin -->|DB Admin| postgres
    externalClients -->|View Docs| web

    web --> ASGI
    web --> WSGI
    web --> Settings
    web --> URLconf
    web --> userApp
    web --> skillsApp
    web --> projectsApp
    web --> experiencesApp
    web --> qualificationsApp
    web --> caches
    web --> decorators
    web --> cacheutils
    web --> celeryConf
    web --> mgmtCore

    %% File links
    tplIDE[ ]

    %% Click Events
    click ASGI "https://github.com/karippery/smartskill/blob/main/core/asgi.py"
    click WSGI "https://github.com/karippery/smartskill/blob/main/core/wsgi.py"
    click Settings "https://github.com/karippery/smartskill/blob/main/core/settings.py"
    click URLconf "https://github.com/karippery/smartskill/blob/main/core/urls.py"
    click celeryConf "https://github.com/karippery/smartskill/blob/main/core/celery.py"
    click caches "https://github.com/karippery/smartskill/blob/main/core/cache/caches.py"
    click decorators "https://github.com/karippery/smartskill/blob/main/core/cache/decorators.py"
    click cacheutils "https://github.com/karippery/smartskill/blob/main/core/cache/utils.py"
    click mgmtCore "https://github.com/karippery/smartskill/blob/main/core/management/commands/create_fake_data.py"
    click userApp "https://github.com/karippery/smartskill/tree/main/apps/user"
    click skillsApp "https://github.com/karippery/smartskill/tree/main/apps/skills"
    click projectsApp "https://github.com/karippery/smartskill/tree/main/apps/projects"
    click experiencesApp "https://github.com/karippery/smartskill/tree/main/apps/experiences"
    click qualificationsApp "https://github.com/karippery/smartskill/tree/main/apps/qualifications"
    click dockerfile "https://github.com/karippery/smartskill/tree/main/Dockerfile"
    click compose "https://github.com/karippery/smartskill/blob/main/docker-compose.yml"
    click manage "https://github.com/karippery/smartskill/blob/main/manage.py"
    click requirements "https://github.com/karippery/smartskill/blob/main/requirements.txt"
    click flake "https://github.com/karippery/smartskill/blob/main/.flake8"
    click postman "https://github.com/karippery/smartskill/blob/main/doc/postman_collection/smartskill.postman_collection.json"
    click proposal "https://github.com/karippery/smartskill/blob/main/doc/Proposal for SmartSkill.docx"
    click art "https://github.com/karippery/smartskill/blob/main/doc/smartskill Art.md"

    %% Styles
    classDef container fill:#CFE2F3,stroke:#000;
    classDef datastore fill:#D9EAD3,stroke:#000;
    classDef external fill:#FCE5CD,stroke:#000;
```
