How sriharirajukanumuriflorida/second-brain works
Second Brain is a read-only Obsidian-vault knowledge platform: GitHub vault content is synced and indexed, then users browse notes, search, check status, or chat over their knowledge. GitHub OAuth protects owner actions; temporary share links provide separate read-only access. The graph includes the frontend, API, ingestion/search, auth, and persistence layers. Several subsystem links rely on README or SOURCE INDEX references because their implementation files were not excerpted; those limits are reflected in the evidence paths.
Main entry points: main.py FastAPI application · models.py Vault and session records · App.jsx React application · client.js API client
Components 25
Web application
- React application
frontend/src/App.jsx - API client
frontend/src/api/client.js - Auth client
frontend/src/api/auth.js - Notes and search UI
frontend/src/pages/SearchPage.jsx - Chat UI
frontend/src/pages/ChatPage.jsx - Admin UI
frontend/src/pages/AdminPage.jsx
API and access
- FastAPI application
backend/app/main.py - Notes and status API
backend/app/api/notes.py - Sync API
backend/app/api/sync.py - Search API
backend/app/api/search.py - Chat API
backend/app/api/chat.py - OAuth and sessions
backend/app/api/auth.py - Share-link access
backend/app/api/access.py - Auth services
backend/app/services/auth/session_service.py
Vault and knowledge
- GitHub vault
- Vault sync and indexing
backend/app/services/index_service.py - Markdown parsing
backend/app/services/parser_service.py - Embedding generation
backend/app/services/embeddings/embedding_service.py
Search and chat
- Hybrid search
backend/app/services/search/hybrid_search.py - Agent workflows
backend/app/services/workflows/mentor_chat_workflow.py - LLM providers
backend/app/services/llm/factory.py
Persistence
- Vault and session records
backend/app/models.py - Application database
backend/app/database.py
Other components
- Owner or visitor
- GitHub OAuth
Connections 32
- Owner or visitor → React application: uses
README.md - React application → Notes and search UI: routes to
frontend/src/App.jsx - React application → Chat UI: routes to
frontend/src/App.jsx - React application → Admin UI: routes to
frontend/src/App.jsx - Notes and search UI → API client: requests data
frontend/src/pages/SearchPage.jsx - Chat UI → API client: requests chat
frontend/src/pages/ChatPage.jsx - Admin UI → API client: requests admin actions
frontend/src/pages/AdminPage.jsx - API client → FastAPI application: calls API
frontend/src/api/client.js - Auth client → OAuth and sessions: handles login
frontend/src/api/auth.js - FastAPI application → Notes and status API: registers router
backend/app/main.py - FastAPI application → Sync API: registers router
backend/app/main.py - FastAPI application → Search API: registers router
backend/app/main.py - FastAPI application → Chat API: registers router
backend/app/main.py - FastAPI application → OAuth and sessions: registers router
backend/app/main.py - FastAPI application → Share-link access: registers router
backend/app/main.py - Sync API → GitHub vault: syncs vault
README.md - Sync API → Vault sync and indexing: starts indexing
- Vault sync and indexing → Markdown parsing: parses notes
- Vault sync and indexing → Vault and session records: indexes metadata
- Search API → Hybrid search: searches notes
- Chat API → Agent workflows: dispatches chat
backend/app/api/chat.py - Agent workflows → Hybrid search: retrieves context
- Agent workflows → LLM providers: generates response
- Chat API → LLM providers: selects provider
backend/app/api/chat.py - OAuth and sessions → Auth services: manages sessions
backend/app/api/auth.py - Share-link access → Auth services: checks access
backend/app/api/access.py - Auth services → Vault and session records: reads and writes
backend/app/services/auth/session_service.py - Embedding generation → Vault and session records: stores chunks
backend/app/services/embeddings/embedding_service.py - Hybrid search → Vault and session records: queries indexed notes
backend/app/services/search/hybrid_search.py - Application database → Vault and session records: backs models
backend/app/models.py - Notes and status API → Application database: uses sessions
- GitHub OAuth → OAuth and sessions: authorizes login