# fahadshaik-coder/notely-notes-sharing-platform-with-ai architecture

> Architecture diagram of the GitHub repository fahadshaik-coder/notely-notes-sharing-platform-with-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai
- Repository: https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai

## Overview

Notely is a notes-sharing and AI study-assistance web app. The visible upload workflow authenticates a student, stores a note file in Supabase, and records its metadata in Firestore. The backend also accepts chat questions and uploaded-note URLs, prepares document text, and requests AI responses from Groq. The README is empty and most page code was not sampled, so links from the pages to scripts and API routes are left unverified rather than inferred.

Main entry points: [`upload.js`](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/upload.js) (Upload Handler), [`server.js`](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/server.js) (API Server), [`upload.html`](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/upload.html) (Upload Page), [`ai.html`](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/ai.html) (AI Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Student Web App"]
  node_home["Home Pages<br/>[home.html]"]
  node_login["Login Page<br/>[login.html]"]
  node_dashboard["Dashboard<br/>[dashboard.html]"]
  node_upload_page["Upload Page<br/>[upload.html]"]
  node_ai_page["AI Page<br/>[ai.html]"]
end

subgraph group_notes["Notes Upload"]
  node_upload_flow["Upload Handler<br/>[upload.js]"]
  node_firebase["Firebase App<br/>[firebase.js]"]
  node_supabase["Supabase Storage<br/>[supabase.js]"]
  node_firestore[("Firestore Notes<br/>[upload.js]")]
end

subgraph group_ai["AI Assistance"]
  node_server["API Server<br/>[server.js]"]
  node_context["Document Context<br/>[server.js]"]
  node_pdf_parser["PDF Extraction<br/>[server.js]"]
end

node_student(("Student"))
node_groq{{"Groq AI"}}
node_note_file["Stored Note File"]

node_student -.->|"opens"| node_home
node_student -.->|"opens"| node_login
node_student -.->|"opens"| node_dashboard
node_student -.->|"opens"| node_upload_page
node_student -.->|"opens"| node_ai_page
node_upload_page -.->|"uses"| node_upload_flow
node_upload_flow -->|"initializes"| node_firebase
node_upload_flow -->|"uploads files"| node_supabase
node_upload_flow -->|"writes metadata"| node_firestore
node_server -->|"extracts PDF text"| node_pdf_parser
node_server -->|"selects context"| node_context
node_server -->|"fetches URL"| node_note_file
node_server -->|"requests completion"| node_groq
node_ai_page -.->|"calls API"| node_server
node_upload_flow -->|"redirects when unauthenticated"| node_login

click node_home "https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/home.html"
click node_login "https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/login.html"
click node_dashboard "https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/dashboard.html"
click node_upload_page "https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/upload.html"
click node_ai_page "https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/ai.html"
click node_upload_flow "https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/upload.js"
click node_firebase "https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/firebase.js"
click node_supabase "https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/supabase.js"
click node_firestore "https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/upload.js"
click node_server "https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/server.js"
click node_context "https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/server.js"
click node_pdf_parser "https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/server.js"

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_home,node_login,node_dashboard,node_upload_page,node_ai_page toneBlue
class node_upload_flow,node_firebase,node_supabase,node_firestore toneAmber
class node_server,node_context,node_pdf_parser toneMint
class node_student,node_groq,node_note_file toneIndigo
```

## Components

### Student Web App

- [Home Pages](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/home.html): `home.html`
- [Login Page](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/login.html): `login.html`
- [Dashboard](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/dashboard.html): `dashboard.html`
- [Upload Page](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/upload.html): `upload.html`
- [AI Page](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/ai.html): `ai.html`

### Notes Upload

- [Upload Handler](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/upload.js): `upload.js`
- [Firebase App](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/firebase.js): `firebase.js`
- [Supabase Storage](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/supabase.js): `supabase.js`
- [Firestore Notes](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/upload.js): `upload.js`

### AI Assistance

- [API Server](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/server.js): `server.js`
- [Document Context](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/server.js): `server.js`
- [PDF Extraction](https://github.com/fahadshaik-coder/notely-notes-sharing-platform-with-ai/blob/main/server.js): `server.js`

### Other components

- **Student**
- **Groq AI**
- **Stored Note File**

## Connections

- Student → Home Pages: opens
- Student → Login Page: opens
- Student → Dashboard: opens
- Student → Upload Page: opens
- Student → AI Page: opens
- Upload Page → Upload Handler: uses
- Upload Handler → Firebase App: initializes (evidence: `upload.js`)
- Upload Handler → Supabase Storage: uploads files (evidence: `upload.js`)
- Upload Handler → Firestore Notes: writes metadata (evidence: `upload.js`)
- API Server → PDF Extraction: extracts PDF text (evidence: `server.js`)
- API Server → Document Context: selects context (evidence: `server.js`)
- API Server → Stored Note File: fetches URL (evidence: `server.js`)
- API Server → Groq AI: requests completion (evidence: `server.js`)
- AI Page → API Server: calls API
- Upload Handler → Login Page: redirects when unauthenticated (evidence: `upload.js`)
