Skip to content
Strata v1.2.6

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 (306) + E2E tests
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
│ ├── 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
/assets/:idAsset detail — snapshots, transactions, tags, categories
/categoriesCategory tree with CRUD
/tagsTag list with CRUD
/settingsTheme toggle, backup export/import

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:4321
npm run build # Production build
npm run preview # Preview production build
npm test # Vitest unit tests
npm run test:e2e # Playwright E2E tests