# rishi-gupta-data/smartscreen architecture

> Architecture diagram of the GitHub repository rishi-gupta-data/smartscreen, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rishi-gupta-data/smartscreen
- Repository: https://github.com/rishi-gupta-data/smartscreen

## Overview

##### Project Type and Purpose
- This is a full-stack web application: “SmartScreen ATS”
- Purpose: AI-powered Applicant Tracking System.
- React.js single-page frontend (frontend/)
- Flask REST API backend (backend/)
- ML/NLP engines for resume analysis
- Database for persistent storage
- External AI services (Gemini AI, Google Generative AI API)

##### File Structure
- Top level
- .devcontainer: VSCode dev-container config
- backend/: Flask app sources (app.py, backend.py, frontend.py) + environment (.env) + docs
- frontend/: Create-React-App structure (public/, src/, package.json)
- requirements.txt: Python dependencies (Flask, Pandas, scikit-learn, PDFMiner, AI SDKs)
- package.json / package-lock.json: Node/React dependencies (React, Tailwind CSS)
- Patterns and clues
- src/components in frontend: UI splits (HomePage, BulkAnalysis, IndividualAnalysis, ResumeAnalysis)
- services/api.js: HTTP client layer
- backend uses ATS_Project_Guide.md and details.md for domain logic

##### README for Architectural Insights
- User → React Frontend → Flask Backend API → Database + NLP/ML Models
- API endpoints: /api/analyze, /api/bulk-analyze, /api/formatting-suggestions, /api/keyword-optimization
- External integrations: PDFMiner for PDF parsing, Google/Gemini AI for advanced NLP

##### Final Recommendations
- Be as granular as practical: break the backend into controllers, services, and libraries.
- External dependencies (PDFMiner, AI APIs) separately so they’re not lost in the monolith.
- Database type (SQL/NoSQL)
- Authentication/authorization if applicable
- DevContainer or Docker build pipeline if infrastructure context is needed

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors
    User["End-User"]:::external

    %% Frontend Layer
    subgraph "Frontend (React SPA)"
        ReactFrontend["React Frontend"]:::ui
        IndexJS["Index Entry Point (src/index.js)"]:::ui
        HomePage["HomePage"]:::ui
        BulkAnalysis["BulkAnalysis"]:::ui
        IndividualAnalysis["IndividualAnalysis"]:::ui
        ResumeAnalysisPage["ResumeAnalysisPage"]:::ui
        APIClient["API Client (services/api.js)"]:::service
        IndexCSS["Global Styles (index.css)"]:::ui
        ThemeJS["Theme Config (theme.js)"]:::ui
        PublicAssets["Static Assets (public/)"]:::ui
    end

    %% Backend Layer
    subgraph "Backend (Flask API)"
        AppPy["Main App (app.py)"]:::service
        BackendPy["API Routes (backend.py)"]:::service
        FrontendPy["Static Serve (frontend.py)"]:::service
        EnvConfig["Environment Config (.env)"]:::infra
        AnalysisService["ResumeAnalysisService"]:::service
        NERModule["NER Module"]:::service
        CosineSim["Cosine Similarity"]:::service
        PDFParser["PDFMiner Parser"]:::external
        GoogleAI["Google Generative AI API"]:::external
        GeminiAI["Gemini AI SDK"]:::external
        Database["Database (PostgreSQL)"]:::data
        DetailsMD["Domain Details (details.md)"]:::service
        GuideMD["Project Guide (ATS_Project_Guide.md)"]:::service
        TnPMD["Training & Prompt Notes (TnP.MD)"]:::service
        Requirements["Python Dependencies (requirements.txt)"]:::infra
        LogFile["Logging (backend.log)"]:::infra
    end

    %% Dev Environment
    DevContainer["DevContainer Config (.devcontainer/)",]:::infra

    %% Connections
    User -->|"interacts with"| ReactFrontend
    ReactFrontend -->|"uses API client"| APIClient
    APIClient -->|"POST /api/*"| BackendPy
    BackendPy -->|"invokes"| AnalysisService
    AnalysisService -->|"calls"| NERModule
    AnalysisService -->|"calls"| CosineSim
    AnalysisService -->|"parses via"| PDFParser
    AnalysisService -->|"calls"| GoogleAI
    AnalysisService -->|"calls"| GeminiAI
    BackendPy -->|"CRUD operations"| Database
    BackendPy -->|"reads"| EnvConfig
    AppPy -->|"loads routes from"| BackendPy
    AppPy -->|"serves static via"| FrontendPy

    %% Documentation Links
    AnalysisService --> DetailsMD
    AnalysisService --> GuideMD
    AnalysisService --> TnPMD

    %% Dev and Logging
    AppPy --> LogFile
    DevContainer

    %% Click Events
    click ReactFrontend "https://github.com/rishi-gupta-data/smartscreen/tree/master/frontend/"
    click IndexJS "https://github.com/rishi-gupta-data/smartscreen/blob/master/frontend/src/index.js"
    click HomePage "https://github.com/rishi-gupta-data/smartscreen/blob/master/frontend/src/components/HomePage.js"
    click BulkAnalysis "https://github.com/rishi-gupta-data/smartscreen/blob/master/frontend/src/components/BulkAnalysis.js"
    click IndividualAnalysis "https://github.com/rishi-gupta-data/smartscreen/blob/master/frontend/src/components/IndividualAnalysis.js"
    click ResumeAnalysisPage "https://github.com/rishi-gupta-data/smartscreen/blob/master/frontend/src/components/ResumeAnalysis.js"
    click APIClient "https://github.com/rishi-gupta-data/smartscreen/blob/master/frontend/src/services/api.js"
    click IndexCSS "https://github.com/rishi-gupta-data/smartscreen/blob/master/frontend/src/index.css"
    click ThemeJS "https://github.com/rishi-gupta-data/smartscreen/blob/master/frontend/src/theme.js"
    click PublicAssets "https://github.com/rishi-gupta-data/smartscreen/tree/master/frontend/public/"
    click AppPy "https://github.com/rishi-gupta-data/smartscreen/blob/master/backend/app.py"
    click BackendPy "https://github.com/rishi-gupta-data/smartscreen/blob/master/backend/backend.py"
    click FrontendPy "https://github.com/rishi-gupta-data/smartscreen/blob/master/backend/frontend.py"
    click EnvConfig "https://github.com/rishi-gupta-data/smartscreen/blob/master/backend/.env"
    click DetailsMD "https://github.com/rishi-gupta-data/smartscreen/blob/master/backend/details.md"
    click GuideMD "https://github.com/rishi-gupta-data/smartscreen/blob/master/backend/ATS_Project_Guide.md"
    click TnPMD "https://github.com/rishi-gupta-data/smartscreen/blob/master/backend/TnP.MD"
    click Requirements "https://github.com/rishi-gupta-data/smartscreen/blob/master/requirements.txt"
    click LogFile "https://github.com/rishi-gupta-data/smartscreen/blob/master/backend/backend.log"
    click DevContainer "https://github.com/rishi-gupta-data/smartscreen/blob/master/.devcontainer/devcontainer.json"

    %% Styles
    classDef ui fill:#E0F7FA,stroke:#006064,color:#006064;
    classDef service fill:#E8F5E9,stroke:#2E7D32,color:#2E7D32;
    classDef data fill:#FFF3E0,stroke:#EF6C00,color:#EF6C00;
    classDef external fill:#F3E5F5,stroke:#6A1B9A,color:#6A1B9A;
    classDef infra fill:#ECEFF1,stroke:#546E7A,color:#546E7A;
    class User external
    class ReactFrontend,HomePage,BulkAnalysis,IndividualAnalysis,ResumeAnalysisPage,IndexJS,IndexCSS,ThemeJS,PublicAssets ui
    class APIClient,AppPy,BackendPy,FrontendPy,AnalysisService,NERModule,CosineSim service
    class Database data
    class PDFParser,GoogleAI,GeminiAI external
    class EnvConfig,Requirements,LogFile,DevContainer infra
```
