How sameep-sharma/second-brain works
This is a “second brain” bookmarking app: users sign up or sign in, save YouTube and Twitter links, browse and delete saved items, and create share links for a read-only shared dashboard. The client routes user actions through hooks or page handlers to an Express API; the API authenticates protected requests and persists users, content, and share links in MongoDB. Embedded media is rendered by the client. The backend route wiring and client dashboard/content flows are sampled; some page and middleware implementations are not, so uncertain internal links are omitted.
Main entry points: index.ts API routes · DashBoard.tsx Dashboard · App.tsx App routes · SharedDashBoard.tsx Shared dashboard
Components 17
Client experience
- App routes
client/src/App.tsx - Sign up
client/src/pages/Signup.tsx - Sign in
client/src/pages/Signin.tsx - Dashboard
client/src/pages/DashBoard.tsx - Shared dashboard
client/src/pages/SharedDashBoard.tsx - Create content
client/src/components/CreateContent.tsx - Content card
client/src/components/Card.tsx - Content hook
client/src/hooks/useContent.tsx - Shared hook
client/src/hooks/useSharedContent.tsx
Backend API
- API routes
backend/src/index.ts - Auth middleware
backend/src/middleware.ts - ID generator
backend/src/utils.ts
Persistence
- Data models
backend/src/db.ts
Other components
- User
- MongoDB
- YouTube embeds
- Twitter embeds
Connections 25
- User → App routes: opens
- App routes → Sign up: routes
- App routes → Sign in: routes
- App routes → Dashboard: routes
- App routes → Shared dashboard: routes
- Sign up → API routes: posts signup
- Sign in → API routes: posts signin
- Dashboard → Create content: opens form
- Dashboard → Content hook: loads content
- Dashboard → API routes: requests sharing
- Create content → API routes: posts content
- Content hook → API routes: fetches and deletes
- Content hook → Dashboard: returns content
- Shared dashboard → Shared hook: loads shared items
- Shared hook → API routes: fetches shared content
- Shared hook → Shared dashboard: returns content
- Dashboard → Content card: renders items
- Shared dashboard → Content card: renders items
- Content card → YouTube embeds: embeds video
- Content card → Twitter embeds: renders tweet
- API routes → Auth middleware: authenticates
- API routes → ID generator: generates IDs
- API routes → Data models: queries and writes
- API routes → MongoDB: connects
- Data models → MongoDB: stores records