# ragulkpr29-star/hackthon-hub architecture

> Architecture diagram of the GitHub repository ragulkpr29-star/hackthon-hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ragulkpr29-star/hackthon-hub
- Repository: https://github.com/ragulkpr29-star/hackthon-hub

## Overview

#### Purpose and Runtime
Hackathon Hub is an AI-assisted student collaboration platform for discovering teammates, building profiles, and evaluating technical evidence. The primary runtime is a Next.js 16 App Router application; a separate Python/FastAPI service performs resume extraction. Supabase supplies Postgres, Auth, and Storage.

Paths: `app/layout.tsx`, `app/page.tsx`, `resume-analysis/app/main.py`

#### Route and UI Composition
Route groups separate unauthenticated account flows from authenticated product areas. Auth pages cover login, registration, and password recovery; the main shell hosts home, discovery, hackathons, profiles, messaging, teams, notifications, search, settings, and admin. The onboarding route is a distinct profile-completion flow with resume, photo, skills, availability, and social-link UI.

Paths: `app/(auth)/layout.tsx`, `app/(main)/layout.tsx`, `app/onboarding/page.tsx`

#### Identity, Persistence, and Access Boundary
Supabase client, server, admin, and middleware adapters form the application’s database/auth boundary. Repository classes encapsulate persistence for users, profiles, analyses, jobs, LinkedIn data, and developer vectors; service classes coordinate business workflows above them. Database evolution includes onboarding/profile schema and developer-vector support.

Paths: `lib/supabase/server.ts`, `lib/repositories/ProfileRepository.ts`, `supabase/migrations/002_developer_vector.sql`

#### Profile Onboarding and Evidence Ingestion
Onboarding accepts profile metadata plus uploaded resumes/photos and invokes an orchestration service. Storage access is abstracted behind `StorageService`; profile schema/types constrain submitted profile data. Resume analysis is requested through a versioned Next API proxy rather than called directly by the browser.

Paths: `lib/services/onboarding.service.ts`, `lib/storage/StorageService.ts`, `app/api/v1/analyze-resume/route.ts`

#### Resume ML Pipeline
The isolated FastAPI service accepts resume content, extracts text from PDFs, cleans/parses it, identifies skills with GLiNER, and semantically matches them against the skill taxonomy using Sentence-Transformers. It requires Python 3.10+, downloads Hugging Face models on first use, and is addressed by Next.js through `RESUME_ANALYSIS_URL`.

Paths: `resume-analysis/app/main.py`, `resume-analysis/app/service.py`, `resume-analysis/app/matcher.py`

#### AI and GitHub Analysis
GitHub analysis routes call a dedicated GitHub integration layer to retrieve repositories, README content, languages, metrics, and profile data, then analyze/summarize that evidence through AI providers. Gemini and OpenRouter adapters, prompts, scoring, and recommendations are separated from HTTP routes. Analysis results and long-running work are represented through analysis/job repositories and job-processing endpoints.

Paths: `app/api/github/analyze/route.ts`, `lib/github/analyzer.ts`, `lib/ai/gemini.ts`

#### Application APIs and Background-like Work
Next Route Handlers expose onboarding, GitHub analysis, personal analysis retrieval, and job status/processing endpoints. `analysis-runner.service` is the core workflow coordinator between API entry points, AI/GitHub services, and persistence. The design permits polling or externally triggered processing through job endpoints; no separate queue runtime is evident in the repository.

Paths: `app/api/jobs/process/route.ts`, `lib/services/analysis-runner.service.ts`, `lib/repositories/job.repository.ts`

