# ashutpandey/re101 architecture

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

- Interactive diagram: https://gitdiagram.com/ashutpandey/re101
- Repository: https://github.com/ashutpandey/re101

## Overview

1. **Overall shape**
   - This repository is a **React + Vite single-page application** for cybersecurity learning content, with a **Node/Express backend** and a **Supabase-backed data layer**.
   - The UI is the primary product, but the presence of `backend/`, `api/`, and Supabase scripts means the app is not purely static; it has a server/API boundary for data access and proxying.

2. **Frontend shell**
   - `src/main.jsx` boots the app, and `src/App.jsx` is the top-level composition/routing shell.
   - The frontend appears to be organized as a **page-based SPA** with four main views: roadmap, tools, community, and threat feed.

3. **Feature pages as separate domains**
   - `src/RoadmapPage.jsx` handles the learning progression experience.
   - `src/ToolsPage.jsx` owns the cybersecurity tools catalog and detail views.
   - `src/CommunityPage.jsx` aggregates experts, blogs, and community resources.
   - `src/ThreatFeedPage.jsx` represents the intelligence/feed surface.
   - These pages are largely independent functional areas, which is useful for drawing the UI as four peer subsystems under the app shell.

4. **Client-side data access**
   - `src/services/api.js` is the frontend’s API abstraction, acting as the boundary between the React pages and backend endpoints.
   - This suggests pages do not talk directly to external services; they likely go through a shared service layer for fetching content and keeping the UI decoupled from transport details.

5. **Backend service layer**
   - `backend/server.js` is the main Express server entry point.
   - `backend/routes/` contains feature-oriented route modules:
     - `blogs.js`
     - `communities.js`
     - `people.js`
     - `tools.js`
     - `proxy.js`
   - This indicates a **domain-based API structure** rather than a generic CRUD backend.

6. **Proxy boundary**
   - `backend/routes/proxy.js` is an important architectural clue: the backend is likely acting as a **safe intermediary for third-party or external content sources**.
   - In diagrams, this should be shown as the app server mediating requests to outside services rather than the browser calling them directly.

7. **Supabase as persistence/integration layer**
   - `backend/lib/supabase.js` centralizes Supabase client setup.
   - `backend/scripts/seed-supabase.js`, `backend/scripts/seed.js`, and `scripts/supabase-migration.sql` show that Supabase is used for structured content storage and initialization/migration.
   - The repo also includes `SUPABASE_SETUP.md`, reinforcing that Supabase is a first-class deployment dependency.

8. **Data model implied by routes**
   - The backend route split strongly suggests four primary content entities: **tools, people, blogs, and communities**.
   - The frontend pages map closely to those entities, so the architecture is content-driven: pages render curated datasets rather than deeply transactional workflows.

9. **Threat intel feed**
   - The threat feed page likely depends on either backend aggregation or external feed/proxying, not just static content.
   - Because the README emphasizes “real-time threat intelligence updates” and IOC sharing, this area is the most likely to involve external service calls and backend mediation.

10. **Deployment/runtime boundary**
   - `vercel.json` and `api/index.js` indicate support for **serverless deployment on Vercel**.
   - The repository therefore supports at least two runtime shapes:
     - local/standalone Express backend via `backend/server.js`
     - serverless API entry via `api/index.js`

11. **Build and frontend tooling**
   - `vite.config.js` shows the frontend build pipeline is Vite-based.
   - Root `package.json` and `package-lock.json` imply the main app is managed from the repo root, with a separate `backend/package.json` for server-side dependencies/runtime isolation.

12. **Operational scripts**
   - The `scripts/` directory contains deployment/fix utilities, including commit helpers and a Supabase migration script.
   - These are supporting automation rather than runtime components, but they matter for understanding how the data layer is maintained and updated.

13. **Key architectural boundary to diagram**
   - The most important diagram boundary is:
     - **React SPA in the browser**
     - **Backend API/proxy layer**
     - **Supabase/external data sources**
   - The pages are UI consumers; the backend is the content and integration gatekeeper.

14. **What is not present**
   - There is no evidence of user authentication, job queues, or complex state orchestration in the file tree.
   - The architecture is therefore centered on **curated content delivery, filtering, and detail presentation**, with modest server-side support for data access and integration.

Main entry points: [`api/index.js`](https://github.com/ashutpandey/re101/blob/main/api/index.js) (Vercel API), [`backend/server.js`](https://github.com/ashutpandey/re101/blob/main/backend/server.js) (Express server), [`backend/lib/supabase.js`](https://github.com/ashutpandey/re101/blob/main/backend/lib/supabase.js) (Supabase client), [`src/App.jsx`](https://github.com/ashutpandey/re101/blob/main/src/App.jsx) (App shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_src_main(("main.jsx<br/>entrypoint<br/>[main.jsx]"))
  node_src_app["App shell<br/>spa shell<br/>[App.jsx]"]
  node_roadmap_page["Roadmap<br/>page<br/>[RoadmapPage.jsx]"]
  node_tools_page["Tools<br/>page<br/>[ToolsPage.jsx]"]
  node_community_page["Community<br/>page<br/>[CommunityPage.jsx]"]
  node_threatfeed_page["Threat Feed<br/>page<br/>[ThreatFeedPage.jsx]"]
  node_client_api["API client<br/>[api.js]"]
end

subgraph group_backend["Backend"]
  node_api_entry(("Vercel API<br/>serverless entry<br/>[index.js]"))
  node_server(("Express server<br/>api server<br/>[server.js]"))
  node_routes_tools["Tools route<br/>route module<br/>[tools.js]"]
  node_routes_people["People route<br/>route module<br/>[people.js]"]
  node_routes_blogs["Blogs route<br/>route module<br/>[blogs.js]"]
  node_routes_communities["Communities route<br/>route module<br/>[communities.js]"]
  node_routes_proxy["Proxy route<br/>integration proxy<br/>[proxy.js]"]
end

subgraph group_data["Data Layer"]
  node_supabase_client[("Supabase client<br/>db client<br/>[supabase.js]")]
  node_supabase_migration["Migration SQL<br/>schema script"]
  node_supabase_seed["Seed scripts<br/>data seeding<br/>[seed-supabase.js]"]
end

subgraph group_ops["Ops"]
  node_vite_config["Vite config<br/>build config<br/>[vite.config.js]"]
  node_vercel_config["Vercel config<br/>deploy config<br/>[vercel.json]"]
end

node_src_main -->|"mounts"| node_src_app
node_src_app -->|"renders"| node_roadmap_page
node_src_app -->|"renders"| node_tools_page
node_src_app -->|"renders"| node_community_page
node_src_app -->|"renders"| node_threatfeed_page
node_roadmap_page -->|"fetches"| node_client_api
node_tools_page -->|"fetches"| node_client_api
node_community_page -->|"fetches"| node_client_api
node_threatfeed_page -->|"fetches"| node_client_api
node_client_api -->|"calls"| node_api_entry
node_client_api -->|"calls"| node_server
node_api_entry -->|"routes"| node_routes_tools
node_api_entry -->|"routes"| node_routes_people
node_api_entry -->|"routes"| node_routes_blogs
node_api_entry -->|"routes"| node_routes_communities
node_api_entry -->|"routes"| node_routes_proxy
node_server -->|"mounts"| node_routes_tools
node_server -->|"mounts"| node_routes_people
node_server -->|"mounts"| node_routes_blogs
node_server -->|"mounts"| node_routes_communities
node_server -->|"mounts"| node_routes_proxy
node_routes_tools -->|"reads/writes"| node_supabase_client
node_routes_people -->|"reads/writes"| node_supabase_client
node_routes_blogs -->|"reads/writes"| node_supabase_client
node_routes_communities -->|"reads/writes"| node_supabase_client
node_routes_proxy -.->|"uses"| node_supabase_client
node_supabase_seed -->|"initializes"| node_supabase_client
node_supabase_migration -->|"migrates"| node_supabase_client
node_vite_config -->|"builds"| node_src_main
node_vercel_config -->|"deploys"| node_api_entry
node_vercel_config -->|"serves"| node_src_app

click node_src_main "https://github.com/ashutpandey/re101/blob/main/src/main.jsx"
click node_src_app "https://github.com/ashutpandey/re101/blob/main/src/App.jsx"
click node_roadmap_page "https://github.com/ashutpandey/re101/blob/main/src/RoadmapPage.jsx"
click node_tools_page "https://github.com/ashutpandey/re101/blob/main/src/ToolsPage.jsx"
click node_community_page "https://github.com/ashutpandey/re101/blob/main/src/CommunityPage.jsx"
click node_threatfeed_page "https://github.com/ashutpandey/re101/blob/main/src/ThreatFeedPage.jsx"
click node_client_api "https://github.com/ashutpandey/re101/blob/main/src/services/api.js"
click node_api_entry "https://github.com/ashutpandey/re101/blob/main/api/index.js"
click node_server "https://github.com/ashutpandey/re101/blob/main/backend/server.js"
click node_routes_tools "https://github.com/ashutpandey/re101/blob/main/backend/routes/tools.js"
click node_routes_people "https://github.com/ashutpandey/re101/blob/main/backend/routes/people.js"
click node_routes_blogs "https://github.com/ashutpandey/re101/blob/main/backend/routes/blogs.js"
click node_routes_communities "https://github.com/ashutpandey/re101/blob/main/backend/routes/communities.js"
click node_routes_proxy "https://github.com/ashutpandey/re101/blob/main/backend/routes/proxy.js"
click node_supabase_client "https://github.com/ashutpandey/re101/blob/main/backend/lib/supabase.js"
click node_supabase_migration "https://github.com/ashutpandey/re101/blob/main/scripts/supabase-migration.sql"
click node_supabase_seed "https://github.com/ashutpandey/re101/blob/main/backend/scripts/seed-supabase.js"
click node_vite_config "https://github.com/ashutpandey/re101/blob/main/vite.config.js"
click node_vercel_config "https://github.com/ashutpandey/re101/blob/main/vercel.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_src_main,node_src_app,node_roadmap_page,node_tools_page,node_community_page,node_threatfeed_page,node_client_api toneBlue
class node_api_entry,node_server,node_routes_tools,node_routes_people,node_routes_blogs,node_routes_communities,node_routes_proxy toneAmber
class node_supabase_client,node_supabase_migration,node_supabase_seed toneMint
class node_vite_config,node_vercel_config toneRose
```

## Components

### Frontend

React/Vite SPA and page composition

- [main.jsx](https://github.com/ashutpandey/re101/blob/main/src/main.jsx): entrypoint · Bootstraps the React app · `src/main.jsx`
- [App shell](https://github.com/ashutpandey/re101/blob/main/src/App.jsx): spa shell · Top-level routing and composition · `src/App.jsx`
- [Roadmap](https://github.com/ashutpandey/re101/blob/main/src/RoadmapPage.jsx): page · Learning progression view · `src/RoadmapPage.jsx`
- [Tools](https://github.com/ashutpandey/re101/blob/main/src/ToolsPage.jsx): page · Tools catalog and details · `src/ToolsPage.jsx`
- [Community](https://github.com/ashutpandey/re101/blob/main/src/CommunityPage.jsx): page · Experts, blogs, and community resources · `src/CommunityPage.jsx`
- [Threat Feed](https://github.com/ashutpandey/re101/blob/main/src/ThreatFeedPage.jsx): page · Threat intelligence feed surface · `src/ThreatFeedPage.jsx`
- [API client](https://github.com/ashutpandey/re101/blob/main/src/services/api.js): service · Shared client-side request abstraction · `src/services/api.js`

### Backend

Express API and serverless entrypoints

- [Vercel API](https://github.com/ashutpandey/re101/blob/main/api/index.js): serverless entry · Serverless deployment entrypoint · `api/index.js`
- [Express server](https://github.com/ashutpandey/re101/blob/main/backend/server.js): api server · Main backend runtime entrypoint · `backend/server.js`
- [Tools route](https://github.com/ashutpandey/re101/blob/main/backend/routes/tools.js): route module · Tools API domain · `backend/routes/tools.js`
- [People route](https://github.com/ashutpandey/re101/blob/main/backend/routes/people.js): route module · People API domain · `backend/routes/people.js`
- [Blogs route](https://github.com/ashutpandey/re101/blob/main/backend/routes/blogs.js): route module · Blogs API domain · `backend/routes/blogs.js`
- [Communities route](https://github.com/ashutpandey/re101/blob/main/backend/routes/communities.js): route module · Communities API domain · `backend/routes/communities.js`
- [Proxy route](https://github.com/ashutpandey/re101/blob/main/backend/routes/proxy.js): integration proxy · Mediates external or third-party content access · `backend/routes/proxy.js`

### Data Layer

Supabase client and migrations/seeding

- [Supabase client](https://github.com/ashutpandey/re101/blob/main/backend/lib/supabase.js): db client · Central Supabase configuration · `backend/lib/supabase.js`
- [Migration SQL](https://github.com/ashutpandey/re101/blob/main/scripts/supabase-migration.sql): schema script · Supabase schema and data setup · `scripts/supabase-migration.sql`
- [Seed scripts](https://github.com/ashutpandey/re101/blob/main/backend/scripts/seed-supabase.js): data seeding · Populate Supabase with initial content · `backend/scripts/seed-supabase.js`

### Ops

Build and deployment support

- [Vite config](https://github.com/ashutpandey/re101/blob/main/vite.config.js): build config · Frontend build configuration · `vite.config.js`
- [Vercel config](https://github.com/ashutpandey/re101/blob/main/vercel.json): deploy config · Deployment and runtime routing config · `vercel.json`

## Connections

- main.jsx → App shell: mounts · Bootstraps the SPA shell
- App shell → Roadmap: renders · Primary feature page
- App shell → Tools: renders · Primary feature page
- App shell → Community: renders · Primary feature page
- App shell → Threat Feed: renders · Primary feature page
- Roadmap → API client: fetches · Loads structured content through shared API layer
- Tools → API client: fetches · Loads tools data through shared API layer
- Community → API client: fetches · Loads community/blog/person data through shared API layer
- Threat Feed → API client: fetches · Loads threat intelligence through shared API layer
- API client → Vercel API: calls · Browser requests serverless backend when deployed on Vercel
- API client → Express server: calls · Browser requests Express API in standalone runtime
- Vercel API → Tools route: routes · Domain endpoint
- Vercel API → People route: routes · Domain endpoint
- Vercel API → Blogs route: routes · Domain endpoint
- Vercel API → Communities route: routes · Domain endpoint
- Vercel API → Proxy route: routes · Integration boundary
- Express server → Tools route: mounts · Registers feature routes
- Express server → People route: mounts · Registers feature routes
- Express server → Blogs route: mounts · Registers feature routes
- Express server → Communities route: mounts · Registers feature routes
- Express server → Proxy route: mounts · Registers integration proxy
- Tools route → Supabase client: reads/writes · Persists or queries tools content
- People route → Supabase client: reads/writes · Persists or queries people data
- Blogs route → Supabase client: reads/writes · Persists or queries blog content
- Communities route → Supabase client: reads/writes · Persists or queries community data
- Proxy route → Supabase client: uses · May enrich or cache proxied data via shared client
- Seed scripts → Supabase client: initializes · Seeds structured content into Supabase
- Migration SQL → Supabase client: migrates · Defines database schema and setup
- Vite config → main.jsx: builds · Front-end bundling entry
- Vercel config → Vercel API: deploys · Serverless API runtime
- Vercel config → App shell: serves · SPA hosting and routing
