Invoice generator

byrm mrunal

You are a senior full-stack SaaS architect and engineer. Build a modern, production-ready Invoice Generator SaaS for freelancers, agencies, consultants, and small businesses. The application should be scalable, secure, responsive, and follow clean architecture and best coding practices. ======================== TECH STACK ======================== Frontend - React 19 - Vite - TypeScript - Tailwind CSS - React Router - TanStack Query - React Hook Form - Zod - Shadcn UI - Lucide Icons Backend - Node.js - Express.js - TypeScript - Prisma ORM - PostgreSQL - JWT Authentication - bcrypt - REST API Deployment - Docker - Docker Compose - Nginx Storage - Cloudflare R2 (for logos) PDF - PDFKit Authentication - JWT Access Token - Refresh Token - Google OAuth Login ======================== FEATURES ======================== Authentication - Register - Login - Forgot Password - Email Verification - Google Login - Profile - Change Password Dashboard Show Total Revenue Invoices Created Paid Invoices Pending Invoices Overdue Invoices Recent Activity Monthly Revenue Graph ======================== CUSTOMERS ======================== CRUD Customers Fields Name Email Phone GST Number Address City State Country Pincode Notes Search Pagination Export CSV ======================== PRODUCTS ======================== CRUD Products Name Description Price Tax % HSN Code Category ======================== INVOICE ======================== Create Invoice Invoice Number Auto Generated Invoice Date Due Date Customer Multiple Line Items Discount Tax Notes Terms & Conditions Company Logo Signature Status Draft Sent Paid Overdue Cancelled Generate Professional PDF Email Invoice Download PDF Duplicate Invoice Print Invoice ======================== PAYMENTS ======================== Mark Paid Partial Payment Payment History Remaining Balance ======================== REPORTS ======================== Monthly Revenue Pending Amount Top Customers Top Products Revenue Chart Invoice Count ======================== SETTINGS ======================== Company Profile Company Logo GST Number Business Address Invoice Prefix Invoice Number Format Currency Tax Settings Dark Mode ======================== DATABASE ======================== Design normalized PostgreSQL schema using Prisma. Tables Users Customers Products Invoices InvoiceItems Payments Settings RefreshTokens ======================== UI ======================== Modern SaaS Dashboard Glassmorphism Rounded Cards Sidebar Navigation Top Navbar Dark Theme Responsive Mobile Layout Loading Skeletons Toast Notifications Confirmation Dialogs Empty States ======================== VALIDATION ======================== Use Zod validation everywhere. Client Validation Server Validation ======================== SECURITY ======================== Rate Limiting Helmet CORS Input Sanitization Password Hashing JWT Refresh Tokens Secure Cookies SQL Injection Protection ======================== CODE QUALITY ======================== Use feature-based folder structure. Reusable Components Custom Hooks Repository Pattern Service Layer Environment Variables ESLint Prettier ======================== BONUS FEATURES ======================== Recurring Invoices Invoice Templates Multi-language Multi-currency Client Portal Expense Tracker Dashboard Widgets CSV Export Excel Export QR Code on Invoice Barcode Support Razorpay Integration Stripe Integration ======================== OUTPUT ======================== Generate the project one feature at a time. Start with project setup. Then authentication. Then database. Then backend APIs. Then frontend. Then dashboard. Then customers. Continue until the SaaS is fully completed. Do not skip any files. Generate complete code with folder structure. Every component should be production-ready. Follow best practices throughout.

Landing
Landing

Comments (0)

No comments yet. Be the first!

System Requirements

System Requirement Document
Page 1 of 5

Invoice Generator System Requirements Document

1. Introduction

The Invoice Generator project is a modern, scalable, and secure SaaS application designed for freelancers, agencies, consultants, and small businesses. It aims to streamline the invoicing process by providing a comprehensive set of features for creating, managing, and tracking invoices.

2. System Overview

The Invoice Generator is built with a robust tech stack to ensure scalability, security, and responsiveness. It follows clean architecture and best coding practices to deliver a production-ready application. The system supports various functionalities, including user authentication, invoice management, customer and product management, and detailed reporting.

Page 2 of 5

3. Functional Requirements as Story Points

  • As a User, I should be able to register an account using email and password.
  • As a User, I should be able to log in using email and password.
  • As a User, I should be able to reset my password if forgotten.
  • As a User, I should be able to verify my email address.
  • As a User, I should be able to log in using Google OAuth.
  • As a User, I should be able to view and edit my profile.
  • As a User, I should be able to change my password.
  • As a User, I should be able to view a dashboard showing total revenue, invoices created, paid invoices, pending invoices, overdue invoices, recent activity, and a monthly revenue graph.
  • As a User, I should be able to perform CRUD operations on customers with fields such as name, email, phone, GST number, address, city, state, country, pincode, and notes.
  • As a User, I should be able to search, paginate, and export customer data to CSV.
  • As a User, I should be able to perform CRUD operations on products with fields such as name, description, price, tax %, HSN code, and category.
  • As a User, I should be able to create invoices with auto-generated invoice numbers, invoice date, due date, customer selection, multiple line items, discounts, tax, notes, terms & conditions, company logo, and signature.
  • As a User, I should be able to manage invoice status (draft, sent, paid, overdue, cancelled).
  • As a User, I should be able to generate professional PDFs for invoices.
  • As a User, I should be able to email, download, duplicate, and print invoices.
  • As a User, I should be able to mark invoices as paid, record partial payments, and view payment history.
  • As a User, I should be able to view reports on monthly revenue, pending amounts, top customers, top products, revenue charts, and invoice counts.
  • As a User, I should be able to configure settings for company profile, company logo, GST number, business address, invoice prefix, invoice number format, currency, tax settings, and dark mode.
  • As a User, I should be able to use recurring invoices, invoice templates, multi-language, multi-currency, client portal, expense tracker, dashboard widgets, CSV export, Excel export, QR code on invoice, barcode support, and integrate with Razorpay and Stripe.

