# sohamhanse/careersync architecture

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

- Interactive diagram: https://gitdiagram.com/sohamhanse/careersync
- Repository: https://github.com/sohamhanse/careersync

## Overview

##### Project Type & Purpose
- CareerSync is a full-stack job and internship aggregator application.
- Its primary purpose is to collect job postings from various external platforms (via web scraping), process and display them on a modern, user-friendly interface, and eventually automate parts of the application process.
- The backend (Crawler) is responsible for scraping job listings from multiple websites, while the Frontend (built with React) presents the data to users and handles interactions (search, authentication, etc.).

##### File Structure
- Two main directories indicate separate concerns:
- Crawler: Contains Python modules and scripts (like json_api_server.py, enhanced_job_scraper.py) and submodules for different job platforms (LinkedIn, Indeed, Glassdoor, etc.) under "jobspy". This indicates a modular design for scraping various sources.
- Frontend: Contains a full React application structure with pages, components (including dedicated authentication, UI components, pages for job detail, search, dashboard, etc.), integration with Supabase, and configuration files (Vite, Tailwind, etc.).
- Additional configuration and build/deployment files (e.g., package.json, tsconfig.json, pyproject.toml) hint at modern development practices and potential continuous integration.

##### Key Components
a. Frontend:
- React App: Representing the UI layer with components such as Navbar, Hero, JobCard, Authentication forms, and pages (Dashboard, JobDetail, Search).
- Integration Layer: Show the Supabase integration and any API services (e.g., api.ts, external API calls) that the frontend uses.
b. Backend (Crawler):
- API Server: Highlight the json_api_server.py which exposes endpoints to deliver scraped job listings.
- Web Scraping Engine: Show modular scrapers grouped under “jobspy” (submodules for bayt, glassdoor, google, indeed, linkedin, naukri, and ziprecruiter). These modules feed the aggregated data.
- Utility Modules: Include supporting modules such as error_handling.py and job_intelligence.py which may be used for data analysis or refining scraped data.
c. External Services & Data Flow:
- Database: Even though there isn’t a direct folder for it in the repo, the README indicates usage of Firebase or MongoDB. Represent it as a central repository for storing or caching job data.
- Payment Gateway and Future AI Integration: Optionally note external services like Razorpay (for premium features) and AI modules (GPT / DeepSeek) for categorization and future automation features.

##### Highlighting Architectural Patterns & Design Principles
- Modular & Layered Architecture: Clearly break down the system into separate layers – the presentation layer (Frontend) and the data collection/processing layer (Backend).
- Clear Separation of Concerns: Emphasize that the frontend and backend are loosely coupled and communicate over defined API endpoints.

d. Database (MongoDB/Firebase) connected to the API Server if applicable.
e. In the Frontend section, layout major UI components and include an “API Integration Layer” that communicates with the API server.
g. Annotations for future modules such as "AI Application Automator" or payment gateway integrations.

## Diagram (Mermaid)

```mermaid
flowchart TD
    CS("CareerSync System"):::system

    subgraph "Frontend"
        FE_UI("UI Components"):::frontend
        FE_API("API Service"):::frontend
        FE_SUPA("Supabase Integration"):::frontend
        FE_App("React Frontend"):::frontend
    end

    subgraph "Backend"
        BE_Scrape("Web Scraping Engine\n(Modular scrapers: LinkedIn, Indeed, Glassdoor, Bayt, Naukri, ZipRecruiter)"):::backend
        BE_API("API Server\n(json_api_server.py)"):::backend
        BE_Util("Utility Modules\n(error_handling.py, job_intelligence.py)"):::backend
    end

    subgraph "External Systems"
        EXT("External Job Platforms"):::external
        DB("Database\n(MongoDB/Firebase)"):::external
        PAYMENT("Payment Gateway\n(Razorpay)"):::external
        AI("Future AI Module\n(GPT/DeepSeek)"):::external
    end

    CS --> FE_UI
    CS --> BE_Scrape
    CS --> EXT

    FE_UI -->|"calls"| FE_API
    FE_API -->|"rendersData"| FE_App
    FE_API -->|"apiCall"| BE_API
    FE_API --> FE_SUPA

    EXT -->|"jobPostings"| BE_Scrape
    BE_Scrape -->|"aggregatedData"| BE_API
    BE_API -->|"storesData"| DB
    BE_API -->|"premiumFeatures"| PAYMENT
    BE_API -->|"automation"| AI

    BE_Util --- BE_API

    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef backend fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef external fill:#FFB6C1,stroke:#000,stroke-width:1px;
    classDef system fill:#D3D3D3,stroke:#000,stroke-width:1px;

    click FE_App "https://github.com/sohamhanse/careersync/tree/main/Frontend/src"
    click FE_UI "https://github.com/sohamhanse/careersync/tree/main/Frontend/src/components"
    click FE_API "https://github.com/sohamhanse/careersync/blob/main/Frontend/src/services/api.ts"
    click FE_SUPA "https://github.com/sohamhanse/careersync/tree/main/Frontend/src/integrations/supabase"
    click BE_API "https://github.com/sohamhanse/careersync/blob/main/Crawler/json_api_server.py"
    click BE_Scrape "https://github.com/sohamhanse/careersync/blob/main/Crawler/enhanced_job_scraper.py"
    click BE_Util "https://github.com/sohamhanse/careersync/blob/main/Crawler/error_handling.py"
    click BE_Util "https://github.com/sohamhanse/careersync/blob/main/Crawler/job_intelligence.py"
```
