A voice-powered expense tracker built with React β manage income, expenses, and budgets with real-time charts and voice commands.
Track your daily finances effortlessly. Add transactions by typing or speaking naturally. All data stays in your browser β zero backend, complete privacy.
- Features
- Architecture
- Tech Stack
- Getting Started
- Usage
- Project Structure
- Voice Commands
- Contributing
| Feature | Description |
|---|---|
| Voice-Powered Input | Add transactions by speaking naturally using Speechly AI voice recognition |
| Income & Expense Tracking | Categorize transactions as income or expense with custom categories |
| Real-Time Charts | Visual breakdown of spending patterns using Chart.js doughnut charts |
| Material Design UI | Clean, responsive interface built with Material-UI components |
| Category System | Pre-built categories for both income (Salary, Investments, Businessβ¦) and expenses (Shopping, Food, Travelβ¦) |
| Transaction History | Searchable list with date, amount, category, and type |
| Balance Calculator | Real-time income, expense, and net balance computation |
| Local Storage | All data persists in browser β no account or backend required |
| UUID Tracking | Each transaction assigned a unique ID for reliable management |
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β App.js β
β (Root Component) β
ββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ€
β β β
β Details/ β Main/ β
β ββββββββββββ β ββββββββββββββ¬βββββββββββββββ β
β β Income β β β Form.jsx β List.jsx β β
β β Card β β β (Add new β (Transactionβ β
β β β β β entries) β history) β β
β β Expense β β β β β β
β β Card β β β Speechly β Delete / β β
β β β β β Voice AI β Filter β β
β β Chart.js β β β β β β
β β Doughnut β β ββββββββββββββ΄βββββββββββββββ β
β ββββββββββββ β β
ββββββββββββββββββ΄βββββββββββββββββββββββββββββββββ€
β Context API + useReducer β
β (Global State Management) β
βββββββββββββββββββββββββββββββββββββββββββββββββββ€
β localStorage (Persistence) β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
| Component | Technology | Version | Role |
|---|---|---|---|
| UI Framework | React | 16.12 | Component-based frontend framework |
| Component Library | Material-UI (Core + Icons + Lab) | 4.12.4 | Pre-built UI components, icons, theming |
| Charting | Chart.js + react-chartjs-2 | 3.8.0 / 4.2.0 | Doughnut charts for income/expense visualization |
| Voice AI | Speechly (react-client + react-ui) | 2.1.2 / 2.7.0 | Natural language voice input for transactions |
| State Management | React Context API + useReducer |
β | Global state without external libraries |
| ID Generation | uuid | 8.3.2 | Unique transaction identifiers |
| Build Tool | Create React App (react-scripts) | 5.0.1 | Development server, bundling, testing |
| Language | JavaScript (ES6+) | β | Core language with modern syntax |
- Node.js 14+ and npm 6+
- A modern browser (Chrome, Firefox, Edge)
# Clone the repository
git clone https://github.com/cazy8/KHARCHA--expense-tracker.git
cd KHARCHA--expense-tracker
# Install dependencies
npm install
# Start the development server
npm startThe app will open at http://localhost:3000
npm run build- Select Income or Expense type
- Choose a category (e.g., Salary, Shopping, Food)
- Enter the amount
- Add an optional date
- Click Create or use voice input
- Left Panel β Income total, expense total, and Chart.js doughnut charts showing category-wise breakdown
- Right Panel β Form to add new transactions + scrollable transaction history
KHARCHA integrates Speechly AI for hands-free transaction entry. Speak naturally:
| Example Voice Command | Action |
|---|---|
| "Add income of 5000 in Salary" | Creates βΉ5,000 income under Salary |
| "Add expense of 200 for Food" | Creates βΉ200 expense under Food |
| "Add expense of 1500 in Shopping" | Creates βΉ1,500 expense under Shopping |
Voice recognition powered by Speechly β works directly in the browser.
KHARCHA--expense-tracker/
βββ public/
β βββ index.html # HTML entry point
βββ src/
β βββ App.js # Root component β layout orchestration
β βββ index.js # React DOM entry β Speechly provider wrapping
β βββ index.css # Global styles
β βββ styles.js # Material-UI theme / makeStyles
β β
β βββ components/
β β βββ Details/
β β β βββ Details.jsx # Income/Expense cards with Chart.js doughnut
β β β βββ styles.js # Details component styling
β β βββ Main/
β β βββ Main.jsx # Main panel layout
β β βββ styles.js # Main component styling
β β βββ Form/
β β β βββ Form.jsx # Transaction input form + Speechly voice
β β β βββ styles.js # Form styling
β β βββ List/
β β βββ List.jsx # Transaction history list
β β βββ styles.js # List styling
β β
β βββ context/
β β βββ context.js # React Context provider
β β βββ contextReducer.js # useReducer β ADD, DELETE transaction actions
β β
β βββ constants/
β β βββ categories.js # Income & expense category definitions
β β
β βββ utils/
β β βββ formatDate.js # Date formatting utility
β β
β βββ useTransactions.js # Custom hook β transaction filtering & totals
β β
β βββ assets/
β βββ background.jpg # App background images
β βββ background1.png
β βββ background2.jpg
β
βββ package.json # Dependencies and scripts
βββ README.md # Documentation
Uses React Context API with useReducer for global state β no Redux or external state libraries needed:
// contextReducer.js
const contextReducer = (state, action) => {
switch (action.type) {
case 'ADD_TRANSACTION':
return [...state, action.payload];
case 'DELETE_TRANSACTION':
return state.filter((t) => t.id !== action.payload);
default:
return state;
}
};useTransactions.js provides a clean interface to filter and compute totals:
// Filter by type, compute category-wise breakdown
const { total, chartData } = useTransactions('Income');Contributions are welcome! Ideas for improvement:
- π Dark Mode β Material-UI theme toggling
- π Monthly Reports β Time-series expense charts
- π± Multi-Currency β Currency conversion support
- π± PWA Support β Installable Progressive Web App
- π€ CSV Export β Download transaction history
git checkout -b feature/your-featureHarsh Gupta β @cazy8 Β· LinkedIn
If you found this useful, consider giving it a β