A professional invoice management system built with React 19 and Firebase, featuring customer management, invoice creation, PDF generation, multi-currency support, and business profiles.
π Live Demo: https://invoice.flowdesk.tech
- π User Authentication: Secure login and registration with Firebase Auth
- π₯ Customer Management: Add, edit, and manage customer information
- π Invoice Creation: Create professional invoices with line items and calculations
- π Dashboard: Overview of revenue, pending invoices, and recent activity
- π PDF Generation: Download and preview invoices as PDF documents
- π± Responsive Design: Works seamlessly on desktop and mobile devices
- π± Multi-Currency Support: Create invoices in 30+ currencies with proper formatting
- π Business Profiles: Manage multiple businesses under one account
- βοΈ Email in Profiles: Add business email to profiles for professional invoices
- π’ Flexible Invoice Numbers: Always editable invoice numbers with auto-increment option
- π Custom Domain Support: Deployed at invoice.flowdesk.tech with CORS support
- π¨ Enhanced UI: Improved currency selectors with symbols and better form layouts
- Framework: Next.js 15 (App Router) with SSR
- Frontend: React 19, Material-UI 7, Emotion
- Hosting: Vercel (frontend) + Firebase (backend services)
- Backend: Firebase 11 (Firestore, Authentication, Cloud Functions)
- PDF Generation: jsPDF with autotable
- Forms: React Hook Form
- Date Handling: date-fns
- Node.js (v18 or higher)
- npm or yarn
- Firebase account
- Git
git clone https://github.com/yourusername/invoice-management.git
cd invoice-managementnpm installCopy the .env.example file to .env and add your Firebase configuration:
cp .env.example .envThen edit .env (or .env.local) with your Firebase project values. Next.js
exposes variables prefixed with NEXT_PUBLIC_ to the browser bundle:
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key_here
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain_here
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id_here
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket_here
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id_here
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id_here
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=your_measurement_id_here
NEXT_PUBLIC_FIREBASE_FUNCTIONS_REGION=us-central1-
Create a new Firebase project at Firebase Console
-
Enable the following services:
- Authentication (Email/Password)
- Firestore Database
- Hosting
-
Create a web app in your Firebase project and copy the configuration values to your
.envfile -
Update
.firebasercwith your project ID:
{
"projects": {
"default": "your-firebase-project-id"
}
}- Deploy Firestore security rules:
firebase deploy --only firestore:rules- Create composite indexes (if needed):
firebase deploy --only firestore:indexes# Development server (Next.js)
npm run dev
# Build for production
npm run build
# Serve the production build locally
npm run startThe application will open at http://localhost:3000.
The Next.js frontend is deployed to Vercel via its Git integration.
- Install the Vercel CLI (optional, only for manual deploys):
npm install -g vercel
- In the Vercel dashboard, import this Git repository. Vercel auto-detects Next.js; no special build settings are required.
- Add the following environment variables in Project Settings β
Environment Variables (Production + Preview):
NEXT_PUBLIC_FIREBASE_API_KEYNEXT_PUBLIC_FIREBASE_AUTH_DOMAINNEXT_PUBLIC_FIREBASE_PROJECT_IDNEXT_PUBLIC_FIREBASE_STORAGE_BUCKETNEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_IDNEXT_PUBLIC_FIREBASE_APP_IDNEXT_PUBLIC_FIREBASE_MEASUREMENT_IDNEXT_PUBLIC_FIREBASE_FUNCTIONS_REGION(e.g.us-central1)
- Trigger a deploy (push to
main/masteror click Deploy). - In Project Settings β Domains, add
invoice.flowdesk.tech. Vercel will instruct you to create a CNAME record pointing tocname.vercel-dns.comat your DNS provider.
Firebase Cloud Functions, Firestore rules, indexes, and Storage rules are
deployed by the .github/workflows/deploy.yml GitHub Action, which runs on
every push to main/master that changes functions/** or any Firebase
config file.
Required GitHub Actions secrets:
FIREBASE_SERVICE_ACCOUNTβ JSON contents of a service account key with permission to deploy to the projectVITE_FIREBASE_PROJECT_IDβ your Firebase project ID (kept under this name to avoid breaking existing secrets)MAILGUN_API_KEY,MAILGUN_DOMAIN,MAILGUN_FROM_EMAILSTRIPE_SECRET_KEY,STRIPE_WEBHOOK_SECRETOPENAI_API_KEY
Manual deploy (requires firebase login):
npm run deploy:functions # Cloud Functions
npm run deploy:rules # Firestore rulesnext.config.mjs rewrites /api/:path* from the Next.js app to the
Firebase Cloud Functions host
(https://<region>-<project-id>.cloudfunctions.net/api/:path*). This keeps
browser requests same-origin and avoids CORS configuration on the
Functions side.
- Register: Create a new account with your email and password
- Complete Profile: Add your company information in the Profile section
- Add Customers: Navigate to Customers and add your client information
- Create Invoice: Go to Invoices β New Invoice, select a customer, add line items
- Manage Invoices: Track payment status, download PDFs, and manage your invoices
In your profile, you can configure:
- Invoice number prefix
- Default tax rate
- Payment terms
- Company information for invoices
- View total revenue
- Track pending invoices
- See recent invoice activity
- Quick statistics overview
- Add new customers with complete contact information
- Edit existing customer details
- Search and filter customers
- Delete customers when needed
- Create professional invoices
- Add multiple line items
- Automatic calculations (subtotal, tax, total)
- Set invoice status (Draft, Pending, Paid, Overdue)
- Download invoices as PDF
- Edit existing invoices
invoice-management/
βββ public/
β βββ (static assets)
βββ src/
β βββ components/
β β βββ Layout.js
β β βββ PrivateRoute.js
β βββ config/
β β βββ firebase.js
β βββ contexts/
β β βββ AuthContext.js
β βββ pages/
β β βββ Login.js
β β βββ Register.js
β β βββ Dashboard.js
β β βββ Profile.js
β β βββ Customers.js
β β βββ Invoices.js
β β βββ CreateInvoice.js
β β βββ ViewInvoice.js
β βββ App.js
β βββ index.jsx
β βββ index.css
βββ .env.example
βββ .gitignore
βββ firebase.json
βββ firestore.rules
βββ index.html
βββ package.json
βββ vite.config.js
βββ README.md
The application implements several security measures:
- Firebase Authentication for user management
- Firestore security rules to protect user data
- Each user can only access their own data
- Input validation on forms
- Secure password requirements
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, email contact@flowdesk.tech or open an issue in the GitHub repository.
- β Added multi-currency support for invoices
- β Implemented business profiles for managing multiple businesses
- β Added email field to business profiles
- β Made invoice numbers always editable
- β Fixed PDF generation to use profile data instead of account data
- β Added currency selector to invoice creation and profile settings
- β Deployed to custom domain with SSL support
- β Enhanced CORS configuration for *.coremaven.tech domains
- β Fixed various UI issues and improved user experience
- Material-UI for the component library
- Firebase for backend services
- jsPDF for PDF generation
- React team for the amazing framework
- Vite for blazing fast development experience