Happy Notes is a markdown-first notes app built with Next.js.
- Markdown editor with source, diff, and preview modes
- Local persistent storage for notes
- Note lifecycle management: active, archived, trash
- Calendar view by note update date
- In-editor AI template generator (Ollama/OpenAI)
- Light and dark themes
- Server-ready data layer with Supabase + Prisma schema/migrations
- Next.js 15 (App Router)
- React 19
- TypeScript
- Tailwind CSS
- Zustand + React Query
- shadcn/ui + Radix UI
- Supabase (Postgres + Auth)
- Prisma ORM + migrations
npm install
cp .env.example .env.local
npm run devOpen http://localhost:3000.
- Create a Supabase project.
- Fill
.env.localusing.env.example. - Generate Prisma client:
npm run prisma:generate- Run local/dev migration:
npm run prisma:migrate- Deploy migrations in production CI/CD:
npm run prisma:deployThe app now supports:
- Email/password auth
- Google OAuth
- GitHub OAuth
- Go to Supabase Dashboard -> Authentication -> Providers.
- Enable
GoogleandGitHub. - Add redirect URL(s):
http://localhost:3000/auth/callbackhttps://your-domain.com/auth/callback
- Add your provider client ID/secret in Supabase.
/home,/notes,/calendar,/archive,/trash,/settingsrequire auth./loginand/registerredirect to/homeif already authenticated.
Migration 20260228201000_auth_rls adds:
- auto profile sync trigger from
auth.users->public.user_profiles - row-level security policies for notes/tags/saved views/collab/share tables
- collaboration-aware read/write checks
The initial Prisma schema includes:
user_profiles(maps to Supabase auth user UUID)noteswith status + cursor-friendly indexestags+note_tags(many-to-many)saved_views(saved filters/search/sort)note_members(future collaboration roles)share_links(future link sharing)note_versions(history/audit foundation)- Postgres full-text indexes (
tsvector+pg_trgm) on note content
ollama pull qwen2.5:7b-instructOptional env vars:
AI_PROVIDER=ollama
OLLAMA_BASE_URL=http://127.0.0.1:11434
OLLAMA_MODEL=qwen2.5:7b-instructOPENAI_API_KEY=your_openai_api_key
AI_PROVIDER=openaiIf AI_PROVIDER is not set, the app tries Ollama first, then OpenAI when key is present.
npm run lint
npm run buildnpm run build
npm run start- Current app UI still uses local store for note state.
- Supabase + Prisma foundation is now prepared for authenticated, shared, realtime persistence in next steps.