A complete budgeting frontend that works with any REST API matching the described contract or entirely offline in mock mode. It includes authentication, dashboards, CRUD pages, charts powered by Recharts, responsive layout, and plain CSS styling—no UI libraries required.
- Authentication flow with persistent sessions (token + user stored in
localStorage) - Protected routes via React Router v6 and an
AuthContext - Axios API layer with automatic
Authorizationheaders and mock mode fallback - Pages: Login, Register, Dashboard, Transactions, Categories
- Components: Navbar, ProtectedRoute, TransactionForm/List, CategoryForm, BalanceCard, IncomeExpenseCard, CategoryChart, IncomeExpenseChart, NetBalanceChart, RecentTransactions (Recharts + Framer Motion)
- Dashboard analytics: total balance, income/expense summary, pie chart by category, line & bar charts for monthly trends (all values displayed in Indian Rupees)
- Transactions CRUD with filters (type, category, date range) and sorting (date/amount), all amounts formatted as ₹ using Indian numbering
- Category CRUD with color tagging
- date-fns utilities for formatting and filtering dates
- Responsive layout built using plain CSS (flexbox/grid)
- Vite + React 18
- React Router DOM
- Axios
- Recharts for data viz
- Framer Motion for smooth transitions
- date-fns for date handling
├── public/
├── src/
│ ├── components/ # Navbar, cards, charts, forms, lists
│ ├── context/ # AuthContext
│ ├── mock/ # Mock data + API implementation
│ ├── pages/ # Login, Register, Dashboard, etc.
│ ├── services/ # Axios client + API helpers
│ ├── App.jsx / App.css # Router + layout styles
│ └── main.jsx # App bootstrap
└── README.md
npm install
npm run devVisit the local URL printed by Vite (typically http://localhost:5173).
npm run dev– start Vite dev server with HMRnpm run build– production buildnpm run preview– serve the production build locally
Create a .env file (or copy .env.example) with:
VITE_API_URL=http://localhost:4000/api
# Mock mode is enabled by default. Set to "false" to hit a backend.
VITE_USE_MOCK=true
VITE_API_URL: Base URL for all API requests.VITE_USE_MOCK: Whentrue(default), all API calls are served by the local mock service so the UI works without a backend. Set tofalseto talk to your API.
Mock mode supplies in-memory categories, transactions, and summary statistics with small artificial delays to mimic network calls. Data persists for the session (page refresh resets it). The mock API implements the exact endpoints used by the app, so switching to a real backend only requires setting VITE_USE_MOCK=false.
The Axios service targets the following REST endpoints (all prefixed by VITE_API_URL, default http://localhost:4000/api):
POST /auth/registerPOST /auth/loginGET /categoriesPOST /categoriesPUT /categories/:idDELETE /categories/:idGET /transactionsPOST /transactionsPUT /transactions/:idDELETE /transactions/:idGET /transactions/summary
Responses should be JSON. Transactions should include at least id, type, amount, date, and categoryId; summaries should include totals, monthly trend data, and category breakdowns (the mock implementation is a reference).
All styling lives in src/App.css and src/index.css, using CSS custom properties, flexbox, and CSS grid. No UI kits or preprocessors are required, so the project remains lightweight and easy to customize.
This project is provided as-is under the MIT License. Modify freely for your budgeting needs.