A modern, real-time expense tracking application built with React, TypeScript, and Firebase. Track your daily expenses, visualize spending patterns, and manage your finances with an intuitive and beautiful interface.
π Live Demo: https://expense-if.netlify.app/
- π Authentication: Secure user registration and login with Firebase Authentication
- π Expense Tracking: Add, edit, and delete expenses with ease
- π Real-time Analytics: View expense summaries and category-wise breakdowns
- π Visual Charts: Interactive charts powered by Recharts to visualize spending patterns
- π·οΈ Category Management: Organize expenses into 7 predefined categories:
- Food & Dining
- Transport
- Entertainment
- Shopping
- Utilities
- Health
- Other
- π Monthly Overview: Track monthly spending with summary cards showing total expenses and current month's spending
- β‘ Real-time Sync: All data is synced in real-time using Firebase Firestore
- π¨ Modern UI: Clean, responsive design using shadcn/ui and Tailwind CSS
- π Dark Mode Support: Built-in theme support for dark and light modes
- π± Fully Responsive: Works seamlessly on desktop, tablet, and mobile devices
- React 18.3: UI framework
- TypeScript 5.8: Type safety
- Vite 5.4: Lightning-fast build tool
- Tailwind CSS 3.4: Utility-first CSS framework
- shadcn/ui: High-quality React components
- React Router v6: Client-side routing
- React Hook Form: Efficient form handling
- Zod: Schema validation
- Firebase: Backend-as-a-service platform
- Authentication: User sign-up and login
- Firestore: Real-time NoSQL database
- Analytics: User activity tracking
- Recharts 2.15: Data visualization
- React Query 5.83: Server state management
- Lucide React: Beautiful icon library
- Sonner: Toast notifications
- date-fns 3.6: Date manipulation and formatting
- Zod 3.25: TypeScript-first schema validation
- next-themes: Theme management (dark/light mode)
- ESLint: Code quality linting
- TypeScript: Static type checking
- PostCSS: CSS transformations
- Autoprefixer: Browser compatibility
Expense-IF/
βββ src/
β βββ components/
β β βββ ui/ # shadcn/ui components
β β βββ ExpenseForm.tsx # Form for adding/editing expenses
β β βββ ExpenseList.tsx # Display list of expenses
β β βββ ExpenseChart.tsx # Visualization component
β β βββ SummaryCards.tsx # Summary statistics
β β βββ Header.tsx # Navigation header
β β βββ layout/
β β βββ ProtectedRoute.tsx # Route protection for authenticated users
β βββ hooks/
β β βββ useExpenses.ts # Custom hook for expense management
β β βββ useAuth.ts # Authentication hook
β β βββ use-mobile.tsx # Mobile detection hook
β βββ pages/
β β βββ Index.tsx # Landing page
β β βββ Dashboard.tsx # Main expense dashboard
β β βββ login.tsx # Login page
β β βββ signup.tsx # Registration page
β β βββ NotFound.tsx # 404 page
β βββ services/
β β βββ userService.ts # User-related API calls
β βββ types/
β β βββ expense.ts # TypeScript interfaces and types
β βββ lib/
β β βββ utils.ts # Utility functions
β βββ firebase.ts # Firebase configuration
β βββ App.tsx # Root component with routing
β βββ main.tsx # Entry point
β βββ App.css # Global styles
β βββ index.css # Tailwind CSS imports
βββ public/
β βββ favicon.ico
β βββ robots.txt
β βββ _redirects # Netlify routing configuration
βββ package.json # Project dependencies
βββ vite.config.ts # Vite configuration
βββ tsconfig.json # TypeScript configuration
βββ tailwind.config.ts # Tailwind CSS configuration
βββ postcss.config.js # PostCSS configuration
βββ eslint.config.js # ESLint configuration
βββ components.json # shadcn/ui configuration
βββ netlify.toml # Netlify deployment configuration
βββ index.html # HTML entry point
- Node.js (v16 or higher)
- npm or yarn
- A Firebase project (for database and authentication)
-
Clone the repository
git clone https://github.com/subinita01/Expense-IF.git cd Expense-IF -
Install dependencies
npm install # or yarn install -
Set up Firebase Configuration (Optional for local development)
- The project already has Firebase credentials configured
- If you want to use your own Firebase project:
- Update the
firebaseConfiginsrc/firebase.tswith your credentials
- Update the
-
Start the development server
npm run dev # or yarn dev -
Open in browser
- Navigate to
http://localhost:8080
- Navigate to
npm run build
# or
yarn buildnpm run preview
# or
yarn preview- Visit the home page to see project information
- Click on "Login" or "Sign Up" to get started
- Fill in your email and password
- Click "Sign Up" to create a new account
- Your account data is securely stored in Firebase
- Click on the "Add Expense" button in the dashboard
- Fill in the details:
- Title: Short description of the expense
- Amount: Expense amount
- Category: Select from predefined categories
- Date: Pick the date of the expense
- Description (optional): Additional notes
- Click "Save" to add the expense
- All expenses are displayed in a table format
- Summary cards show:
- Total expenses (all time)
- This month's total
- Total number of expense records
- Click the edit icon to modify an existing expense
- Click the delete icon to remove an expense
- Changes sync in real-time across all sessions
- View category-wise spending distribution in the chart
- Identify spending patterns and manage your budget accordingly
The app uses Firebase Authentication with email and password:
- Sign Up: Create a new account with email and password
- Login: Sign in with your credentials
- Protected Routes: Dashboard is only accessible to authenticated users
- Auto-redirect: Unauthenticated users are redirected to the login page
interface Expense {
id: string; // Unique identifier (Firestore doc ID)
title: string; // Expense title
amount: number; // Expense amount
category: Category; // One of 7 categories
date: string; // ISO date format (YYYY-MM-DD)
description?: string; // Optional notes
}
type Category =
| "food"
| "transport"
| "entertainment"
| "shopping"
| "utilities"
| "health"
| "other";users/
βββ {userId}/
βββ expenses/
βββ {expenseId}
βββ title: string
βββ amount: number
βββ category: string
βββ date: string
βββ description: string (optional)
Edit the CATEGORIES array in src/types/expense.ts:
export const CATEGORIES = [
{ value: "food", label: "Food & Dining", color: "hsl(var(--category-food))" },
// Add more categories here
];- Edit CSS variables in
src/index.css - Tailwind CSS configuration in
tailwind.config.ts
- The app supports light and dark modes
- Theme toggle is available in the header component
- Firestore Real-time Listeners: Expenses update instantly across all devices
- Live Status Indicator: Shows when the app is connected and last update time
- Automatic Sync: Changes are automatically synchronized with the database
- Mobile: Touch-friendly interface optimized for phones
- Tablet: Adjusted layout for medium screens
- Desktop: Full-featured layout for larger screens
- Built with mobile-first approach using Tailwind CSS
The project is configured for Netlify deployment:
- Connect your GitHub repository to Netlify
- Configure build settings:
- Build Command:
npm run build - Publish Directory:
dist
- Build Command:
- Deploy
The project includes:
netlify.toml: Deployment configurationpublic/_redirects: SPA routing configuration
- Vercel: Works seamlessly with Vite
- GitHub Pages: Configure with appropriate base URL
- Self-hosted: Build and serve the
distfolder
The app performs the following Firebase operations:
signUp(email, password) // Create new account
signIn(email, password) // Login
signOut() // Logout
getCurrentUser() // Get authenticated useraddExpense(expenseData) // Create new expense
getExpenses() // Read all user expenses (real-time)
updateExpense(id, data) // Update expense
deleteExpense(id) // Delete expense- Ensure you're logged in
- Check Firebase configuration in
src/firebase.ts - Verify Firestore rules allow read/write access
- Check your internet connection
- Verify Firestore is accessible
- Reload the page
- Ensure email is valid
- Password should be at least 6 characters
- Clear browser cache if issue persists
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
Subinita - GitHub Profile
- shadcn/ui for amazing React components
- Firebase for real-time backend services
- Recharts for beautiful data visualizations
- Tailwind CSS for utility-first CSS framework
- React Router for client-side routing
Potential features for future versions:
- Expense filtering and search
- Budget setting and tracking
- Recurring expenses
- Multi-currency support
- Export to CSV/PDF
- Mobile app (React Native)
- Integration with payment methods
- Expense splitting (shared expenses)
- Expense reminders and notifications
- Advanced analytics and reports
For issues, questions, or suggestions:
- Open an issue on GitHub Issues
- Check the Live Demo
- React Documentation
- Firebase Documentation
- TypeScript Documentation
- Vite Documentation
- Tailwind CSS Documentation
- shadcn/ui Documentation
Happy Expense Tracking! π³β¨