How yashchat007/graphite works
Graphite is a task and focus application: users sign in, create and organize tasks through smart lists and natural-language quick add, then track focus time and sync account-scoped state across devices. The client persists task state locally; its sync engine exchanges documents with the server, which authorizes requests, merges updates, and stores per-user state in Redis. The README also documents installable offline PWA support. Several internal sync and UI connections are based on the SOURCE INDEX; unsampled API routing is left unverified.
Main entry points: App.tsx Dashboard shell · handler.ts Sync handler · sync-client.ts Sync client · useGraphiteStore.ts Task state
Components 29
Client experience
- React entry
src/main.tsx - Dashboard shell
src/App.tsx - Clerk sign-in
src/components/auth/ClerkAuthGate.tsx - PWA worker
public/sw.js
Task and focus
- Task lists
src/components/tasks/TaskCard.tsx - Task editor
src/components/modals/TaskModal.tsx - Quick add
src/components/tasks/QuickAdd.tsx - Natural-language parser
src/lib/nlp-parser.ts - Smart-list filters
src/hooks/useVisibleTasks.ts - Completed tasks
src/hooks/useCompletedTasks.ts - Focus timer
src/features/focus/StopwatchCard.tsx - Today note
src/features/tasks/TodayNote.tsx - Task state
src/store/useGraphiteStore.ts - Local persistence
src/lib/persist-storage.ts
Sync and storage
- Sync engine
src/hooks/useSyncEngine.ts - Sync client
src/lib/sync-client.ts - Sync document
src/lib/sync-document.ts - Document merge
shared/sync-merge.ts - Sync types
shared/sync-types.ts - Note merge
shared/today-note.ts
Server services
- Sync endpoint
api/sync.ts - Sync handler
server/handler.ts - Request authorization
server/auth.ts - Rate limiting
server/rate-limit.ts - Leak cleanup
server/leak-cleanup.ts - Pruned state loading
server/load-pruned-state.ts - Redis storage
server/redis.ts
Other components
- App user
- Clerk identity
Connections 31
- App user → React entry: opens app
src/main.tsx - React entry → Dashboard shell: renders
src/main.tsx - Dashboard shell → Clerk sign-in: gates dashboard
src/App.tsx - Clerk sign-in → Clerk identity: authenticates
src/components/auth/ClerkAuthGate.tsx - Dashboard shell → Task lists: renders
src/App.tsx - Dashboard shell → Task editor: renders
src/App.tsx - Dashboard shell → Quick add: renders
src/App.tsx - Dashboard shell → Focus timer: renders
src/App.tsx - Dashboard shell → Today note: renders
src/App.tsx - Quick add → Natural-language parser: parses input
- Task lists → Smart-list filters: filters tasks
src/components/tasks/TaskCard.tsx - Task lists → Completed tasks: selects completed
src/components/tasks/TaskCard.tsx - Task lists → Task state: updates tasks
src/components/tasks/TaskCard.tsx - Task editor → Task state: updates tasks
src/components/modals/TaskModal.tsx - Focus timer → Task state: reads timer state
src/features/focus/StopwatchCard.tsx - Task state → Local persistence: persists locally
src/store/useGraphiteStore.ts - React entry → PWA worker: registers worker
src/main.tsx - Clerk sign-in → Sync engine: starts sync
src/components/auth/ClerkAuthGate.tsx - Sync engine → Sync client: fetches and pushes
src/hooks/useSyncEngine.ts - Sync client → Task state: reads and applies
src/lib/sync-client.ts - Sync client → Sync document: builds documents
src/lib/sync-client.ts - Sync client → Document merge: merges documents
src/lib/sync-client.ts - Document merge → Note merge: merges note fields
shared/sync-merge.ts - Sync handler → Document merge: normalizes and merges
server/handler.ts - Sync handler → Request authorization: authorizes request
server/handler.ts - Sync handler → Rate limiting: checks limit
server/handler.ts - Sync handler → Leak cleanup: runs cleanup
server/handler.ts - Sync handler → Pruned state loading: loads state
server/handler.ts - Sync handler → Redis storage: reads and saves
server/handler.ts - Sync client → Sync endpoint: requests /api/sync
src/lib/sync-client.ts - Sync endpoint → Sync handler: dispatches request