Skip to content

daxp472/Expense_Odoo

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ’° Expense Management System

The Ultimate Financial Tracking Solution

Demo Video License Node.js React Supabase


πŸš€ Transform Your Financial Management Experience

A cutting-edge, full-stack expense management application designed for modern businesses and individuals who demand excellence in financial tracking and approval workflows.


🎯 Key Features

πŸ” Authentication πŸ’Ό Expense Management πŸ“Š Analytics ⚑ Workflow
Secure Supabase Auth Create & Track Expenses Visual Dashboard Multi-level Approvals
Multi-tenant Support Receipt OCR Scanning Real-time Reports Role-based Access
Session Management Multi-currency Support Export Capabilities Automated Notifications

✨ Complete Feature Set

🏒 Enterprise-Grade Authentication

  • πŸ”’ Secure Login/Signup - Powered by Supabase authentication
  • πŸ›οΈ Multi-tenant Architecture - Company-based user isolation
  • πŸ‘₯ Role Management - Admin, Manager, and Employee roles
  • πŸ”‘ Session Handling - Automatic token refresh and validation

πŸ’³ Advanced Expense Tracking

  • βž• Quick Expense Creation - Intuitive form with smart validation
  • πŸ“± Receipt Scanning - AI-powered OCR for automatic data extraction
  • 🌍 Multi-currency Support - Real-time exchange rate conversion
  • πŸ“‚ Smart Categorization - Customizable expense categories
  • πŸ“… Date Tracking - Comprehensive expense timeline

πŸ“ˆ Powerful Analytics & Reporting

  • πŸ“Š Interactive Dashboard - Real-time expense visualization
  • πŸ“‰ Trend Analysis - Monthly and yearly spending patterns
  • πŸ’Ή Budget Tracking - Set and monitor spending limits
  • πŸ“‹ Export Reports - PDF and Excel export capabilities
  • 🎯 Custom Filters - Advanced search and filtering options

βš™οΈ Intelligent Approval Workflow

  • πŸ”„ Multi-level Approvals - Configurable approval chains
  • ⏰ Automated Notifications - Email and in-app alerts
  • πŸ’¬ Comment System - Approval/rejection with feedback
  • πŸ“ Audit Trail - Complete approval history tracking
  • πŸŽ›οΈ Flexible Rules - Percentage and amount-based approval rules

🎨 Modern User Experience

  • 🌟 Responsive Design - Perfect on all devices
  • 🎭 Dark/Light Mode - Customizable themes
  • ⚑ Lightning Fast - Optimized performance
  • πŸ”” Real-time Updates - Live data synchronization
  • 🧭 Intuitive Navigation - User-friendly interface

πŸ—οΈ Architecture Overview

graph TB
    subgraph "Frontend Layer"
        A[React 18 + TypeScript]
        B[Tailwind CSS]
        C[Vite Build Tool]
    end
    
    subgraph "Backend Layer"
        D[Node.js + Express]
        E[Supabase Authentication]
        F[RESTful API]
    end
    
    subgraph "Data Layer"
        G[Supabase PostgreSQL]
        H[File Storage]
        I[Real-time Subscriptions]
    end
    
    A --> D
    D --> G
    E --> G
    F --> H
    B --> A
    C --> A
Loading

πŸ“ Project Structure

πŸ“¦ Expense_Frontend_v_01/
β”œβ”€β”€ 🎬 README.md                    # You are here!
β”œβ”€β”€ πŸ“‹ package.json                 # Root dependencies
β”œβ”€β”€ βš™οΈ scripts/                     # Development scripts
β”‚   β”œβ”€β”€ πŸš€ start-dev.js            # Concurrent server starter
β”‚   └── πŸ”§ setup.js                # Interactive setup guide
β”‚
β”œβ”€β”€ πŸ”™ Backend/                     # Node.js + Express API
β”‚   β”œβ”€β”€ πŸ“¦ package.json            # Backend dependencies
β”‚   β”œβ”€β”€ 🌍 .env                    # Environment variables
β”‚   β”œβ”€β”€ πŸ“š SETUP.md                # Backend setup guide
β”‚   β”œβ”€β”€ πŸ—‚οΈ src/
β”‚   β”‚   β”œβ”€β”€ πŸš€ server.js           # Express server entry
β”‚   β”‚   β”œβ”€β”€ βš™οΈ config/             # Configuration files
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ—„οΈ database.sql    # Database schema
β”‚   β”‚   β”‚   └── πŸ”— supabase.js     # Supabase client
β”‚   β”‚   β”œβ”€β”€ πŸŽ›οΈ controllers/        # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ” authController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ’³ expenseController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ‘€ userController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ βœ… approvalController.js
β”‚   β”‚   β”‚   └── πŸ’± currencyController.js
β”‚   β”‚   β”œβ”€β”€ πŸ›‘οΈ middleware/          # Express middleware
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ”’ auth.js          # Authentication
β”‚   β”‚   β”‚   └── πŸ“€ upload.js        # File upload
β”‚   β”‚   β”œβ”€β”€ πŸ›£οΈ routes/              # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ” auth.js
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ’³ expenses.js
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ‘₯ users.js
β”‚   β”‚   β”‚   β”œβ”€β”€ βœ… approvals.js
β”‚   β”‚   β”‚   └── πŸ’± currency.js
β”‚   β”‚   └── πŸ”§ utils/               # Utility functions
β”‚   β”‚       β”œβ”€β”€ πŸ’± currency.js
β”‚   β”‚       └── πŸ‘οΈ ocr.js           # Receipt scanning
β”‚   └── πŸ“œ scripts/                 # Database scripts
β”‚       └── πŸ—οΈ init-db.js          # Database initialization
β”‚
└── 🎨 Frontend/                    # React + TypeScript SPA
    β”œβ”€β”€ πŸ“¦ package.json            # Frontend dependencies
    β”œβ”€β”€ 🌍 .env                    # Environment variables
    β”œβ”€β”€ ⚑ vite.config.ts          # Vite configuration
    β”œβ”€β”€ 🎯 tsconfig.json           # TypeScript config
    β”œβ”€β”€ 🎨 tailwind.config.js      # Tailwind CSS config
    β”œβ”€β”€ πŸ—‚οΈ src/
    β”‚   β”œβ”€β”€ πŸš€ main.tsx            # Application entry
    β”‚   β”œβ”€β”€ πŸ“± App.tsx             # Root component
    β”‚   β”œβ”€β”€ 🎨 index.css           # Global styles
    β”‚   β”œβ”€β”€ 🧩 components/         # React components
    β”‚   β”‚   β”œβ”€β”€ πŸ” Auth/           # Authentication UI
    β”‚   β”‚   β”‚   β”œβ”€β”€ πŸšͺ LoginPage.tsx
    β”‚   β”‚   β”‚   └── πŸ“ SignupPage.tsx
    β”‚   β”‚   β”œβ”€β”€ πŸ‘€ Employee/       # Employee dashboard
    β”‚   β”‚   β”‚   β”œβ”€β”€ 🏠 EmployeeDashboard.tsx
    β”‚   β”‚   β”‚   β”œβ”€β”€ βž• ExpenseForm.tsx
    β”‚   β”‚   β”‚   └── πŸ“Š ExpenseTable.tsx
    β”‚   β”‚   β”œβ”€β”€ πŸ‘¨β€πŸ’Ό Manager/         # Manager interface
    β”‚   β”‚   β”‚   β”œβ”€β”€ 🏠 ManagerDashboard.tsx
    β”‚   β”‚   β”‚   └── βœ… ApprovalQueue.tsx
    β”‚   β”‚   β”œβ”€β”€ πŸ‘‘ Admin/          # Admin panel
    β”‚   β”‚   β”‚   β”œβ”€β”€ 🏠 AdminDashboard.tsx
    β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ‘₯ UserManagement.tsx
    β”‚   β”‚   β”‚   └── βš™οΈ ApprovalRules.tsx
    β”‚   β”‚   β”œβ”€β”€ πŸ“Š Charts/         # Data visualization
    β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ˆ ExpenseChart.tsx
    β”‚   β”‚   β”‚   └── 🟒 ExpenseStatusChart.tsx
    β”‚   β”‚   β”œβ”€β”€ 🎨 ui/             # Reusable UI components
    β”‚   β”‚   └── πŸ–ΌοΈ Layout/         # Layout components
    β”‚   β”œβ”€β”€ 🌐 contexts/           # React contexts
    β”‚   β”‚   β”œβ”€β”€ πŸ” AuthContext.tsx
    β”‚   β”‚   β”œβ”€β”€ πŸ’³ ExpenseContext.tsx
    β”‚   β”‚   └── πŸ’± CurrencyContext.tsx
    β”‚   β”œβ”€β”€ πŸ”§ lib/                # Utilities & API
    β”‚   β”‚   └── 🌐 api.ts          # API client
    β”‚   └── πŸ“ types/              # TypeScript definitions
    β”‚       └── πŸ“‹ index.ts
    └── 🎯 Features.md             # Detailed feature docs

πŸš€ Quick Start Guide

πŸ“‹ Prerequisites

Requirement Version Download
🟒 Node.js 18+ Download
πŸ“¦ npm Latest Included with Node.js
πŸ—„οΈ Supabase Account Free Tier Sign Up

⚑ Installation

# 1️⃣ Clone the repository
git clone https://github.com/yourusername/expense-management-system.git
cd expense-management-system

# 2️⃣ Install all dependencies
npm run install-all

# 3️⃣ Set up environment variables
cp Backend/.env.example Backend/.env
cp Frontend/.env.example Frontend/.env