4. User Personas

  • Freelancer: Individual users who need to generate invoices for their clients.
  • Agency: Small to medium-sized agencies managing multiple clients and projects.
  • Consultant: Professionals providing consultancy services and requiring detailed invoicing.
  • Small Business Owner: Entrepreneurs managing their business finances and client billing.
Page 3 of 5

5. Core User Flows

  • User registers -> verifies email -> logs in -> sets up company profile -> creates customer -> creates product -> generates invoice -> sends invoice -> tracks payment status.
  • User logs in -> views dashboard -> accesses reports -> adjusts settings -> logs out.

6. Visuals Colors and Theme

  • primary: #1E40AF (Indigo)
  • primary_light: #3B82F6 (Light Blue)
  • secondary: #10B981 (Green)
  • accent: #F59E0B (Amber)
  • highlight: #EF4444 (Red)
  • bg: #F3F4F6 (Gray)
  • surface: #FFFFFF (White)
  • text: #111827 (Dark Gray)
  • text_muted: #6B7280 (Gray)
  • border: #D1D5DB (Light Gray)

7. Signature Design Concept

The Invoice Generator's landing page will feature an interactive "Invoice Journey" animation. Users will see a digital invoice being created in real-time, with line items being added, totals calculated, and the invoice being sent to a client. This animation will be interactive, allowing users to click on different parts of the invoice to see detailed information about each section. The animation will use motion/react for smooth transitions and interactions, creating an engaging and educational experience for users.

Page 4 of 5

Landing Hero Motion Brief

The hero section will showcase an animated sequence where a blank invoice template is populated with data (e.g., client details, line items, totals) as the user scrolls. The sequence will loop every 10 seconds, demonstrating the transformation from a draft to a finalized invoice. The animation will be built using motion/react and CSS for a seamless experience. The first frame will display a clean, professional invoice layout with a call-to-action to start creating invoices.

8. Interaction Model & Motion Direction

  • Interaction Model: Animated
  • The landing page will feature moderate scroll-triggered reveals and hover transitions, with spring physics on interactive elements to enhance user engagement.

9. Non-Functional Requirements

  • The application must be responsive and work seamlessly across all devices.
  • The system must handle concurrent users efficiently and scale as needed.
  • All data must be securely stored and transmitted.
  • The application must be easy to maintain and extend.
Page 5 of 5

10. Tech Stack

  • Frontend: React 19, Vite, TypeScript, Tailwind CSS, React Router, TanStack Query, React Hook Form, Zod, Shadcn UI, Lucide Icons
  • Backend: Node.js, Express.js, TypeScript, Prisma ORM, PostgreSQL, JWT Authentication, bcrypt, REST API
  • Deployment: Docker, Docker Compose, Nginx
  • Storage: Cloudflare R2
  • PDF Generation: PDFKit
  • Authentication: JWT Access Token, Refresh Token, Google OAuth Login

11. Assumptions and Constraints

  • The application will primarily serve users in India, with support for INR currency.
  • The system will use PostgreSQL for database management.
  • The application will be deployed using Docker and Nginx for scalability and reliability.
  • The application will adhere to security best practices, including rate limiting and input sanitization.

12. Glossary

  • CRUD: Create, Read, Update, Delete
  • JWT: JSON Web Token
  • ORM: Object-Relational Mapping
  • REST API: Representational State Transfer Application Programming Interface
  • SaaS: Software as a Service

This document outlines the requirements and specifications for the Invoice Generator project, ensuring a comprehensive understanding of the system's capabilities and design.

Landing design preview
Landing: View Info
Login: Sign In
Dashboard: View Overview
Customers: Manage Customers
Products: Manage Products
Invoices: Create Invoice
Invoices: Use Template
Invoices: Duplicate Invoice
Payments: Record Partial Payment
Reports: View Top Customers
Settings: Configure Company
Settings: Set Invoice Prefix
Landing design preview
Landing: View Info
Login: Sign In
Dashboard: View Overview
Customers: Manage Customers
Products: Manage Products
Invoices: Create Invoice
Invoices: Use Template
Invoices: Duplicate Invoice
Payments: Record Partial Payment
Reports: View Top Customers
Settings: Configure Company
Settings: Set Invoice Prefix