Skip to content

cazy8/KHARCHA--expense-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 

Repository files navigation

πŸ’Έ KHARCHA β€” Smart Expense Tracker

React Material-UI Chart.js JavaScript Speechly

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.


πŸ“‹ Table of Contents


πŸš€ Features

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

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   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)           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

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

πŸ“¦ Getting Started

Prerequisites

  • Node.js 14+ and npm 6+
  • A modern browser (Chrome, Firefox, Edge)

Installation

# 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 start

The app will open at http://localhost:3000

Build for Production

npm run build

βš™οΈ Usage

Adding a Transaction

  1. Select Income or Expense type
  2. Choose a category (e.g., Salary, Shopping, Food)
  3. Enter the amount
  4. Add an optional date
  5. Click Create or use voice input

Reading the Dashboard

  • 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

🎀 Voice Commands

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.


πŸ“ Project Structure

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

πŸ”§ Key Implementation Details

State Management

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;
  }
};

Custom Hook Pattern

useTransactions.js provides a clean interface to filter and compute totals:

// Filter by type, compute category-wise breakdown
const { total, chartData } = useTransactions('Income');

🀝 Contributing

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-feature

πŸ‘€ Author

Harsh Gupta β€” @cazy8 Β· LinkedIn


If you found this useful, consider giving it a ⭐

About

Voice-powered expense tracker built with React, Material-UI, Chart.js and Speechly AI. Track income, expenses and budgets with real-time charts and voice commands. Privacy-first, zero backend.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors