Skip to content

waqas1412/React-Expense-Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ฐ React Expense Tracker

A modern, responsive expense tracking application built with React that helps you manage and visualize your personal finances with beautiful charts and intuitive filtering.

React JavaScript CSS3 License

โœจ Features

  • ๐Ÿ“Š Interactive Charts: Visualize your spending patterns with dynamic bar charts
  • ๐Ÿ” Smart Filtering: Filter expenses by year with real-time updates
  • ๐Ÿ“ฑ Responsive Design: Works seamlessly on desktop, tablet, and mobile devices
  • ๐ŸŽจ Modern UI: Clean, dark-themed interface with smooth animations
  • โšก Real-time Updates: Add new expenses and see changes instantly
  • ๐Ÿ“… Date Management: Easy date selection with validation
  • ๐Ÿ’พ Local State Management: Efficient React state management with hooks

๐Ÿš€ Live Demo

View Live Demo (Add your deployment link here)

๐Ÿ“ธ Screenshots

Main Dashboard

Dashboard

Add New Expense

Add Expense

Filtered View

Filtered View

๐Ÿ› ๏ธ Tech Stack

  • Frontend Framework: React 18.2.0
  • Language: JavaScript (ES6+)
  • Styling: CSS3 with custom components
  • State Management: React Hooks (useState)
  • Build Tool: Create React App
  • Testing: Jest & React Testing Library

๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ Charts/
โ”‚   โ”‚   โ”œโ”€โ”€ Chart.js          # Main chart component
โ”‚   โ”‚   โ””โ”€โ”€ ChartBar.js       # Individual chart bars
โ”‚   โ”œโ”€โ”€ Expenses/
โ”‚   โ”‚   โ”œโ”€โ”€ Expenses.js       # Main expenses container
โ”‚   โ”‚   โ”œโ”€โ”€ ExpenseItem.js    # Individual expense display
โ”‚   โ”‚   โ”œโ”€โ”€ ExpenseDate.js    # Date formatting component
โ”‚   โ”‚   โ”œโ”€โ”€ ExpenseFilter.js  # Year filtering component
โ”‚   โ”‚   โ”œโ”€โ”€ ExpensesList.js   # List rendering component
โ”‚   โ”‚   โ””โ”€โ”€ ExpensesChart.js  # Chart data processing
โ”‚   โ”œโ”€โ”€ NewExpense/
โ”‚   โ”‚   โ”œโ”€โ”€ NewExpense.js     # Add expense container
โ”‚   โ”‚   โ””โ”€โ”€ ExpenseForm.js    # Expense input form
โ”‚   โ””โ”€โ”€ UI/
โ”‚       โ””โ”€โ”€ Card.js           # Reusable card component
โ”œโ”€โ”€ App.js                    # Main application component
โ””โ”€โ”€ index.js                  # Application entry point

๐Ÿš€ Getting Started

Prerequisites

  • Node.js (version 14 or higher)
  • npm or yarn package manager

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/react-expense-tracker.git
    cd react-expense-tracker
  2. Install dependencies

    npm install
  3. Start the development server

    npm start
  4. Open your browser Navigate to http://localhost:3000

Available Scripts

  • npm start - Runs the app in development mode
  • npm test - Launches the test runner
  • npm run build - Builds the app for production
  • npm run eject - Ejects from Create React App (one-way operation)

๐Ÿ’ก Usage

Adding Expenses

  1. Click the "Add new Expense" button
  2. Fill in the expense details:
    • Title: Description of the expense
    • Amount: Cost in dollars
    • Date: When the expense occurred
  3. Click "Add Expense" to save

Filtering Expenses

  • Use the year dropdown to filter expenses by specific years
  • The chart and expense list update automatically
  • View spending patterns across different time periods

Viewing Charts

  • The bar chart shows monthly spending totals
  • Hover over bars to see detailed amounts
  • Chart automatically scales based on your data

๐ŸŽฏ Key Features Explained

Component Architecture

The application follows a modular component structure:

  • Container Components: Manage state and data flow
  • Presentational Components: Handle UI rendering
  • Reusable Components: Card, Chart, and Form elements

State Management

  • Uses React's useState hook for local state management
  • Efficient state updates with functional updates
  • Proper prop drilling for data flow

Responsive Design

  • Mobile-first approach with CSS media queries
  • Flexible layouts that adapt to different screen sizes
  • Touch-friendly interface elements

๐Ÿค Contributing

We welcome contributions! Please feel free to submit a Pull Request.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Guidelines

  • Follow the existing code style and conventions
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting

๐Ÿ› Known Issues

  • Currently no persistent storage (data resets on page refresh)
  • Limited to year-based filtering
  • No export functionality

๐Ÿ”ฎ Roadmap

  • Add local storage for data persistence
  • Implement category-based filtering
  • Add expense editing and deletion
  • Export data to CSV/PDF
  • Dark/Light theme toggle
  • Multiple currency support
  • Budget tracking features
  • PWA capabilities

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built with Create React App
  • Icons and styling inspiration from modern design systems
  • Community feedback and suggestions

๐Ÿ“ž Support

If you have any questions or need help, please:


Made with โค๏ธ using React

GitHub stars GitHub forks GitHub issues

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors