A production-ready, TypeScript-based frontend for ExpenseFlow: an expense-tracking web application built with Next.js (App Router), TanStack Query, Zod, and Tailwind CSS. Designed for clarity, developer ergonomics, and easy integration with a FastAPI backend.
- Status: Active development
- Tech: Next.js 16+, React, TypeScript, Tailwind CSS, Axios, TanStack Query
--
Prerequisites
- Node.js 18+ and npm or pnpm
- Running backend (see docs/API_DOCS.md)
Getting running locally
npm install
cp .env.example .env.local # create env from example (or create .env.local)
# set NEXT_PUBLIC_API_URL in .env.local
npm run devBuild for production
npm run build
npm run startUseful commands
npm run dev— start dev servernpm run build— build appnpm run lint— run linternpm run format— run formatter
--
High-level responsibilities
app/— Next.js App Router routes, layouts, and global UIcomponents/— Reusable UI components (auth, category, layout, ui primitives)lib/— Low-level helpers (axios client, auth helpers, validations)hooks/— Custom React hooks and React Query wrappersservices/— Thin API clients calling the backendproviders/— App-wide providers (Auth, Query, Theme)docs/— API docs and design notes
See docs/API_DOCS.md for backend contract details.
--
- Routing: Next.js App Router with nested layouts for
(auth)and(dashboard)areas. - Auth: Edge middleware checks
tokencookie and redirects to/loginwhen required. - Data: TanStack React Query for fetching/caching; services encapsulate HTTP calls using an
axiosinstance with auth interceptors. - Validation: Zod schemas live under
lib/validationsand are used with React Hook Form. - Styling: Tailwind CSS tokens are defined in
app/globals.cssand shared UI primitives live incomponents/ui.
--
- Add types in
types/for new domain entities. - Add Zod schema under
lib/validationsand plug into forms withzodResolver. - Add service methods in
services/(pure async API calls using shared axios). - Expose data through a hook in
hooks/using React Query for caching and mutations. - Create presentational components under
components/and assemble pages inapp/.
Testing & format
- Follow existing lint/format scripts in
package.json.
--
- Global CSS and Tailwind tokens:
app/globals.css— adjust color tokens and utilities here. - Theme provider:
providers/ThemeProvider.tsx(if present) controls light/dark modes; update CSS variables accordingly.
--
- Fork and create a topic branch
- Open a PR with a clear summary and screenshots for UI changes
- Keep changes focused and add tests for logic where applicable
--
- Authentication flow:
middleware.tsandlib/auth.ts - API client & interceptors:
lib/axios.tsandservices/ - Layouts and global UI:
app/layout.tsx,components/layout,components/ui
--
MIT
--
If you'd like, I can now:
- polish developer docs under
docs/ - propose UI improvements and a Tailwind theme
- implement a visual refresh (components + globals.css)
Tell me which of those to do next.