How boredmayonnaise/common_hearth works
Common Hearth is a private-circle care handbook. Users sign up and authenticate, create or join a circle by invite code, complete a trust profile, then write and edit shared practice notes, assign carriers, and mark handoffs received. Server-rendered Next.js pages and actions perform the workflow against Postgres; authentication and membership checks protect access. The README also documents the privacy boundary and the carrier/handoff list. Several note-edit and login/signup implementations are indexed but not excerpted, so their internal calls are not expanded here.
Main entry points: db.ts Postgres client · app/page.tsx Landing and home · notes/page.tsx Notes and handoffs · signup/page.tsx Account creation
Components 17
Web experience
- Landing and home
app/app/page.tsx - App navigation
app/app/nav.tsx - Sign out control
app/app/signout-button.tsx
Identity and profiles
- Account creation
app/app/signup/page.tsx - Signup endpoint
app/app/api/signup/route.ts - Credential login
app/app/login/page.tsx - Auth route
app/app/api/auth/[...nextauth]/route.ts - Credential verification
app/lib/auth.ts - Trust profile
app/app/profile/page.tsx
Private circles
- Circle management
app/app/circle/page.tsx - Membership lookup
app/lib/membership.ts
Practice handbook
- Notes and handoffs
app/app/notes/page.tsx - Practice note creation
app/app/notes/new/page.tsx - Practice note editing
app/app/notes/[id]/edit/page.tsx
Persistence
- Postgres client
app/lib/db.ts - Postgres data store
schema.sql
Other components
- Visitor
Connections 22
- Visitor → Landing and home: opens
README.md - Landing and home → Account creation: offers signup
app/app/page.tsx - Landing and home → Credential login: offers sign-in
app/app/page.tsx - Account creation → Signup endpoint: submits account
- Signup endpoint → Postgres client: inserts user
app/app/api/signup/route.ts - Credential login → Auth route: starts sign-in
- Auth route → Credential verification: uses credentials
app/app/api/auth/[...nextauth]/route.ts - Credential verification → Postgres client: queries users
app/lib/auth.ts - Landing and home → Postgres client: reads profile
app/app/page.tsx - Landing and home → Trust profile: redirects setup
app/app/page.tsx - Trust profile → Postgres client: reads and saves
app/app/profile/page.tsx - Landing and home → Circle management: links circle
app/app/page.tsx - Circle management → Postgres client: manages membership
app/app/circle/page.tsx - Landing and home → Notes and handoffs: links notes
app/app/page.tsx - Notes and handoffs → Practice note creation: opens new note
app/app/notes/page.tsx - Notes and handoffs → Practice note editing: opens edit
app/app/notes/page.tsx - Notes and handoffs → Postgres client: reads and updates
app/app/notes/page.tsx - Practice note creation → Postgres client: persists notes
- Practice note editing → Postgres client: reads and saves
- Membership lookup → Postgres client: queries memberships
app/lib/membership.ts - Postgres client → Postgres data store: runs SQL
- App navigation → Sign out control: renders control
app/app/nav.tsx