Anchor goals Β· Plan voyages Β· Calibrate direction
Turn vague "I want to be better" into a voyage you can plot, sail, and log. Compass borrows the metaphor of nautical instruments: anchor goals on a four-quadrant compass rose, break them into milestones and tasks, log every deviation, and review each week's wake before setting the next heading.
- Four-quadrant compass β Career / Learning / Health / Life. Drag goals between quadrants to re-anchor where they belong.
- Three-tier goals β Goal β Milestone β Task. Progress rolls up automatically. Tasks carry due date / priority / estimate / tags for finer planning.
- Voyage page, two views β Timeline for the narrative, Kanban for the flow. Drag to move tasks across states.
- Calendar view β Monthly grid aggregating goal deadlines, milestone due dates, task due dates, and log density onto one chart. Monday-first, prev/next/today nav.
- Captain's log β Record mood, energy, and tags. Link entries to goals. Review drift on your own schedule.
- Helm command palette β βK to jump anywhere or search across goals, tasks, and logs. Mouse optional.
- Lighthouse signals β Deadline and achievement notifications. Generated on demand with fingerprint dedup, no cron worker needed. Per-type toggles and quiet hours (cross-midnight supported).
- Weekly review + monthly overview β Auto-aggregated highlights and metrics for each week, plus your own reflections. Below it, a month-by-month roll-up covers goals / tasks / focus minutes / habit check-in days / top tags, with prev/next navigation.
- Spyglass search β Full-text search across goals, tasks, and logs. Title hits rank first. All queries scoped by
userId. - Focus cabin β Pomodoro sessions (25/5/15 presets or custom 5β120 min) with optional task linking. Today/week stats auto-tallied, plus weekday and hour-of-day distribution charts.
- Daily anchors β Habit tracker with streaks and a 52Γ7 yearly heatmap. Group habits by morning / afternoon / evening / anytime.
- Tags across goals / tasks / logs β Cross-cutting taxonomy for the spyglass, calendar, and monthly overview.
- Two themes β Deep-sea navy (default) and parchment ivory. Server-rendered, no theme flash.
- PWA β Installable, offline-capable via service worker, maskable icon, manifest shortcuts.
- Nautical instrument aesthetic β Compass rose, brass gold, ivory white, monospace figures. Not yet another generic SaaS template.
| Layer | Choice |
|---|---|
| Framework | Next.js 14 App Router (full-stack, Server Components) |
| Language | TypeScript strict mode |
| Styling | Tailwind CSS 3.4 + CSS variable theming |
| Data | Prisma 5 + PostgreSQL 16 |
| Auth | NextAuth.js 4 (JWT, Credentials + OAuth ready) |
| Animation | Framer Motion 11 (respects prefers-reduced-motion) |
| Testing | Vitest (524 unit/API tests) + Playwright (E2E) |
| Deploy | Docker Compose + Caddy (automatic HTTPS) |
src/
βββ app/ # App Router routes
β βββ (auth)/ # sign in / sign up / reset password
β βββ dashboard/ # today's focus + stats
β βββ compass/ # four-quadrant drag canvas
β βββ voyage/ # timeline + kanban dual view
β βββ calendar/ # monthly deadline + log density grid
β βββ logbook/ # captain's log timeline + editor
β βββ review/ # weekly review + monthly overview
β βββ focus/ # pomodoro cabin + session history + charts
β βββ anchors/ # habit tracker with streaks + heatmap
β βββ onboarding/ # 4-step new user wizard
β βββ profile/ # account / security / preferences / data
β βββ api/ # REST endpoints (notifications / search / reviews / focus / habits / calendar)
βββ components/
β βββ compass/ # compass canvas, goal cards
β βββ voyage/ # timeline, kanban, task dialog (due/priority/estimate/tags)
β βββ calendar/ # monthly grid view
β βββ logbook/ # log timeline, editor, tag input
β βββ review/ # weekly review editor
β βββ focus/ # pomodoro timer + session list + distribution charts
β βββ habits/ # habit list + check-in + streak badge + 52Γ7 heatmap
β βββ command-palette/ # helm command palette
β βββ notifications/ # lighthouse signal center
β βββ shortcuts/ # helm shortcut help
β βββ profile/ # profile sections (incl. granular notification prefs)
β βββ ui/ # Toast / Confirm / Skeleton / animated number
β βββ AppShell.tsx # nav shell (palette + notifications + shortcuts)
βββ lib/
βββ services/ # business logic (transactions, state machines, on-demand generation)
βββ validations.ts # Zod schemas (all `.strict()`)
βββ shortcuts.ts # server-safe shortcut registry
βββ compass.ts # quadrant / status metadata
βββ session.ts # auth helpers
βββ rate-limit.ts # in-memory rate limiter
βββ prisma.ts # Prisma singleton
Data model:
User ββ¬β Goal ββ Milestone ββ Task # tags on Goal + Task; dueDate/priority/estimate on Task
ββ Log ββ GoalLogs ββ Goal # tags on Log
ββ Notification # lighthouse signals (deadline / achievement / system)
ββ WeeklyReview # one per ISO week (unique constraint)
ββ FocusSession # pomodoro sessions, optionally linked to a Task
ββ Habit ββ HabitCheck # daily anchors (one check per habit per day)
ββ PasswordReset
Compass has its own visual point of view β it is not a generic template.
| Color | Hex | Used for |
|---|---|---|
| Deep-sea navy | #0B1426 |
default background, star-chart night |
| Ivory | #F5F1E8 |
primary text |
| Brass gold | #C9A227 |
accent, progress, compass needle |
| Tide teal | #4A7C82 |
secondary state |
| Coral | #D97757 |
warning, destructive actions |
| Starlight silver | #A8B4C4 |
secondary text, skeletons |
- Type: Cormorant Garamond (serif headings) / Source Sans 3 (body) / JetBrains Mono (figures)
- Texture: glass panels, brass glow, rotating compass rose, star-chart backdrop
- Node.js β₯ 20
- pnpm β₯ 9
- PostgreSQL β₯ 14
git clone https://github.com/MS33834/compass.git
cd compass
pnpm install
cp .env.example .env # fill in DATABASE_URL / NEXTAUTH_SECRET / SMTP / OAuth
pnpm db:generate # generate Prisma Client
pnpm db:migrate # create tables
pnpm db:seed # optional: load sample data
pnpm dev # http://localhost:3000pnpm typecheck # TypeScript strict check
pnpm lint # ESLint
pnpm test # unit + API integration tests (524 cases)
pnpm test:e2e # E2E (requires running DB + browser install)
pnpm build # production buildOne-shot Docker Compose (app + Postgres + Caddy auto-SSL + scheduled backups):
cp .env.production.example .env.production # fill in domain / passwords / SMTP
docker compose up -d
./scripts/smoke-test.sh # pre-launch smoke testFull deploy, backup/restore, and rollback procedures: see DEPLOY.md.
- Auth: NextAuth JWT. Middleware protects every authenticated route.
- Rate limiting: sign-up 5/15min, writes 30/min, password change 10/min, export 5/min.
- Data isolation: every query's
wherecarriesuserIdβ IDOR-resistant by construction. - Input validation: every API input runs through a Zod
.strict()schema; UUID params validated. - Passwords: bcrypt cost 12, never serialized or returned.
- XSS: log content rendered as plain text; exports force
attachmentdownload.
Security audit report: docs/SECURITY-AUDIT.md. Vulnerability disclosure policy: SECURITY.md.
| Phase | Scope | Status |
|---|---|---|
| 0 | Foundation | β |
| 1 | Landing + auth | β |
| 2 | Dashboard | β |
| 3 | Compass quadrants | β |
| 4 | Voyage (milestones + tasks) | β |
| 5 | Logbook | β |
| 6 | Onboarding + profile | β |
| 7 | Interaction polish | β |
| 8 | Test QA | β |
| 9 | Production deploy | β |
| 10 | Iteration (OAuth / charts / PWA / i18n / gestures / templates / import-export) | β |
| 11 | Productivity layer (command palette + notifications + review + search) | β |
| 12 | Deep work layer (focus cabin + daily anchors) | β |
| 13 | Content enrichment (calendar / task depth / tags / habit heatmap / focus charts / granular notifications / monthly overview / public asset polish) | β |
The Compass UI speaks for itself. Drop your screenshots into docs/screenshots/ and
reference them here once you have a running deploy.
docs/screenshots/
βββ landing.png # hero with rotating compass rose
βββ compass.png # four-quadrant drag canvas
βββ voyage-kanban.png # kanban view with task dialog (due / priority / tags)
βββ calendar.png # monthly deadline + log density grid
βββ focus-charts.png # weekday + hour-of-day distribution
βββ habit-heatmap.png # 52Γ7 yearly check-in heatmap
βββ review-monthly.png # weekly review + monthly overview
Tip:
pnpm devβ log in β visit each route β browser screenshot at 1440Γ900.
All deep docs are English-primary with a Chinese mirror. Toggle links live at the top of each file.
| Doc | What's inside | δΈζη |
|---|---|---|
| USAGE.md | User guide β every module walkthrough | δΈζ |
| DEPLOY.md | Production deployment handbook | δΈζ |
| DEVELOPMENT.md | Local dev setup and conventions | δΈζ |
| CHANGELOG.md | Release history (Keep a Changelog) | β |
| CONTRIBUTING.md | How to contribute | β |
| SECURITY.md | Vulnerability disclosure policy | β |
| docs/SECURITY-AUDIT.md | Security audit report | δΈζ |
| docs/ACCESSIBILITY-AUDIT.md | Accessibility audit report | δΈζ |
| docs/PERFORMANCE-AUDIT.md | Performance audit report | δΈζ |
| docs/CODE-AUDIT.md | Code quality audit report | δΈζ |
Contributions welcome β bug reports, feature ideas, docs, or code.
- π Contributing guide
- π‘οΈ Code of conduct
- π Security policy
- π Issue templates
- π¬ Discussions
Thanks to everyone who has shipped code, filed issues, or joined the discussion. π§
Released under the MIT License.
Copyright Β© 2026 Compass Contributors
Compass Β· May you always know your heading, even on open water.
β If Compass helps you, a star goes a long way.