Personal knowledge management system — save web content as cards, organize with tags/sections, search semantically using AI embeddings, and share curated collections.
| Component | Technology |
|---|---|
| Frontend | React 18, TypeScript, Vite, Tailwind CSS 4 |
| Backend | Express 5, TypeScript |
| Database | MongoDB (Mongoose 8) |
| Vector DB | Qdrant (semantic search) |
| AI Embeddings | HuggingFace Inference API |
| Web Scraping | Jina AI |
| Auth | JWT + Passport (Google, GitHub OAuth) |
| Real-time | Socket.io |
| Validation | Zod 4 |
- Content Cards — Save any URL (article, video, tweet, link) as a searchable card with auto-detected type
- Tagging — Custom tags for categorization
- Sections — Organize cards into named sections
- Semantic Search — Natural language search via vector embeddings (HuggingFace → Qdrant)
- AI Scraping — Automatic content extraction via Jina AI when saving a URL
- Public Sharing — Generate share links for your brain (no account required to view)
- Dashboard — Stats, weekly activity, top tags
- Authentication — Email/password, Google OAuth, GitHub OAuth
- Dark/Light Theme — Toggleable
- Real-time Updates — Card processing status via Socket.io
- Node.js 18+ and npm
- MongoDB (local or Atlas)
- Qdrant (local or cloud)
- HuggingFace API key
- Jina AI API key
git clone <repo-url>
cd second-brain
# Install dependencies
cd client && npm install
cd ../server && npm installclient/.env
VITE_BACKEND_URL=http://localhost:5000server/.env
PORT=5000
NODE_ENV=development
FRONTEND_URL=http://localhost:5173
MONGO_URI=mongodb://localhost:27017/secondbrain
HUGGINGFACE_API_KEY=your_key
JINA_API_KEY=your_key
JWT_SECRET=your_secret
QDRANT_URL=http://localhost:6333
QDRANT_API_KEY=your_key
# Optional OAuth
GOOGLE_CLIENT_ID=your_id
GITHUB_CLIENT_ID=your_id# Terminal 1
cd server && npm run dev
# Terminal 2
cd client && npm run devFrontend: http://localhost:5173
Backend API: http://localhost:5000
second-brain/
├── client/ # React frontend
│ └── src/
│ ├── components/ # UI components (Card, Sidebar, AddCard, etc.)
│ ├── context/ # AuthContext, ThemeContext
│ ├── layouts/ # DashboardLayout
│ ├── pages/ # LandingPage, Dashboard, Cards, Search, Tags, Share, Section, AuthPages, ResetPassword
│ └── store/atoms/ # Recoil state atoms
├── server/ # Express backend
│ └── src/
│ ├── controllers/ # auth, card, section, share, user, verifyUser
│ ├── middlewares/ # auth (JWT) middleware
│ ├── models/ # Mongoose schemas (User, Content, Tags, Link, Share, Section)
│ ├── routes/ # oauth, card, section, brain, user
│ ├── services/ # Card processing pipeline (scrape → embed → store)
│ ├── utils/ # embeddings, passport config, qdrant client, scrape, socketManager
│ └── validations/ # Zod schemas
└── README.md
- User saves a URL → card created in MongoDB (
status: pending) - Background processor scrapes content (Jina AI)
- Generates vector embeddings (HuggingFace API)
- Stores vectors in Qdrant for semantic search
- Card status updated to
ready - Socket.io event notifies the client
Base path: /api/v1
| Endpoint | Auth | Description |
|---|---|---|
POST /auth/signup |
— | Register |
POST /auth/login |
— | Login |
POST /auth/logout |
— | Logout |
POST /auth/forgot-password |
— | Request reset |
POST /auth/reset-password |
— | Reset password |
GET /auth/google |
— | Google OAuth |
GET /auth/github |
— | GitHub OAuth |
GET /auth/me |
Cookie | Current user |
GET /content/cards |
JWT | List cards (paginated) |
GET /content/metrics |
JWT | Dashboard stats |
POST /content/card |
JWT | Create card |
PUT /content/editCard/:id |
JWT | Edit card |
DELETE /content/card/:id |
JWT | Delete card |
POST /content/query |
JWT | Semantic search |
GET /user/ |
JWT | Get profile |
PUT /user/profile |
JWT | Update profile |
POST /brain/share |
JWT | Generate share link |
GET /brain/:shareLink |
— | View shared brain |
GET/POST /section/ |
JWT | List/create sections |
DELETE /section/:id |
JWT | Delete section |
PATCH /section/:id |
JWT | Update section |
POST /section/move-card |
JWT | Move card between sections |
- Fork the repo
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Submit a pull request
MIT