A comprehensive invoice management system built with React, TypeScript, Supabase, and Express.js. This application provides a complete solution for managing clients, creating invoices, tracking time, and monitoring business analytics.
- Dashboard: Revenue analytics, invoice status tracking, and recent activity
- Invoice Management: Create, edit, and track invoices with PDF generation
- Client Management: Comprehensive client profiles with contact information and billing rates
- Time Tracking: Built-in timer with project categorization and billing integration
- Settings: Company information, invoice templates, and notification preferences
- Authentication: Secure user authentication with Supabase
- Dark Mode: Full dark mode support with system preference detection
- Responsive Design: Mobile-first design that works on all devices
- RESTful API: Clean API architecture with proper error handling
- Authentication: JWT-based authentication with bcrypt password hashing
- Data Validation: Input validation using express-validator
- Security: Helmet.js for security headers, CORS configuration
- Logging: Request logging with Morgan
- Error Handling: Comprehensive error handling middleware
- Row Level Security: Secure data isolation between users
- Optimized Queries: Proper indexing for performance
- Real-time Updates: Supabase real-time subscriptions
- Data Integrity: Foreign key constraints and data validation
- Backup & Recovery: Automated backups with Supabase
- React 18 with TypeScript
- Tailwind CSS for styling
- React Router for navigation
- Supabase for backend services
- Recharts for data visualization
- Date-fns for date manipulation
- Lucide React for icons
- Node.js with Express.js
- JWT for authentication
- Bcrypt for password hashing
- Express Validator for input validation
- Morgan for logging
- Helmet for security
- CORS for cross-origin requests
- PostgreSQL (via Supabase)
- Row Level Security (RLS)
- Real-time subscriptions
- Automated backups
invoice-management-system/
├── src/ # Frontend source code
│ ├── components/ # Reusable React components
│ │ ├── Layout.tsx # Main layout wrapper
│ │ ├── Sidebar.tsx # Navigation sidebar
│ │ ├── Header.tsx # Top header bar
│ │ ├── InvoiceModal.tsx # Invoice creation/editing modal
│ │ ├── ClientModal.tsx # Client creation/editing modal
│ │ └── ProtectedRoute.tsx # Route protection component
│ ├── contexts/ # React context providers
│ │ ├── AuthContext.tsx # Authentication state management
│ │ ├── ThemeContext.tsx # Dark/light theme management
│ │ └── DataContext.tsx # Application data management
│ ├── pages/ # Page components
│ │ ├── Dashboard.tsx # Main dashboard with analytics
│ │ ├── Invoices.tsx # Invoice management page
│ │ ├── Clients.tsx # Client management page
│ │ ├── TimeTracking.tsx # Time tracking interface
│ │ ├── Settings.tsx # Application settings
│ │ └── Login.tsx # Authentication page
│ ├── types/ # TypeScript type definitions
│ │ └── index.ts # Main type definitions
│ ├── utils/ # Utility functions
│ │ └── formatters.ts # Data formatting utilities
│ └── lib/ # External library configurations
│ └── supabase.ts # Supabase client configuration
├── server/ # Backend source code
│ ├── routes/ # API route handlers
│ │ ├── auth.js # Authentication routes
│ │ ├── clients.js # Client management routes
│ │ ├── invoices.js # Invoice management routes
│ │ └── time.js # Time tracking routes
│ └── index.js # Express server configuration
├── supabase/ # Database configuration
│ └── migrations/ # Database migration files
│ └── create_tables.sql # Initial database schema
└── README.md # Project documentation
- Node.js 18+ and npm
- Supabase account
- Git
-
Clone the repository
git clone <repository-url> cd invoice-management-system
-
Install dependencies
npm install
-
Set up Supabase
- Create a new Supabase project
- Copy the project URL and anon key
- Run the migration file in the Supabase SQL editor
-
Configure environment variables
cp .env.example .env
Update
.env
with your Supabase credentials:VITE_SUPABASE_URL=your_supabase_url VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
-
Start the development servers
Frontend:
npm run dev
Backend (in a separate terminal):
npm run server
-
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:3001
- Client information and contact details
- Hourly billing rates
- Tags and notes for organization
- Invoice data with line items (stored as JSONB)
- Status tracking (draft, sent, paid, overdue, cancelled)
- Tax calculations and totals
- Time tracking with start/end times
- Project categorization
- Billable hours tracking
- Integration with client billing rates
- Row Level Security (RLS) enabled on all tables
- Users can only access their own data
- Secure authentication with Supabase Auth
POST /api/auth/register
- User registrationPOST /api/auth/login
- User loginGET /api/auth/me
- Get current user
GET /api/clients
- Get all clientsPOST /api/clients
- Create new clientPUT /api/clients/:id
- Update clientDELETE /api/clients/:id
- Delete client
GET /api/invoices
- Get all invoicesPOST /api/invoices
- Create new invoicePUT /api/invoices/:id
- Update invoiceDELETE /api/invoices/:id
- Delete invoice
GET /api/time
- Get all time entriesPOST /api/time
- Create new time entryPUT /api/time/:id
- Update time entryDELETE /api/time/:id
- Delete time entry
- Revenue tracking with trend visualization
- Invoice status distribution
- Recent activity feed
- Overdue invoice alerts
- Professional invoice templates
- Line item management with automatic calculations
- Tax handling with configurable rates
- Status tracking (draft → sent → paid)
- PDF generation and download
- Comprehensive client profiles
- Contact information management
- Hourly rate configuration
- Tag-based organization
- Notes and relationship tracking
- Built-in timer with start/pause/stop functionality
- Project categorization
- Automatic billing calculations
- Integration with client rates
- Billable vs non-billable time tracking
- Company information management
- Invoice template customization
- Default tax rates and currency
- Notification preferences
- Dark/light theme toggle
- Authentication: Secure user authentication with Supabase Auth
- Authorization: Row Level Security ensures data isolation
- Password Security: Bcrypt hashing for password storage
- API Security: Helmet.js for security headers
- Input Validation: Comprehensive input validation and sanitization
- CORS: Properly configured cross-origin resource sharing
- Database Indexing: Optimized queries with proper indexing
- Code Splitting: React lazy loading for better performance
- Caching: Efficient data caching with React Query patterns
- Responsive Images: Optimized image loading and display
- Bundle Optimization: Vite for fast builds and hot reloading
- Build the project:
npm run build
- Deploy the
dist
folder to your hosting provider - Configure environment variables in your hosting dashboard
- Set up your hosting provider
- Configure environment variables
- Deploy the server code
- Ensure database connectivity
- Database is automatically managed by Supabase
- Configure RLS policies as needed
- Monitor usage and performance
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature
- Commit your changes:
git commit -am 'Add new feature'
- Push to the branch:
git push origin feature/new-feature
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the GitHub repository
- Check the documentation for common solutions
- Review the code comments for implementation details
- PDF invoice generation
- Email invoice sending
- Payment integration (Stripe)
- Multi-currency support
- Advanced reporting and analytics
- Mobile app (React Native)
- API rate limiting
- Advanced user roles and permissions
- Invoice templates customization
- Automated invoice reminders
- Database query optimization
- Frontend bundle size reduction
- Image optimization
- Caching strategies
- Progressive Web App (PWA) features