# 4️⃣ Configure Supabase credentials in Backend/.env
# SUPABASE_URL=https://your-project-id.supabase.co
# SUPABASE_ANON_KEY=your_anon_key
# SUPABASE_SERVICE_ROLE_KEY=your_service_role_key

# 5️⃣ Initialize the database
cd Backend && npm run init-db

# 6️⃣ Start the development servers
cd .. && npm run dev

🌐 Access Points

Service URL Description
🎨 Frontend http://localhost:5173 Main application
πŸ”™ Backend API http://localhost:5000/api REST API
πŸ₯ Health Check http://localhost:5000/health Server status

πŸ› οΈ Technology Stack

🎨 Frontend Technologies

React TypeScript Vite Tailwind CSS

πŸ”™ Backend Technologies

Node.js Express.js Supabase

πŸ”§ Development Tools

ESLint Prettier Git


πŸ“š API Documentation

πŸ” Authentication Endpoints

Method Endpoint Description Auth Required
POST /api/auth/signup Create new user account ❌
POST /api/auth/login User authentication ❌
GET /api/auth/me Get current user βœ…
POST /api/auth/logout End user session βœ…

πŸ’³ Expense Management

Method Endpoint Description Auth Required
GET /api/expenses List all expenses βœ…
POST /api/expenses Create new expense βœ…
PUT /api/expenses/:id Update expense βœ…
DELETE /api/expenses/:id Delete expense βœ…
POST /api/expenses/scan-receipt OCR receipt scanning βœ…

βœ… Approval Workflow

Method Endpoint Description Auth Required
GET /api/approvals/workflows Get approval workflows βœ…
POST /api/approvals/expenses/:id/approve Approve expense βœ…
POST /api/approvals/expenses/:id/reject Reject expense βœ…
GET /api/approvals/rules Get approval rules βœ…

🎯 Development Scripts

Command Description
npm run dev πŸš€ Start both frontend and backend servers
npm run setup βš™οΈ Interactive application setup
npm run backend πŸ”™ Start only backend server
npm run frontend 🎨 Start only frontend server
npm run install-all πŸ“¦ Install all dependencies

πŸ”§ Configuration

🌍 Environment Variables

Backend (.env)

# Server Configuration
PORT=5000
NODE_ENV=development
FRONTEND_URL=http://localhost:5173

# Supabase Configuration
SUPABASE_URL=https://your-project-id.supabase.co
SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key

# External APIs
EXCHANGE_RATE_API_URL=https://api.exchangerate-api.com/v4/latest
COUNTRIES_API_URL=https://restcountries.com/v3.1/all

Frontend (.env)

# API Configuration
VITE_API_URL=http://localhost:5000/api

# Supabase Configuration (if needed)
VITE_SUPABASE_URL=https://your-project-id.supabase.co
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key

🚨 Troubleshooting

πŸ”΄ Connection Refused Error

Problem: net::ERR_CONNECTION_REFUSED

Solutions:

  1. Ensure backend server is running on port 5000
  2. Check if ports are available
  3. Verify environment variables are correct
  4. Restart both servers: npm run dev
πŸ”‘ Authentication Issues

Problem: Invalid API key or 401 Unauthorized

Solutions:

  1. Verify Supabase credentials in .env
  2. Check service role key permissions
  3. Ensure database schema is initialized
  4. Run: cd Backend && npm run init-db
πŸ—„οΈ Database Connection Problems

Problem: Database errors or schema issues

Solutions:

  1. Check Supabase project status
  2. Verify network connectivity
  3. Run database initialization script
  4. Check SQL Editor in Supabase dashboard

πŸ“ˆ Performance Features

Feature Description Benefit
⚑ Hot Reload Instant development feedback Faster development
πŸ—œοΈ Code Splitting Optimized bundle loading Better performance
πŸ“± PWA Ready Progressive Web App support Mobile-like experience
πŸ”„ Real-time Updates Live data synchronization Enhanced UX
🎯 Lazy Loading On-demand component loading Reduced initial load

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch: git checkout -b feature/amazing-feature
  3. πŸ’Ύ Commit your changes: git commit -m 'Add amazing feature'
  4. πŸ“€ Push to the branch: git push origin feature/amazing-feature
  5. πŸ”„ Submit a Pull Request

πŸ“„ License

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


πŸ™ Acknowledgments

Special thanks to:

  • πŸš€ Supabase for the amazing backend infrastructure
  • βš›οΈ React Team for the incredible frontend framework
  • 🎨 Tailwind CSS for the beautiful styling system
  • ⚑ Vite for the lightning-fast build tool

πŸ’‘ Made with ❀️ for Modern Financial Management

Transform your expense tracking experience today!

⭐ Star this repo πŸ› Report Bug πŸ’‘ Request Feature


πŸ“ž Questions? Reach out to us!

Email LinkedIn Twitter

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 60.6%
  • JavaScript 39.1%
  • Other 0.3%