Main entry points: [`lib/services/analysis-runner.service.ts`](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/services/analysis-runner.service.ts) (Analysis runner), [`lib/supabase/server.ts`](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/supabase/server.ts) (Supabase server adapter), [`app/onboarding/page.tsx`](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/onboarding/page.tsx) (Profile onboarding), [`lib/services/onboarding.service.ts`](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/services/onboarding.service.ts) (Onboarding workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Next.js Product"]
  node_public_app["Public app entry<br/>Next.js route<br/>[page.tsx]"]
  node_auth_routes["Account flows<br/>auth route group<br/>[layout.tsx]"]
  node_main_shell["Authenticated product<br/>main route group<br/>[layout.tsx]"]
  node_onboarding_ui["Profile onboarding<br/>Next.js route<br/>[page.tsx]"]
  node_resume_proxy["Resume API proxy<br/>Next.js route handler<br/>[route.ts]"]
  node_onboarding_service["Onboarding workflow"]
end

subgraph group_data["Supabase Boundary"]
  node_storage_service["Storage abstraction<br/>storage service<br/>[StorageService.ts]"]
  node_supabase_adapter["Supabase server adapter<br/>database/auth adapter<br/>[server.ts]"]
  node_profile_repository["Profile repository"]
  node_developer_vector_schema[("Developer vector schema<br/>Postgres migration")]
end

subgraph group_resume["Resume Analysis Service"]
  node_resume_api{{"FastAPI resume service<br/>Python/FastAPI app<br/>[main.py]"}}
  node_resume_pipeline["Resume ML pipeline<br/>Python service<br/>[service.py]"]
  node_skill_matcher["Skill taxonomy matcher<br/>Sentence-Transformers matcher<br/>[matcher.py]"]
end

subgraph group_evidence["Technical Evidence Analysis"]
  node_github_api["GitHub analysis API<br/>Next.js route handler<br/>[route.ts]"]
  node_job_processor_api["Job processing API<br/>Next.js route handler<br/>[route.ts]"]
  node_analysis_runner["Analysis runner<br/>workflow service"]
  node_github_analyzer["GitHub integration<br/>integration service<br/>[analyzer.ts]"]
  node_gemini_adapter["Gemini AI adapter<br/>AI provider adapter<br/>[gemini.ts]"]
  node_job_repository["Job repository<br/>[job.repository.ts]"]
end

node_public_app -->|"unauthenticated access"| node_auth_routes
node_auth_routes -->|"authenticated session"| node_main_shell
node_main_shell -->|"profile completion"| node_onboarding_ui
node_onboarding_ui -->|"submits profile"| node_onboarding_service
node_onboarding_service -->|"uploads files"| node_storage_service
node_storage_service -->|"uses storage"| node_supabase_adapter
node_onboarding_service -->|"persists profile"| node_profile_repository
node_profile_repository -->|"uses Postgres"| node_supabase_adapter
node_supabase_adapter -.->|"database schema"| node_developer_vector_schema
node_onboarding_ui -->|"requests analysis"| node_resume_proxy
node_resume_proxy -->|"RESUME_ANALYSIS_URL"| node_resume_api
node_resume_api -->|"runs pipeline"| node_resume_pipeline
node_resume_pipeline -->|"semantic matches"| node_skill_matcher
node_github_api -->|"starts analysis"| node_analysis_runner
node_job_processor_api -->|"processes jobs"| node_analysis_runner
node_analysis_runner -->|"collects evidence"| node_github_analyzer
node_analysis_runner -->|"analyzes evidence"| node_gemini_adapter
node_analysis_runner -->|"updates job state"| node_job_repository
node_job_repository -->|"uses Postgres"| node_supabase_adapter

click node_public_app "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/page.tsx"
click node_auth_routes "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/(auth)/layout.tsx"
click node_main_shell "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/(main)/layout.tsx"
click node_onboarding_ui "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/onboarding/page.tsx"
click node_resume_proxy "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/api/v1/analyze-resume/route.ts"
click node_github_api "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/api/github/analyze/route.ts"
click node_job_processor_api "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/api/jobs/process/route.ts"
click node_onboarding_service "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/services/onboarding.service.ts"
click node_storage_service "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/storage/StorageService.ts"
click node_supabase_adapter "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/supabase/server.ts"
click node_profile_repository "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/repositories/ProfileRepository.ts"
click node_developer_vector_schema "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/supabase/migrations/002_developer_vector.sql"
click node_resume_api "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/resume-analysis/app/main.py"
click node_resume_pipeline "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/resume-analysis/app/service.py"
click node_skill_matcher "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/resume-analysis/app/matcher.py"
click node_analysis_runner "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/services/analysis-runner.service.ts"
click node_github_analyzer "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/github/analyzer.ts"
click node_gemini_adapter "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/ai/gemini.ts"
click node_job_repository "https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/repositories/job.repository.ts"

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_public_app,node_auth_routes,node_main_shell,node_onboarding_ui,node_resume_proxy,node_onboarding_service toneBlue
class node_storage_service,node_supabase_adapter,node_profile_repository,node_developer_vector_schema toneAmber
class node_resume_api,node_resume_pipeline,node_skill_matcher toneMint
class node_github_api,node_job_processor_api,node_analysis_runner,node_github_analyzer,node_gemini_adapter,node_job_repository toneRose
```

## Components

### Next.js Product

App Router UI and route handlers.

- [Public app entry](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/page.tsx): Next.js route · `app/page.tsx`
- [Account flows](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/(auth)/layout.tsx): auth route group · Login, registration, and recovery screens. · `app/(auth)/layout.tsx`
- [Authenticated product](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/(main)/layout.tsx): main route group · Home, discovery, profiles, teams, messaging, and admin areas. · `app/(main)/layout.tsx`
- [Profile onboarding](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/onboarding/page.tsx): Next.js route · Collects profile details, resume, photo, skills, and links. · `app/onboarding/page.tsx`
- [Resume API proxy](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/api/v1/analyze-resume/route.ts): Next.js route handler · Versioned browser-facing resume analysis endpoint. · `app/api/v1/analyze-resume/route.ts`
- [Onboarding workflow](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/services/onboarding.service.ts): service · Coordinates profile submission and evidence ingestion. · `lib/services/onboarding.service.ts`

### Supabase Boundary

Identity, persistence, and file storage.

- [Storage abstraction](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/storage/StorageService.ts): storage service · Handles resume and photo uploads. · `lib/storage/StorageService.ts`
- [Supabase server adapter](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/supabase/server.ts): database/auth adapter · Application boundary for Supabase server access. · `lib/supabase/server.ts`
- [Profile repository](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/repositories/ProfileRepository.ts): repository · Encapsulates profile persistence. · `lib/repositories/ProfileRepository.ts`
- [Developer vector schema](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/supabase/migrations/002_developer_vector.sql): Postgres migration · Schema support for developer-vector matching. · `supabase/migrations/002_developer_vector.sql`

### Resume Analysis Service

Separate Python/FastAPI runtime.

- [FastAPI resume service](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/resume-analysis/app/main.py): Python/FastAPI app · Accepts resume content for extraction and skill analysis. · `resume-analysis/app/main.py`
- [Resume ML pipeline](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/resume-analysis/app/service.py): Python service · PDF extraction, parsing, GLiNER skills, and semantic taxonomy matching. · `resume-analysis/app/service.py`
- [Skill taxonomy matcher](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/resume-analysis/app/matcher.py): Sentence-Transformers matcher · `resume-analysis/app/matcher.py`

### Technical Evidence Analysis

GitHub, AI, and job workflows.

- [GitHub analysis API](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/api/github/analyze/route.ts): Next.js route handler · `app/api/github/analyze/route.ts`
- [Job processing API](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/app/api/jobs/process/route.ts): Next.js route handler · Supports polling or external processing triggers. · `app/api/jobs/process/route.ts`
- [Analysis runner](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/services/analysis-runner.service.ts): workflow service · Coordinates GitHub/AI analysis and durable job results. · `lib/services/analysis-runner.service.ts`
- [GitHub integration](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/github/analyzer.ts): integration service · Retrieves repositories, READMEs, languages, metrics, and profile evidence. · `lib/github/analyzer.ts`
- [Gemini AI adapter](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/ai/gemini.ts): AI provider adapter · Produces evidence analysis, scoring, and recommendations. · `lib/ai/gemini.ts`
- [Job repository](https://github.com/ragulkpr29-star/hackthon-hub/blob/master/lib/repositories/job.repository.ts): repository · Persists long-running analysis job state. · `lib/repositories/job.repository.ts`

## Connections

- Public app entry → Account flows: unauthenticated access
- Account flows → Authenticated product: authenticated session
- Authenticated product → Profile onboarding: profile completion
- Profile onboarding → Onboarding workflow: submits profile
- Onboarding workflow → Storage abstraction: uploads files
- Storage abstraction → Supabase server adapter: uses storage
- Onboarding workflow → Profile repository: persists profile
- Profile repository → Supabase server adapter: uses Postgres
- Supabase server adapter → Developer vector schema: database schema
- Profile onboarding → Resume API proxy: requests analysis
- Resume API proxy → FastAPI resume service: RESUME_ANALYSIS_URL
- FastAPI resume service → Resume ML pipeline: runs pipeline
- Resume ML pipeline → Skill taxonomy matcher: semantic matches
- GitHub analysis API → Analysis runner: starts analysis
- Job processing API → Analysis runner: processes jobs
- Analysis runner → GitHub integration: collects evidence
- Analysis runner → Gemini AI adapter: analyzes evidence
- Analysis runner → Job repository: updates job state
- Job repository → Supabase server adapter: uses Postgres
