How kushsharma260910/planpilot works
1. What this repo is
- PlanPilot is a single-page React application built with Vite and TypeScript.
- It appears to be a planning/workflow product centered on “charters,” projects, tasks, analytics, and behavior/burnout guidance.
2. Top-level application shape
- The app is mostly client-side UI with route-based pages under src/pages.
- There is no custom backend server in this repo; persistence and auth are delegated to Supabase.
3. Routing and page boundaries
- The main user-facing surfaces are:
- LandingPage for marketing/entry
- Auth for sign-in/onboarding
- DashboardPage as the authenticated home
- CharterPage for charter creation/review/display
- TasksPage and AnalyticsPage for operational views
- NotFound for fallback routing
- Index.tsx likely handles the root route and initial redirect behavior.
4. Authenticated app shell
- DashboardLayout and NavLink suggest a shared shell for authenticated sections.
- This is the main UI boundary between public pages and the product workspace.
- Navigation likely switches between dashboard, tasks, analytics, and charter-related screens without leaving the SPA.
5. Core product workflow
- The charter flow is a central domain:
- CharterWizard gathers inputs
- CharterReview validates or confirms the draft
- CharterDisplay renders the final charter
- ProjectDialog, TagInput, and SuggestionChips support project metadata entry and guided input.
6. Decision support / domain logic
- behavior-engine.ts and BurnoutIndicator.tsx indicate a lightweight domain engine that scores or interprets user/project signals.
- charter-generator.ts likely transforms collected inputs into a structured charter.
- This logic sits in src/lib, separate from presentation components, so the UI can stay mostly declarative.
7. Export and document generation
- charter-pdf.ts suggests a browser-side or client-triggered PDF export path for charters.
- This is a distinct output boundary: data is assembled in the app, then rendered into a downloadable document.
8. Data layer and backend integration
- src/integrations/supabase/client.ts is the main backend client entry point.
- src/integrations/supabase/types.ts indicates generated typed schema usage, so UI and lib code likely rely on Supabase table types.
- The supabase/migrations directory shows the data model is managed as database migrations rather than local mocks.
9. Authentication boundary
- src/lib/auth.tsx centralizes auth-related state or helpers.
- Auth.tsx is the user-facing entry point, while the Supabase client handles identity/session persistence.
- This keeps auth concerns separate from the rest of the workspace UI.
10. UI system
- The app uses a component library pattern similar to shadcn/ui: src/components/ui/*.
- Tailwind is present via tailwind.config.ts and postcss.config.js, so styling is utility-driven.
- Shared primitives like dialogs, tabs, inputs, tables, and toasts are reused across the product screens.
11. State, feedback, and responsiveness
- Custom hooks such as use-toast.ts and use-mobile.tsx provide app-wide interaction support.
- Toasts and dialogs are the main ephemeral UI feedback mechanisms.
- Responsive behavior is handled in the client rather than through separate device-specific apps.
12. Testing and quality gates
- The repo includes both unit-style tests (src/test, Vitest config) and browser/E2E setup (playwright.config.ts, playwright-fixture.ts).
- This implies the architecture is tested at two levels: isolated logic/components and end-to-end user flows.
13. Static assets and entrypoints
- index.html, src/main.tsx, and src/index.css form the browser bootstrap path.
- public/robots.txt and the public folder are the only notable static asset surface.
14. How to draw the architecture
- A clear diagram would show:
- Browser SPA on the left
- Route-level pages at the center
- Shared UI/components and domain libs beneath them
- Supabase auth/database on the right as the external backend
- PDF/export as a secondary output path
- Test tooling as a separate quality lane around the app, not part of runtime
Main entry points: Index.tsx Router · CharterPage.tsx Charter · CharterWizard.tsx Wizard · ui UI Primitives
Components 30
Runtime
Browser entry, routing, and top-level pages.
- Bootstrap · Browser entrypoint that mounts the app.
src/main.tsx - Router · Root route selection and initial navigation.
src/pages/Index.tsx - App Shell · Top-level application container and styling boundary.
src/App.tsx - Landing · Marketing and entry surface for unauthenticated users.
src/pages/LandingPage.tsx - Auth · Sign-in and onboarding entry point.
src/pages/Auth.tsx - Not Found · Route fallback for unknown paths.
src/pages/NotFound.tsx
Workspace
Authenticated product surfaces and shared shell.
- Dashboard · Authenticated home and workspace overview.
src/pages/DashboardPage.tsx - Tasks · Operational task management view.
src/pages/TasksPage.tsx - Analytics · Metrics and insight view for the workspace.
src/pages/AnalyticsPage.tsx - Layout · Shared authenticated layout and navigation container.
src/components/DashboardLayout.tsx - Nav Link · Reusable navigation item for the shell.
src/components/NavLink.tsx - UI Primitives · Shared reusable UI building blocks.
src/components/ui - Hooks · App-wide helpers for mobile detection and toast state.
src/hooks
Charter Flow
Guided charter creation, review, and rendering.
- Charter · Charter creation, review, and display surface.
src/pages/CharterPage.tsx - Wizard · Guided input flow for charter creation.
src/components/CharterWizard.tsx - Review · Draft validation and confirmation step.
src/components/CharterReview.tsx - Display · Final charter presentation and rendering.
src/components/CharterDisplay.tsx - Project Dialog · Project metadata entry and editing modal.
src/components/ProjectDialog.tsx - Tag Input · Tag entry control used in charter setup.
src/components/TagInput.tsx - Suggestions · Guided suggestions for faster input.
src/components/SuggestionChips.tsx
Domain Logic
Client-side business logic and export helpers.
- Burnout · Behavior and burnout indicator component.
src/components/BurnoutIndicator.tsx - Auth Lib · Central auth/session helpers and state.
src/lib/auth.tsx - Behavior Engine · Interprets signals into behavior or burnout guidance.
src/lib/behavior-engine.ts - Generator · Transforms collected inputs into a structured charter.
src/lib/charter-generator.ts - PDF Export · Browser-side charter export and document generation.
src/lib/charter-pdf.ts
Supabase
Authentication, typed data access, and database schema.
- Supabase Client · Primary Supabase entrypoint for auth and data access.
src/integrations/supabase/client.ts - DB Types · Typed Supabase schema bindings used by the app.
src/integrations/supabase/types.ts - Migrations · Database schema history managed in Supabase migrations.
supabase/migrations
Quality
Unit and end-to-end test tooling.
- Vitest · Unit and component test harness.
src/test - Playwright · Browser automation and end-to-end test setup.
playwright.config.ts
Connections 43
- Bootstrap → Router: mounts · Bootstraps the SPA and hands control to routing.
- Router → App Shell: renders · Root routing feeds the application shell.
- Router → Landing: route · Public entry surface.
- Router → Auth: route · Authentication entry surface.
- Router → Dashboard: route · Authenticated workspace home.
- Router → Tasks: route · Task management surface.
- Router → Analytics: route · Analytics surface.
- Router → Charter: route · Charter workflow surface.
- Router → Not Found: fallback · Unknown route handling.
- Dashboard → Layout: uses · Dashboard is wrapped by the shared workspace shell.
- Tasks → Layout: uses · Tasks view uses the shared workspace shell.
- Analytics → Layout: uses · Analytics view uses the shared workspace shell.
- Charter → Layout: uses · Charter workspace uses the shared shell.
- Layout → Nav Link: nav · Layout composes reusable navigation links.
- Charter → Wizard: flow · Charter page starts with guided input.
- Charter → Review: flow · Charter page includes review and confirmation.
- Charter → Display: flow · Charter page ends with rendered output.
- Wizard → Project Dialog: input · Wizard opens project metadata dialogs.
- Wizard → Tag Input: input · Wizard collects tags through a dedicated control.
- Wizard → Suggestions: assist · Wizard offers guided suggestions.
- Wizard → Generator: builds · Wizard feeds charter generation logic.
- Review → Behavior Engine: checks · Review step consults behavior scoring and guidance.
- Burnout → Behavior Engine: reads · Burnout indicator visualizes scoring output.
- Display → PDF Export: exports · Final charter can be turned into a PDF artifact.
- Auth → Auth Lib: uses · Auth page relies on centralized auth helpers.
- Dashboard → Auth Lib: guards · Authenticated workspace depends on session state.
- Charter → Auth Lib: guards · Charter workflow depends on session state.
- Auth Lib → Supabase Client: session · Auth helpers are backed by Supabase authentication.
- Supabase Client → DB Types: typed by · Client uses generated database types.
- Migrations → DB Types: defines · Database schema underpins the generated types.
- Supabase Client → Migrations: backed by · Client talks to the schema managed in migrations.
- Dashboard → Burnout: shows · Dashboard can surface behavior/burnout signals.
- Landing → UI Primitives: uses · Public pages share the UI kit.
- Auth → UI Primitives: uses · Auth surfaces use shared primitives.
- Layout → UI Primitives: uses · Workspace shell is built from shared primitives.
- Wizard → UI Primitives: uses · Charter wizard is assembled from shared primitives.
- Review → UI Primitives: uses · Review step is assembled from shared primitives.
- Display → UI Primitives: uses · Display view is assembled from shared primitives.
- Hooks → UI Primitives: supports · Client hooks complement the component kit.
- Vitest → Behavior Engine: tests · Unit tests likely cover core decision logic.
- Vitest → Generator: tests · Unit tests likely cover charter generation.
- Playwright → Router: drives · E2E flows exercise route navigation.
- Playwright → Charter: drives · E2E flows cover the charter workflow.