React frontend for the self-hosted personal finance tracker. Pairs with finance-tracker-api.
Stack: React 18 + Vite + Tailwind + TanStack Query + Recharts + Zustand.
cp .env.example .env
# Set VITE_API_URL=http://localhost:4000 (or wherever your API runs)
pnpm install
pnpm devVite dev server runs on http://localhost:5173. Make sure the API is running and WEB_ORIGIN on the API matches that origin.
pnpm typecheck
pnpm lint
pnpm build # outputs to dist/
pnpm preview # serves dist/ locally# Build with a baked-in API URL
docker build --build-arg VITE_API_URL=https://your-api.example.com -t finance-tracker-web .
docker run -p 8080:80 finance-tracker-webOr via docker-compose (assumes your API runs separately):
VITE_API_URL=http://localhost:4000 docker compose up -d --buildOpen http://localhost:8080.
- Create a new service from this repo. Railway auto-detects
Dockerfileviarailway.json. - Set the build-time variable
VITE_API_URLto your API's public URL (e.g.https://fintrack-api.amardito.dev). - Set up a public domain for the web service.
- On the API service, set
WEB_ORIGINto this web service's public URL so CORS and cookies work end-to-end.
- First visit: pick Generate new to create an anonymous account. The token is shown ONCE — save it.
- Subsequent visits / other devices: pick Sync token and paste your raw token.
- Tokens are kept in
localStorageas a list (web3-wallet style). The login page lets you switch between accounts. - In Settings → Profile you can rotate the token (revokes the old one immediately).
Default currency is configurable on the API (DEFAULT_CURRENCY env). Frontend uses Intl.NumberFormat with id-ID locale for IDR (dot thousands separator). The MoneyInput component formats amounts as you type.