# secfathy/sectracker architecture

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

- Interactive diagram: https://gitdiagram.com/secfathy/sectracker
- Repository: https://github.com/secfathy/sectracker

## Overview

##### Project type and purpose
- SecTracker is a full‐stack, single‐page web application for bug bounty and security research management.
- The README and file tree show a React+TypeScript frontend built with Vite, Shadcn UI, TanStack Query, and a backend powered entirely by Supabase (Auth, PostgreSQL, real‐time, and serverless functions).

##### File structure
- Top‐level:
- src/ – all React application code (components, pages, hooks, integrations, lib)
- supabase/ – Supabase config and serverless functions (fetch‐rss‐feeds)
- database/ – SQL scripts for local PostgreSQL setup
- nginx.conf, Docker files, 1-click.sh – deployment automation
- config files: vite.config.ts, tsconfig*.json, tailwind.config.ts
- There is no custom express or REST server; the backend is outsourced to Supabase’s services and functions.
- The ‘integrations’ folder contains the Supabase client and types.

##### README for additional insights
- Architecture: Frontend SPA ↔ Supabase (Auth + PostgREST + real‐time) + serverless functions
- Tech stack: React, Vite, Supabase, PostgreSQL, tailwind, Shadcn UI

##### Detail without over‐complicating
- Avoid listing every single UI component; instead group them under “Shadcn UI + Custom Components.”

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        User["User"]:::external
        Browser["Browser"]:::frontend
        SPA["Frontend SPA"]:::frontend
        UI["Custom & Shadcn UI Components"]:::frontend
        Pages["Client-side Routing Pages"]:::frontend
    end

    %% BaaS Layer
    subgraph "BaaS Layer"
        direction TB
        Auth["Supabase Auth"]:::backend
        API["Supabase PostgREST API"]:::backend
        Realtime["Supabase Realtime"]:::backend
        DB["Supabase PostgreSQL DB"]:::backend
    end

    %% Integration Layer
    subgraph "Integration Layer"
        direction TB
        Functions["Supabase Functions (RSS Ingestion)"]:::backend
        RSS["External RSS Sources"]:::external
        LocalDB["Local PostgreSQL Instance"]:::backend
        InitScripts["Local DB Init Scripts"]:::backend
    end

    %% Deployment Layer
    subgraph "Deployment Layer"
        direction TB
        Docker["Docker Build"]:::deployment
        Nginx["Nginx"]:::deployment
        DeployCfg["Deployment & Config Files"]:::deployment
    end

    %% Data & Utils
    subgraph "Data & Utils"
        direction TB
        SupClient["Supabase Client & Types"]:::backend
        Hooks["TanStack Query Hooks"]:::frontend
        Lib["Utils & DB Abstractions"]:::backend
    end

    %% Relationships
    User -->|"interacts via"| Browser
    Browser -->|"loads SPA"| SPA
    SPA -->|"uses components"| UI
    SPA -->|"loads pages"| Pages
    SPA -->|"login/auth via HTTPS"| Auth
    SPA -->|"CRUD via HTTPS"| API
    SPA -->|"subscribe via WebSocket"| Realtime
    API -->|"queries"| DB
    Realtime -->|"updates from"| DB
    Functions -->|"writes data to"| DB
    RSS -->|"Cron/schedule"| Functions
    SPA -->|"fetch RSS via API"| API
    InitScripts -->|"seed data"| LocalDB
    LocalDB -->|"dev only"| SPA
    SPA -->|"build"| Docker
    Docker -->|"serve static"| Nginx
    Nginx -->|"hosts SPA"| Browser

    %% Integration Links
    SPA --> SupClient
    SPA --> Hooks
    SPA --> Lib

    %% Click Events
    click SPA "https://github.com/secfathy/sectracker/tree/main/src/"
    click UI "https://github.com/secfathy/sectracker/tree/main/src/components/"
    click UI "https://github.com/secfathy/sectracker/tree/main/src/components/ui/"
    click Pages "https://github.com/secfathy/sectracker/blob/main/src/pages/Index.tsx"
    click Pages "https://github.com/secfathy/sectracker/blob/main/src/pages/NotFound.tsx"
    click SupClient "https://github.com/secfathy/sectracker/blob/main/src/integrations/supabase/client.ts"
    click SupClient "https://github.com/secfathy/sectracker/blob/main/src/integrations/supabase/types.ts"
    click Hooks "https://github.com/secfathy/sectracker/blob/main/src/hooks/useRSSData.ts"
    click Hooks "https://github.com/secfathy/sectracker/blob/main/src/hooks/use-toast.ts"
    click Hooks "https://github.com/secfathy/sectracker/blob/main/src/hooks/use-mobile.tsx"
    click Lib "https://github.com/secfathy/sectracker/blob/main/src/lib/database.ts"
    click Lib "https://github.com/secfathy/sectracker/blob/main/src/lib/utils.ts"
    click Functions "https://github.com/secfathy/sectracker/blob/main/supabase/functions/fetch-rss-feeds/index.ts"
    click InitScripts "https://github.com/secfathy/sectracker/blob/main/database/init.sql"
    click InitScripts "https://github.com/secfathy/sectracker/blob/main/database/full_export.sql"
    click DeployCfg "https://github.com/secfathy/sectracker/blob/main/nginx.conf"
    click DeployCfg "https://github.com/secfathy/sectracker/blob/main/1-click.sh"
    click DeployCfg "https://github.com/secfathy/sectracker/blob/main/.dockerignore"
    click DeployCfg "https://github.com/secfathy/sectracker/blob/main/tailwind.config.ts"
    click DeployCfg "https://github.com/secfathy/sectracker/blob/main/vite.config.ts"
    click DeployCfg "https://github.com/secfathy/sectracker/blob/main/tsconfig.json"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,color:#004085
    classDef backend fill:#d4edda,stroke:#155724,color:#155724
    classDef external fill:#fff3cd,stroke:#856404,color:#856404
    classDef deployment fill:#e2e3e5,stroke:#6c757d,color:#6c757d
```
