Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Second Brain

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

What the app does

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

Project structure

second-brain/
+-- package.json              # root npm workspace scripts
+-- packages/
¦   +-- client/               # React + Vite frontend
¦   +-- server/               # Express + TypeScript API
¦   +-- extension/            # Manifest V3 Chrome extension
+-- README.md

Tech stack

Frontend

  • React 18
  • Vite
  • TypeScript
  • Tailwind CSS
  • React Router
  • Axios
  • Lucide React icons

Backend

  • 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

Browser extension

  • Chrome/Chromium Manifest V3
  • popup-based login and one-click save action
  • stores API URL and auth token in browser storage

Core features

  • 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

Environment setup

Server

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-key

The server uses:

  • MONGODB_URI for MongoDB connection
  • JWT_SECRET for authentication tokens
  • GOOGLE_CLIENT_ID for Google login
  • GROQ_API_KEY for optional moderation checks

Client

Create a .env file in packages/client if needed:

VITE_API_BASE_URL=http://localhost:5000/api
VITE_GOOGLE_CLIENT_ID=your-google-client-id

Getting started

From the repo root, install dependencies:

npm install

Run the full development stack:

npm run dev

This starts both:

  • the server workspace for the API
  • the client workspace for the frontend

Useful root scripts

npm run dev:server
npm run dev:client
npm run build
npm run start

Running the app separately

Server

cd packages/server
npm run dev

The API runs by default on port 5000 and exposes endpoints under /api.

Client

cd packages/client
npm run dev

The Vite app serves the main dashboard and authentication UI.

Chrome extension setup

The extension lives in packages/extension.

To load it in Chrome:

  1. open chrome://extensions
  2. enable Developer mode
  3. click Load unpacked
  4. select the packages/extension folder

The extension stores the API base URL and auth token in browser storage and can save the active tab into the selected default brain.

Notes

  • the backend defaults to mongodb://localhost:27017/second-brain if MONGODB_URI is 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

About

A fast, extendable second-brain built with React, Node, TypeScript and MongoDB.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages