How vanshraj07/brain-memory works
BrainWave is an AI-assisted second-brain app for saving notes and links, organizing them as memories, searching by semantic relevance, and asking Gemini questions against retrieved context. The main flow is an authenticated user adding a memory, the API enriching and embedding it before persistence, then searching to retrieve related memories and request an AI answer. The graph captures sampled calls and README-described capabilities; website/YouTube previews and some client routes are documented or visible, but unsampled wiring is not inferred.
Main entry points: user.ts User API routes · AfterSearchMainApp.jsx Search results · MainAppHome.jsx Memory home · MemoryCard.jsx Memory cards
Components 20
Web client
- Route shell
src/App.jsx - Memory home
src/components/MainAppHome.jsx - Search entry
src/components/SearchBar.jsx - Add memory form
src/components/Modal.jsx - Memory cards
src/components/MemoryCard.jsx - Search results
src/components/AfterSearchMainApp.jsx - Client memory state
atoms.js - Sign-in and signup
src/components/SignIn.jsx
API and identity
- API server
src/index.ts - User API routes
src/Routes/user.ts - JWT middleware
src/middlewares/user.ts
Memory services
- MongoDB models
src/db.ts - Link enrichment
src/Scraping/helper.ts - Semantic embeddings
src/Scraping/helper.ts - Relevant memory retrieval
src/Routes/user.ts - Contextual Q&A
src/Routes/user.ts
External services
- MongoDB
- Google Gemini API
- Websites and YouTube
Other components
- User
Connections 35
- User → Route shell: opens
src/App.jsx - Route shell → Memory home: routes to
src/App.jsx - Route shell → Sign-in and signup: routes to
src/App.jsx - Route shell → Search results: routes to
src/App.jsx - Memory home → Client memory state: loads memories
src/components/MainAppHome.jsx - Memory home → Search entry: renders
src/components/MainAppHome.jsx - Memory home → Add memory form: renders
src/components/MainAppHome.jsx - Memory home → Memory cards: renders
src/components/MainAppHome.jsx - Search entry → Search results: navigates
src/components/SearchBar.jsx - Search entry → Client memory state: sets query
src/components/SearchBar.jsx - Add memory form → User API routes: posts memory
src/components/Modal.jsx - Add memory form → Client memory state: updates list
src/components/Modal.jsx - Memory cards → User API routes: updates bookmark
src/components/MemoryCard.jsx - Memory cards → User API routes: deletes memory
src/components/MemoryCard.jsx - Memory cards → Client memory state: updates list
src/components/MemoryCard.jsx - Search results → User API routes: requests matches
src/components/AfterSearchMainApp.jsx - Search results → User API routes: requests answer
src/components/AfterSearchMainApp.jsx - Search results → Memory cards: renders matches
src/components/AfterSearchMainApp.jsx - Search results → Client memory state: reads query
src/components/AfterSearchMainApp.jsx - API server → User API routes: mounts routes
src/index.ts - User API routes → JWT middleware: authenticates
src/Routes/user.ts - JWT middleware → User API routes: sets user identity
src/middlewares/user.ts - User API routes → MongoDB models: reads and writes
src/Routes/user.ts - MongoDB models → MongoDB: persists models
- User API routes → Link enrichment: enriches links
src/Routes/user.ts - User API routes → Semantic embeddings: creates vectors
src/Routes/user.ts - Relevant memory retrieval → MongoDB models: loads memories
src/Routes/user.ts - Relevant memory retrieval → Semantic embeddings: embeds query
src/Routes/user.ts - User API routes → Relevant memory retrieval: handles search
src/Routes/user.ts - User API routes → Contextual Q&A: generates answer
src/Routes/user.ts - Contextual Q&A → Google Gemini API: sends prompt
src/Routes/user.ts - Link enrichment → Websites and YouTube: fetches previews
README.md - User → Sign-in and signup: signs in
- User → Search entry: searches memories
src/components/SearchBar.jsx - User → Add memory form: submits memory
src/components/Modal.jsx