Skip to content
Strata v1.6.3

Frontend

The Strata frontend is built with Astro and React, providing a clean, reactive asset management interface.

ComponentTechnologyPurpose
FrameworkAstro 6SSR routing, static page generation
UI LibraryReact 19Interactive component islands (client:load)
StylingTailwind CSS 4Utility-first CSS, @theme custom properties
Componentsshadcn/ui-inspiredAccessible, unstyled UI primitives
ChartsRechartsData visualization (net worth timeline, allocation pie)
StateTanStack React QueryServer state, caching, background refetch
HTTPAxiosTyped API client
TestingVitest + PlaywrightUnit and end-to-end coverage
front/src/
├── components/
│ ├── ui/ ← Reusable UI primitives (Button, Card, Table, Badge…)
│ ├── layout/ ← AppShell, Sidebar, Header, VersionBadge
│ ├── dashboard/ ← Dashboard widgets (NetWorthChart, AllocationChart, SnapshotTable)
│ ├── assets/ ← Asset list, detail, create/edit forms
│ ├── financing/ ← Saved financing scenarios, input form, comparison and timelines
│ ├── categories/ ← Category tree with CRUD
│ ├── tags/ ← Tag list with CRUD
│ └── settings/ ← Theme toggle, backup export/import, About
├── pages/ ← Astro .astro page routes
├── layouts/ ← MainLayout.astro
├── lib/
│ ├── api/ ← Axios API clients (assets, snapshots, categories…)
│ ├── hooks/ ← React Query hooks
│ └── version.ts ← Auto-generated version info (git-ignored)
└── stores/ ← Zustand stores (theme, backup state)
RouteDescription
/Dashboard — net worth chart, allocation chart, recent snapshots
/assetsAsset list with search, filters, create, and sortable columns
/assets/:idAsset detail — snapshots, transactions, tags, categories
/categoriesCategory tree with CRUD
/tagsTag list with CRUD
/financingSave financing assumptions and compare cash, partial down payment, and full loan options
/settingsTheme toggle, backup export/import

The Assets page supports client-side sorting from the arrow in each sortable column header: Name, Type, Current Value, Categories, Tags, and Status. Name is sorted A–Z by default; clicking the active header reverses the direction. Text columns sort alphabetically, Current Value sorts numerically, and empty category/tag values or missing current values remain last.

The Financing page uses saved scenario inputs and React Query to display three options. Users explicitly mark assets available and set each eligible asset’s return assumption. Comparison cards show financing cost, return difference, final projected savings, and reserve warnings. Each financing option’s timeline appears in its own full-width card, stacked vertically; yearly checkpoints and monthly asset-level details remain available in the cards. Saving or recalculating a scenario does not create an accounting record.

The dashboard’s Take Snapshot button (or POST /api/v1/portfolio-snapshots) computes the current net worth by summing the latest AssetSnapshot.value for every non-disposed asset and saves the result as a PortfolioSnapshot. This record feeds the net worth timeline chart.

GET /api/v1/portfolio-snapshots/current-value returns the live computed value without persisting a snapshot — useful for displaying the current total in the UI without creating a new data point.

  • Dark + Light themes with system preference detection
  • CSS custom properties for all colors via Tailwind @theme
  • Consistent component API across all UI primitives
  • Responsive layout with collapsible sidebar

Pages are Astro routes that render React components as interactive islands:

flowchart TD
    A[Astro Page\n.astro route] --> B[React Component\nclient:load island]
    B --> C[React Query Hook\nuseAssets, useSnapshots, etc.]
    C --> D[API Client\nAxios]
    D --> E[NestJS Backend\nhttp://localhost:3000/api/v1]
Terminal window
cd front
npm install
npm run dev # Development server at http://localhost:6543
npm run build # Production build
npm run preview # Preview production build
npm test # Vitest unit tests
npm run test:e2e # Playwright E2E tests