How ruchinmunjal/anchor works
Anchor is an offline-first, self-hosted note-taking application with web and mobile clients and a NestJS API. A typical user edits and organizes notes, then synchronizes changes across devices when online; the server also supports authentication, sharing, history, attachments, import/export, and administration. The tree identifies the main web and server subsystems, but most implementation excerpts are unavailable, so edges beyond the sampled controller calls and README-documented behavior are omitted. The mobile tree shows platform wrappers and an Android home-screen widget, not the main app implementation.
Main entry points: notes/page.tsx Notes workspace · rich-text-editor.tsx Rich text editor · login/page.tsx Sign-in screens · use-sync.ts Offline edits and sync
Components 21
Web Client
- Notes workspace
web/app/(app)/notes/page.tsx - Rich text editor
web/features/notes/components/editor/rich-text-editor.tsx - Sign-in screens
web/app/(auth)/login/page.tsx - Android notes widget
mobile/android/app/src/main/kotlin/com/zhfahim/anchor/widget/NotesWidgetService.kt
Notes and Sync
- Offline edits and sync
web/features/sync/use-sync.ts - Notes API
server/src/notes/controllers/notes.controller.ts - Note management
server/src/notes/services/notes.service.ts - Sync API
server/src/sync/sync.controller.ts - Sync processing
server/src/sync - Note history
server/src/notes/services/note-history.service.ts - Note sharing
server/src/notes/services/note-shares.service.ts - Attachments
server/src/notes/services/note-attachments.service.ts - Tags
server/src/tags/tags.controller.ts
Identity and Admin
- Authentication API
server/src/auth/auth.controller.ts - Authentication
server/src/auth/auth.service.ts - OIDC login
server/src/auth/oidc/oidc.controller.ts - Administration
server/src/admin/admin.controller.ts
Supporting Services
- Import and export
server/src/import-export - Settings
server/src/settings/settings.service.ts - Application data
server/src/prisma/prisma.service.ts
Other components
- Note taker
Connections 18
- Note taker → Notes workspace: uses
- Notes workspace → Rich text editor: edits notes
- Rich text editor → Offline edits and sync: saves offline
- Offline edits and sync → Sync API: syncs online
- Sync API → Sync processing: dispatches
server/src/sync/sync.controller.ts - Note taker → Notes API: manages notes
server/src/notes/controllers/notes.controller.ts - Notes API → Note management: calls
server/src/notes/controllers/notes.controller.ts - Note taker → Tags: organizes notes
- Note taker → Note history: reviews versions
- Note taker → Note sharing: shares notes
- Note taker → Attachments: adds files
- Note taker → Sign-in screens: signs in
- Sign-in screens → Authentication API: authenticates
- Authentication API → Authentication: calls
- Note taker → OIDC login: uses OIDC
server/src/auth/oidc/oidc.controller.ts - Note taker → Administration: administers users
server/src/admin/admin.controller.ts - Note taker → Import and export: imports or exports
- Android notes widget → Note taker: surfaces notes
mobile/android/app/src/main/kotlin/com/zhfahim/anchor/widget/NotesWidgetService.kt