Second Brain is a TypeScript monorepo for saving, organizing, and sharing personal knowledge. The project combines:
- a React + Vite web app for browsing and managing saved content
- an Express + MongoDB API for authentication, brains, items, and sharing
- a Chrome extension for one-click page capture into a selected brain
Users can:
- sign up and log in with email/password or Google OAuth
- create multiple personal knowledge collections called brains
- save links, articles, videos, and notes into a selected brain
- search, filter, tag, and inspect saved content
- share a brain publicly through a generated token-based URL
- use the browser extension to save the active page in one click
second-brain/
+-- package.json # root npm workspace scripts
+-- packages/
¦ +-- client/ # React + Vite frontend
¦ +-- server/ # Express + TypeScript API
¦ +-- extension/ # Manifest V3 Chrome extension
+-- README.md
- React 18
- Vite
- TypeScript
- Tailwind CSS
- React Router
- Axios
- Lucide React icons
- Node.js
- Express
- TypeScript
- MongoDB with Mongoose
- JWT authentication
- bcryptjs for password hashing
- Google OAuth integration
- URL metadata extraction with Cheerio
- content safety and source health checks
- Chrome/Chromium Manifest V3
- popup-based login and one-click save action
- stores API URL and auth token in browser storage
- user registration and login
- Google sign-in flow
- default brain creation for new users
- create, list, search, filter, and delete saved items
- public brain sharing with unique share URLs
- read-only shared brain view for public links
- automatic metadata extraction from URLs
- source availability checks for saved links
- browser extension to save the current tab into a default brain
Create a .env file in packages/server with variables similar to:
MONGODB_URI=mongodb://localhost:27017/second-brain
JWT_SECRET=your-super-secret-jwt-key
GOOGLE_CLIENT_ID=your-google-client-id
GROQ_API_KEY=your-groq-keyThe server uses:
MONGODB_URIfor MongoDB connectionJWT_SECRETfor authentication tokensGOOGLE_CLIENT_IDfor Google loginGROQ_API_KEYfor optional moderation checks
Create a .env file in packages/client if needed:
VITE_API_BASE_URL=http://localhost:5000/api
VITE_GOOGLE_CLIENT_ID=your-google-client-idFrom the repo root, install dependencies:
npm installRun the full development stack:
npm run devThis starts both:
- the server workspace for the API
- the client workspace for the frontend
npm run dev:server
npm run dev:client
npm run build
npm run startcd packages/server
npm run devThe API runs by default on port 5000 and exposes endpoints under /api.
cd packages/client
npm run devThe Vite app serves the main dashboard and authentication UI.
The extension lives in packages/extension.
To load it in Chrome:
- open
chrome://extensions - enable Developer mode
- click
Load unpacked - select the
packages/extensionfolder
The extension stores the API base URL and auth token in browser storage and can save the active tab into the selected default brain.
- the backend defaults to
mongodb://localhost:27017/second-brainifMONGODB_URIis not set - a new user is automatically given a default brain during registration or Google login
- a brain becomes public only after the owner clicks the Share action in the dashboard
- the content moderation and source-health checks are part of the item save workflow