Frontend
The Strata frontend is built with Astro and React, providing a clean, reactive asset management interface.
| Component | Technology | Purpose |
|---|---|---|
| Framework | Astro 6 | SSR routing, static page generation |
| UI Library | React 19 | Interactive component islands (client:load) |
| Styling | Tailwind CSS 4 | Utility-first CSS, @theme custom properties |
| Components | shadcn/ui-inspired | Accessible, unstyled UI primitives |
| Charts | Recharts | Data visualization (net worth timeline, allocation pie) |
| State | TanStack React Query | Server state, caching, background refetch |
| HTTP | Axios | Typed API client |
| Testing | Vitest + Playwright | Unit and end-to-end coverage |
Directory Structure
Section titled “Directory Structure”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)| Route | Description |
|---|---|
/ | Dashboard — net worth chart, allocation chart, recent snapshots |
/assets | Asset list with search, filters, create, and sortable columns |
/assets/:id | Asset detail — snapshots, transactions, tags, categories |
/categories | Category tree with CRUD |
/tags | Tag list with CRUD |
/financing | Save financing assumptions and compare cash, partial down payment, and full loan options |
/settings | Theme toggle, backup export/import |
Asset list sorting
Section titled “Asset list sorting”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.
Financing Scenarios
Section titled “Financing Scenarios”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.
Portfolio Snapshots
Section titled “Portfolio Snapshots”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.
Design System
Section titled “Design System”- 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
Data Flow
Section titled “Data Flow”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]
Running Locally
Section titled “Running Locally”cd frontnpm installnpm run dev # Development server at http://localhost:6543npm run build # Production buildnpm run preview # Preview production buildnpm test # Vitest unit testsnpm run test:e2e # Playwright E2E tests