# bhumika864/revealx architecture

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

- Interactive diagram: https://gitdiagram.com/bhumika864/revealx
- Repository: https://github.com/bhumika864/revealx

## Overview

RevealX is a timed, passphrase-protected message application. A sender registers or signs in, creates a message encrypted in the browser, and schedules it for a reveal time; the recipient follows a public share link and decrypts the message with the passphrase. Senders can review their messages, and email can deliver the link and a reveal-ready notification. The graph reflects the sampled routing, encryption, persistence, and email code; page-to-API wiring and the reveal-checker implementation were not sampled, so those links are not expanded.

Main entry points: [`Invisi/frontend/src/App.js`](https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/App.js) (Routes and shell), [`Invisi/backend/server.js`](https://github.com/bhumika864/revealx/blob/main/Invisi/backend/server.js) (HTTP server), [`Invisi/backend/routes/notes.js`](https://github.com/bhumika864/revealx/blob/main/Invisi/backend/routes/notes.js) (Message endpoints), [`Invisi/backend/routes/auth.js`](https://github.com/bhumika864/revealx/blob/main/Invisi/backend/routes/auth.js) (Auth endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Routes and shell<br/>[App.js]"]
  node_auth_ui["Session context<br/>[AuthContext.js]"]
  node_protected["Protected pages<br/>[ProtectedRoute.js]"]
  node_register["Registration<br/>[Register.js]"]
  node_login["Sign in<br/>[Login.js]"]
  node_create["Create message<br/>[CreateNote.js]"]
  node_notes_list["My messages<br/>[YourNotes.js]"]
  node_note_view["Message details<br/>[ViewNote.js]"]
  node_reveal["Public reveal<br/>[RevealNote.js]"]
end

subgraph group_backend["API and access"]
  node_server["HTTP server<br/>[server.js]"]
  node_auth_routes["Auth endpoints<br/>[auth.js]"]
  node_auth_mw["Session verification<br/>[auth.js]"]
  node_user_model[("User records<br/>[User.js]")]
  node_db_config["Database connection<br/>[db.js]"]
end

subgraph group_messages["Timed messages"]
  node_crypto["Browser encryption<br/>[webcrypto.js]"]
  node_notes_routes["Message endpoints<br/>[notes.js]"]
  node_note_model[("Message records<br/>[Note.js]")]
  node_checker["Reveal scheduler<br/>[revealChecker.js]"]
end

subgraph group_integrations["External services"]
  node_email_service["Email delivery<br/>[emailService.js]"]
  node_mongo[("MongoDB")]
  node_smtp["Email provider"]
end

node_sender(("Sender"))
node_recipient(("Recipient"))

node_sender -->|"uses"| node_app
node_recipient -->|"opens link"| node_app
node_app -->|"provides session"| node_auth_ui
node_app -->|"guards routes"| node_protected
node_app -->|"routes"| node_register
node_app -->|"routes"| node_login
node_app -->|"routes"| node_create
node_app -->|"routes"| node_notes_list
node_app -->|"routes"| node_note_view
node_app -->|"routes"| node_reveal
node_auth_ui -->|"requests auth"| node_server
node_server -->|"dispatches"| node_auth_routes
node_server -->|"dispatches"| node_notes_routes
node_auth_routes -->|"protects session"| node_auth_mw
node_notes_routes -->|"protects endpoints"| node_auth_mw
node_auth_routes -->|"reads and creates"| node_user_model
node_auth_mw -->|"loads user"| node_user_model
node_notes_routes -->|"creates and queries"| node_note_model
node_db_config -->|"connects"| node_mongo
node_note_model -->|"persists"| node_mongo
node_user_model -->|"persists"| node_mongo
node_server -->|"starts polling"| node_checker
node_notes_routes -->|"sends share link"| node_email_service
node_email_service -.->|"sends email"| node_smtp
node_checker -.->|"sends ready notice"| node_email_service
node_sender -->|"encrypts message"| node_crypto
node_recipient -->|"decrypts message"| node_crypto

click node_app "https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/App.js"
click node_auth_ui "https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/context/AuthContext.js"
click node_protected "https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/components/ProtectedRoute.js"
click node_register "https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/Register.js"
click node_login "https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/Login.js"
click node_create "https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/CreateNote.js"
click node_notes_list "https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/YourNotes.js"
click node_note_view "https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/ViewNote.js"
click node_reveal "https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/RevealNote.js"
click node_crypto "https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/utils/webcrypto.js"
click node_server "https://github.com/bhumika864/revealx/blob/main/Invisi/backend/server.js"
click node_auth_routes "https://github.com/bhumika864/revealx/blob/main/Invisi/backend/routes/auth.js"
click node_auth_mw "https://github.com/bhumika864/revealx/blob/main/Invisi/backend/middleware/auth.js"
click node_notes_routes "https://github.com/bhumika864/revealx/blob/main/Invisi/backend/routes/notes.js"
click node_note_model "https://github.com/bhumika864/revealx/blob/main/Invisi/backend/models/Note.js"
click node_user_model "https://github.com/bhumika864/revealx/blob/main/Invisi/backend/models/User.js"
click node_db_config "https://github.com/bhumika864/revealx/blob/main/Invisi/backend/config/db.js"
click node_checker "https://github.com/bhumika864/revealx/blob/main/Invisi/backend/services/revealChecker.js"
click node_email_service "https://github.com/bhumika864/revealx/blob/main/Invisi/backend/services/emailService.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_app,node_auth_ui,node_protected,node_register,node_login,node_create,node_notes_list,node_note_view,node_reveal toneBlue
class node_server,node_auth_routes,node_auth_mw,node_user_model,node_db_config toneAmber
class node_crypto,node_notes_routes,node_note_model,node_checker toneMint
class node_email_service,node_mongo,node_smtp toneRose
class node_sender,node_recipient toneIndigo
```

## Components

### Web application

- [Routes and shell](https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/App.js): `Invisi/frontend/src/App.js`
- [Session context](https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/context/AuthContext.js): `Invisi/frontend/src/context/AuthContext.js`
- [Protected pages](https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/components/ProtectedRoute.js): `Invisi/frontend/src/components/ProtectedRoute.js`
- [Registration](https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/Register.js): `Invisi/frontend/src/Register.js`
- [Sign in](https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/Login.js): `Invisi/frontend/src/Login.js`
- [Create message](https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/CreateNote.js): `Invisi/frontend/src/CreateNote.js`
- [My messages](https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/YourNotes.js): `Invisi/frontend/src/YourNotes.js`
- [Message details](https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/ViewNote.js): `Invisi/frontend/src/ViewNote.js`
- [Public reveal](https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/RevealNote.js): `Invisi/frontend/src/RevealNote.js`

### API and access

- [HTTP server](https://github.com/bhumika864/revealx/blob/main/Invisi/backend/server.js): `Invisi/backend/server.js`
- [Auth endpoints](https://github.com/bhumika864/revealx/blob/main/Invisi/backend/routes/auth.js): `Invisi/backend/routes/auth.js`
- [Session verification](https://github.com/bhumika864/revealx/blob/main/Invisi/backend/middleware/auth.js): `Invisi/backend/middleware/auth.js`
- [User records](https://github.com/bhumika864/revealx/blob/main/Invisi/backend/models/User.js): `Invisi/backend/models/User.js`
- [Database connection](https://github.com/bhumika864/revealx/blob/main/Invisi/backend/config/db.js): `Invisi/backend/config/db.js`

### Timed messages

- [Browser encryption](https://github.com/bhumika864/revealx/blob/main/Invisi/frontend/src/utils/webcrypto.js): `Invisi/frontend/src/utils/webcrypto.js`
- [Message endpoints](https://github.com/bhumika864/revealx/blob/main/Invisi/backend/routes/notes.js): `Invisi/backend/routes/notes.js`
- [Message records](https://github.com/bhumika864/revealx/blob/main/Invisi/backend/models/Note.js): `Invisi/backend/models/Note.js`
- [Reveal scheduler](https://github.com/bhumika864/revealx/blob/main/Invisi/backend/services/revealChecker.js): `Invisi/backend/services/revealChecker.js`

### External services

- [Email delivery](https://github.com/bhumika864/revealx/blob/main/Invisi/backend/services/emailService.js): `Invisi/backend/services/emailService.js`
- **MongoDB**
- **Email provider**

### Other components

- **Sender**
- **Recipient**

## Connections

- Sender → Routes and shell: uses
- Recipient → Routes and shell: opens link
- Routes and shell → Session context: provides session
- Routes and shell → Protected pages: guards routes
- Routes and shell → Registration: routes
- Routes and shell → Sign in: routes
- Routes and shell → Create message: routes
- Routes and shell → My messages: routes
- Routes and shell → Message details: routes
- Routes and shell → Public reveal: routes
- Session context → HTTP server: requests auth
- HTTP server → Auth endpoints: dispatches
- HTTP server → Message endpoints: dispatches
- Auth endpoints → Session verification: protects session
- Message endpoints → Session verification: protects endpoints
- Auth endpoints → User records: reads and creates
- Session verification → User records: loads user
- Message endpoints → Message records: creates and queries
- Database connection → MongoDB: connects
- Message records → MongoDB: persists
- User records → MongoDB: persists
- HTTP server → Reveal scheduler: starts polling
- Message endpoints → Email delivery: sends share link
- Email delivery → Email provider: sends email
- Reveal scheduler → Email delivery: sends ready notice
- Sender → Browser encryption: encrypts message
- Recipient → Browser encryption: decrypts message
