Live app: anchorapp.cc
Source: github.com/TargiX/Anchor-App
A quiet daily ritual app — morning and evening check-ins, mood tracking, sleep, journaling, intention. One unified flow across web, mobile, and desktop.
Web: deployed on Vercel · Mobile: iOS/Android via Capacitor · Desktop: macOS/Windows via Electron
- Next.js 16 (App Router, Turbopack) + React 19 + TypeScript
- Tailwind CSS v4 + Radix UI primitives + shadcn/ui components
- Framer Motion for transitions
- Capacitor 8 — iOS & Android native shells
- @capacitor-community/electron — macOS / Windows / Linux desktop shell
- Self-hosted backend (Better Auth + Postgres,
server/) for account-backed journal sync, with localStorage as a device cache
/— marketing landing/app— main dashboard (greeting, streak, today's rituals)/morning— morning ritual flow (mood, sleep, intention, meditation, affirmation)/evening— evening ritual flow (mood, journal, habits, tomorrow's sleep window)/timeline— trends over time/review— week in review/focus— guided box breathing/pulse— one-moment pause check-in/settings— preferences/login— sign in / sign up (shown when the backend is configured)
npm install
npm run dev # http://localhost:3088 (PORT is pinned in package.json)npm run build # standard Next.js buildnpm run build:native # next build with BUILD_TARGET=native -> ./out
npm run cap:sync # build + sync into Capacitor platformsServer-dependent routes use route.server.ts or page.server.tsx.
next.config.mjs includes these extensions only in the web build. The voice
prototype is web-only until a production mobile API is available. Both build
commands verify the resulting route manifest; CI runs both targets.
The iOS shell starts at /app/. AnchorBridgeViewController serves each
extensionless path from its exported index.html; Capacitor's default SPA router
would otherwise serve the marketing landing page for every route.
After building and installing the app on a simulator, run the native persistence
test with XcodeGen and Xcode (replace <simulator-id> with that device's UUID):
xcodegen generate --spec ios/SmokeTests/project.yml
xcodebuild -project ios/SmokeTests/AnchorSmokeTests.xcodeproj \
-scheme AnchorSmokeTests \
-only-testing:AnchorSmokeTests/CheckInTests/testSaveSurvivesRelaunch \
-destination 'platform=iOS Simulator,id=<simulator-id>' testThis test writes a uniquely named synthetic note through the real WKWebView UI, terminates the app, and checks History after relaunch. Use a guest test simulator; the note remains in its local history. It does not verify physical-device behavior or cloud sync.
iOS stores journal slots in Library/Application Support/anchor-journal.json,
outside WebView storage. The native plugin atomically replaces this archive with
complete file protection. Writes run serially; the check-in button awaits native
acknowledgement. Other edits update the UI immediately and show a persistent
retry banner if device persistence fails.
On the first upgraded launch, Anchor copies only its journal keys from WebView storage and removes those copies after the native write succeeds. It keeps guest and account slots separate and retains the existing logout-clearing policy. A native read or archive decoding failure blocks journal editing instead of overwriting the archive. Web builds continue to use localStorage.
For a recovery check, first run the save test above. Terminate the guest test app,
back up and move aside that simulator app's Library/WebKit directory, then
run -only-testing:AnchorSmokeTests/CheckInTests/testRestoreExistingJournal.
This test creates no notes: it finds an existing synthetic entry in History and
attaches a screenshot. Do not clear data from a personal or signed-in app.
The archive is an atomic snapshot, not a per-entry database. App removal still removes local data; Markdown export remains available for backups. Physical-device lock/unlock behavior and cloud conflict recovery need separate release testing.
npm run desktop:dev # build, sync, and launch the desktop app
npm run desktop:pack # produce an unpacked desktop binary
npm run desktop:make # produce a distributable installerUse docs/showcase.md for the LinkedIn/portfolio capture
plan: required screenshots, motion clips, carousel outline, and the quality bar
for proving web + mobile + desktop from one codebase.
The mobile platforms are added on-demand because they require Xcode / Android Studio.
npm run mobile:add:ios # one-time: scaffold the ios/ folder
npm run mobile:open:ios # open in Xcode
npm run mobile:add:android # one-time: scaffold the android/ folder
npm run mobile:open:android # open in Android StudioAfter native code changes, re-sync: npm run cap:sync.
app/ # Next.js App Router routes
page.tsx # landing
app/page.tsx # dashboard
morning/, evening/, settings/, timeline/
components/
ui/ # shadcn primitives
morning/, evening/ # ritual step components
anchor-motif.tsx # brand SVG
lib/store/ # typed app state, actions, local cache, cloud sync
lib/backend/ # browser client for the self-hosted backend
server/ # standalone auth + sync service (Better Auth + Postgres)
electron/ # generated by `cap add electron` — desktop shell
ios/, android/ # generated by `cap add ios|android` — mobile shells
capacitor.config.ts # shared Capacitor config
next.config.mjs # conditional static export when BUILD_TARGET=native