A minimal, open-source knowledge base: one search bar, Markdown documents, shared workspaces. React + TypeScript + Vite on the front, Supabase (Postgres + Auth) behind it, deployable on Netlify.
- Supabase – create a project, open SQL Editor, paste and run
supabase/migrations/0001_init.sql, then0002_no_default_workspaces.sqland0003_guest_access.sql. cp .env.example .env.localand fill in the URL + anon key (Project Settings → API).- In Supabase turn on Authentication → Sign In / Providers → Allow anonymous sign-ins (there is no login screen: every browser silently gets a private guest account). Then
npm install && npm run dev. - Netlify – push to Git, "Import project".
netlify.tomlalready sets the build, the SPA redirect and security headers. Add the two env vars in site settings.
New users start with an empty slate: the home page walks them through creating a workspace (private or shared),
writing a first document and searching for it. Run supabase/migrations/0002_no_default_workspaces.sql too.
Teammates join a shared workspace through its invite link (/join/<code>, shown on the workspace page). Because guests live in one browser, use Settings → Export to back up or move your notebook.
supabase/migrations/0001_init.sql schema, RLS policies, search/dashboard RPCs
supabase/migrations/0002_*.sql removes automatic workspaces
src/lib/ supabase client, types, utils
src/auth/ AuthProvider (session), RequireAuth (route guard)
src/theme/ light/dark provider (CSS variables)
src/api/ data access: documents, workspaces, dashboard
src/components/ Layout (sidebar), SearchBar, DocList, TagInput, MarkdownEditor, Modal, Toast, Icon…
src/pages/ HomePage (hub), DocumentPage (read/edit/upload), WorkspacePage, LoginPage
src/AppData.tsx workspaces + categories context
- Search state lives in the URL (
/?q=bearing&cat=it-cs&tag=urgent) – shareable and refresh-safe.#urgentin the box adds a tag filter. - Two tag kinds:
tags(visible, counted on the dashboard) andmeta_tags(quiet status flags likeurgent,draft,review-needed). Both are searchable. - Categories are a table:
insert into categories (slug,label) values ('leather','Leather');adds a drop-down entry, no deploy needed. - Storage budget (500 MB): text only, one TEXT column (auto-compressed by Postgres), 300 KB cap per document, and full-text search via an expression index rather than a second stored copy. The home page shows a usage meter.
- Security: all tables use Row Level Security; the anon key in the browser can only reach rows of workspaces you belong to. Raw HTML in Markdown is not rendered.
- Titles must be descriptive (2+ words, 8+ chars), enforced in the UI and the database.
MIT licensed. Run npm run typecheck before opening a PR. Ideas: document version history, per-workspace roles, Markdown file export, attachments (keep them out of the 500 MB text budget).