C
Clarity
Internal product snapshot

Living document

App status, architecture, and direction

Clarity is a web application for founders, bookkeepers, and finance operators who need multi-entity visibility without traditional accounting software weight. Bank data flows in through Plaid; tagging and rules organize activity by company; AI assists with summaries and classification; Stripe handles subscriptions. This page summarizes how the repo is structured today and where the product is headed.

Essence

What the app does

Users authenticate with Supabase Auth (JWT in the browser, validated on the Node server). They connect institutions via Plaid, sync transactions and balances, assign company tags to accounts and transactions, and view dashboards, cashflow, reports, and planning views. An OpenAI-backed layer exposes metrics, chat, insights, and category suggestions. Stripe manages checkout, the customer portal, and webhooks for subscription state. Plan limits (starter / growth / pro) gate account counts, company tags, and planning access via planLimits.js on the client.

Current status

Shipping shape in this repository

Backend

Single Express app in server.js with modular routers under routes/ (AI, reports, tags, transactions). Hardened session cookies, Helmet CSP, rate limits on writes, Plaid and Stripe integrations, cron hook for refresh.

Frontend

Static HTML + JS in public/. Legacy workspace pages remain the default for most flows. A v2 shell (shared auth, API client, layout CSS) is documented in docs/clarity-frontend-architecture.md with all workspace pages now on the v2 shell.

Data

Supabase for Postgres-backed app data and auth user resolution; connect-pg-simple for session storage in Postgres; schema health checks and tests under test/.

Workflows

Primary user journeys

  1. Acquisition: Marketing site (index.html), FAQ, support, invest deck → signup.html → Supabase sign-up → redirect to onboarding.
  2. Onboarding checklist: Billing (Stripe) → bank connections (accounts.html, Plaid link) → company tagging in settings → dashboard for insights.
  3. Daily use: Review dashboard.html, drill into transactions.html, use reports.html / cashflow.html / planning.html, ask questions in ai.html, manage billing.html and settings.html.
  4. Automation: Transaction rules and tag suggestions (bulk accept/reject APIs), optional AI bulk categorization, reconnect flows when Plaid items need update (/status/needs-reconnect).
  5. Admin: Restricted routes under /admin/* and admin HTML for operator tools.
User interface & features

Surface map (public/*.html)

Workspace

  • dashboard.html — home metrics and entry to insights
  • transactions.html / transactions2.html — ledger-style views
  • accounts.html — Plaid connections, balances
  • reports.html, cashflow.html, planning.html
  • ai.html — AI assistant and insights
  • settings.html, billing.html
  • Legacy suffixed pages (e.g. *-legacy.html) for rollback / comparison

Auth, growth, misc

  • login.html, signup.html, onboarding.html
  • index.html, beta.html, faq.html, support.html, invest.html
  • mobile.html, testing.html, admin.html, admin-backend.html

Shared client layer: public/js/core/auth.js (ClarityAuth), public/js/core/api.js (ClarityApi), public/js/ui/format.js, shell.js, v2-page.js; styles in clarity-v2-shell.css and built Tailwind clarity-tailwind.css.

Roadmap (indicative)

Direction implied by codebase and product materials

These items are inferred from architecture notes and internal planning copy (for example invest.html use-of-funds); they are not a committed schedule.

Stack

Technology summary

Update this file when major routes, pages, or integrations change so newcomers have a single HTML overview.