Skip to content

MS33834/compass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧭 Compass

A self-hosted compass for your life's voyages

Anchor goals Β· Plan voyages Β· Calibrate direction

English Β· δΈ­ζ–‡

CI Release License: MIT Node Tests PRs Welcome


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.

✨ Features

  • 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.

πŸ›  Tech stack

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)

πŸ“ Architecture

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

🎨 Design language

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

πŸš€ Quick start

Prerequisites

  • Node.js β‰₯ 20
  • pnpm β‰₯ 9
  • PostgreSQL β‰₯ 14

Local development

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:3000

Testing

pnpm 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 build

🐳 Production deploy

One-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 test

Full deploy, backup/restore, and rollback procedures: see DEPLOY.md.

πŸ”’ Security

  • 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 where carries userId β€” 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 attachment download.

Security audit report: docs/SECURITY-AUDIT.md. Vulnerability disclosure policy: SECURITY.md.

πŸ“Š Roadmap

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) βœ…

πŸ“Έ Screenshots

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.

πŸ“ Documentation

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 δΈ­ζ–‡

🀝 Contributing

Contributions welcome β€” bug reports, feature ideas, docs, or code.

Acknowledgements

Thanks to everyone who has shipped code, filed issues, or joined the discussion. 🧭

Contributors

πŸ“ License

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.

About

A lightweight decision compass and navigation framework for projects.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages