CodeCanyon Product

Modern Invoice Generator Lite
— Angular 21

A professional, frontend-only invoice generation application. Create, customize, and export beautiful invoices entirely in the browser — no backend required.

Angular 21 Signals TypeScript SCSS html2pdf.js LocalStorage Standalone Components Zoneless

Introduction

01

Modern Invoice Generator Lite is a fully frontend, browser-based invoice generation application built with Angular 21. It requires no server, no database, and no backend — making it trivial to deploy anywhere that can serve static files.

The application lets users build polished, professional invoices in minutes and export them as PDF files or send them directly to print. All data is persisted automatically via the browser's LocalStorage, so nothing is ever lost on refresh.

What you can do with it

📄

Create Invoices

Professional invoices with auto-numbered IDs and due dates

🏢

Company Branding

Add logo, name, address, phone, email and website

💰

Smart Totals

Subtotal, tax, and grand total computed in real time

📤

PDF Export

One-click PDF download with pixel-perfect layout

🌍

Multi-Currency

Switch between USD, EUR, GBP, INR, AUD, CAD instantly

✍️

Signature Line

Add authorized-by name with optional signature image

💡

This is a Lite edition. All features are fully functional and production-ready. The application is entirely self-contained — just build and deploy.

Features

02

A complete overview of every feature included in this product.

📝

Create Invoices

Full invoice editor with all standard fields

Line Items

Add unlimited items with description, qty, unit price

🧮

Auto Totals

Subtotal, tax amount, and grand total computed live

🧾

Tax Rate

Configurable tax percentage applied to subtotal

💱

Multi Currency

USD · INR · EUR · GBP · AUD · CAD

🖼️

Logo Upload

Company logo stored as Base64 in LocalStorage

📦

Bill To / Ship To

Separate shipping address with toggle

💬

Invoice Notes

Custom note / payment terms text block

🖨️

Print Invoice

Browser print with print-optimized CSS styles

📥

PDF Export

Download as PDF via html2pdf.js

📱

Responsive

Works on desktop, tablet, and mobile

💾

Auto Save

LocalStorage auto-save — never lose your work

✍️

Authorized By

Signature name + optional signature image

🔢

Invoice Numbers

Auto-incrementing invoice numbers

Technology Stack

03
🅰️
Angular 21
Frontend framework with latest features
🔷
TypeScript
Strict type safety throughout
🎨
SCSS
Custom design system, no CSS framework
📄
html2pdf.js
PDF generation (lazy loaded)
🖼️
html2canvas
DOM-to-image capture for PDF
💾
LocalStorage
Browser-native persistence

Modern Angular 21 Patterns

This project uses the latest Angular features and architectural patterns:

PatternDescription
signal() & computed()Reactive state without Zone.js — the entire invoice state is signal-based
effect()Auto-save side effect: whenever the invoice signal changes, it saves to LocalStorage
Standalone ComponentsNo NgModule anywhere — every component is standalone
Zoneless Change DetectionprovideZonelessChangeDetection() for best performance
Native Control Flow@if, @for, @switch — no structural directives
Lazy-loaded RoutesloadChildren() for / (invoice) and /settings
Dynamic Importhtml2pdf.js is dynamically imported — only loaded when the user clicks Export PDF

Folder Structure

04

The project follows Angular's recommended feature-based folder structure.


      
src/ ├── app/ │ ├── core/ # Singleton services & data models │ │ ├── models/ │ │ │ └── invoice.model.ts # All TypeScript interfaces & defaults │ │ └── services/ │ │ ├── invoice.service.ts # Central signal-based state store │ │ ├── storage.service.ts # LocalStorage read/write abstraction │ │ └── pdf-export.service.ts # html2pdf.js lazy loader & export │ │ │ ├── features/ # Lazy-loaded route features │ │ ├── invoice/ │ │ │ ├── invoice.routes.ts │ │ │ ├── pages/invoice-page/ # Root invoice page layout │ │ │ └── components/ │ │ │ ├── invoice-editor/ # Left panel — all form inputs │ │ │ ├── invoice-items/ # Line items table with add/remove │ │ │ └── invoice-preview/ # Right panel — live PDF-ready preview │ │ └── settings/ │ │ ├── settings.routes.ts │ │ └── pages/settings-page/ # Company info, currency, tax rate │ │ │ ├── shared/ # Reusable components │ │ └── components/ │ │ ├── navbar/ # Top nav — New Invoice, Print, Export PDF │ │ └── logo-upload/ # Drag-and-drop logo uploader │ │ │ ├── app.ts # Root component │ ├── app.html # Root template (<router-outlet>) │ ├── app.routes.ts # Top-level lazy routes │ └── app.config.ts # provideZonelessChangeDetection, Router │ ├── styles/ # Global SCSS design system │ ├── _variables.scss # Color tokens, spacing, typography │ ├── _mixins.scss # Reusable SCSS helpers │ ├── _buttons.scss │ ├── _forms.scss │ ├── _layout.scss │ └── _invoice.scss # Invoice preview print styles │ ├── styles.scss # Global stylesheet entry └── types/ └── html2pdf.d.ts # TypeScript declarations for html2pdf.js

Key Files Explained

FilePurpose
invoice.service.tsThe single source of truth. All invoice state lives here as an Angular signal(). Auto-saves on every change via effect().
storage.service.tsThin wrapper around localStorage. Handles serialization, invoice number counter, and key management.
pdf-export.service.tsRegisters the preview DOM element via registerPreviewElement() and triggers PDF export. html2pdf.js is dynamically imported here.
invoice-preview.htmlThe print/PDF layout. Rendered from signal data — what you see is what gets exported.
_invoice.scssPrint-specific CSS. Controls the PDF layout, fonts, and page margins.

Installation

05

Follow these steps to get the project running on your local machine.

Install Node.js

Download and install Node.js version 22 or later (LTS recommended) from nodejs.org. Verify your installation:

terminal
node --version
# Should output v22.x.x or higher

npm --version
# Should output 10.x.x or higher
⚠️

Angular 21 requires Node.js 22+. If you have an older version, use nvm (Node Version Manager) to switch versions.

Install Angular CLI

Install the Angular CLI globally on your machine. You only need to do this once.

terminal
npm install -g @angular/cli

Verify the installation:

terminal
ng version

Extract the Project Files

Extract the downloaded ZIP archive and open a terminal inside the project folder. You should see package.json in the current directory.

Install Dependencies

Install all Node.js dependencies. The --legacy-peer-deps flag handles any peer dependency version mismatches gracefully.

terminal
npm install --legacy-peer-deps

This will install Angular, TypeScript, html2pdf.js, and all other required packages into the node_modules folder.

Running the Project

06

Start the Angular development server with live reload.

terminal
ng serve

Once the server starts, open your browser and navigate to:

browser
http://localhost:4200
🔄

The dev server features hot module replacement (HMR). Any file changes are reflected in the browser instantly without a full page reload.

Application Routes

RoutePageDescription
/Invoice EditorMain invoice editor with live preview pane
/settingsSettingsCompany info, default currency, and tax rate

Build for Production

07

Create an optimized production build with tree-shaking, minification, and code splitting.

terminal
ng build --configuration production

The compiled output is placed in the /dist directory at the project root. The contents of this folder are what you deploy.

dist/ └── morden-invoice-generator/ ├── browser/ # Static files — deploy this folder │ ├── index.html │ ├── main-[hash].js │ ├── styles-[hash].css │ └── chunk-[hash].js # Lazy chunk for PDF library └── 3rdpartylicenses.txt

The production build applies tree-shaking, Ahead-of-Time (AOT) compilation, and code splitting for the best possible performance and bundle size.

Deployment

08

Since this is a pure static application, it can be hosted on any static file hosting provider.

Netlify
Drag & drop or Git CI/CD
Vercel
Instant deployment from Git
🐙
GitHub Pages
Free hosting from your repo
🔥
Firebase Hosting
Google CDN, free tier
☁️
AWS S3 + CloudFront
Enterprise-grade scalability
🌊
DigitalOcean
App Platform / Spaces

Deploy to Netlify (Recommended)

Option A — Drag & Drop (quickest)

Build the project

terminal
ng build --configuration production

Upload to Netlify

Go to netlify.com → drag and drop the contents of dist/morden-invoice-generator/browser/ onto the Netlify dashboard. Your site is live instantly.

Option B — Git-Connected Auto Deploy

Connect your Git repository to Netlify

In Netlify dashboard, click New site from Git and connect your GitHub/GitLab/Bitbucket repository.

Configure build settings

netlify build settings
Build command:  ng build --configuration production
Publish directory:  dist/morden-invoice-generator/browser

Add _redirects file for SPA routing

Place a _redirects file inside src/ (it will be copied to dist) with this content:

src/_redirects
/*    /index.html   200

This ensures Angular's client-side router handles all URL paths correctly.

🔄

With Git-connected deploys, every push to your main branch automatically triggers a new build and deploys the latest version within seconds.

Configuration

09

Configuration is done entirely through the application's Settings page (/settings). No code changes are needed for basic configuration. All settings are persisted automatically in LocalStorage.

Settings Page Fields

FieldDescriptionDefault
Company NameDisplayed in the invoice headerYour Company Name
AddressMulti-line company address123 Business Avenue…
PhoneContact phone number+1 (555) 000-0000
EmailCompany email addresshello@yourcompany.com
WebsiteCompany website URLwww.yourcompany.com
LogoCompany logo image (PNG/JPG/SVG, stored as Base64)None
Default CurrencyCurrency shown on new invoicesUSD
Default Tax RatePre-filled tax % on new invoices0%

Per-Invoice Configuration

Each invoice also has its own editable fields on the main invoice editor page:

FieldDescription
Invoice NumberAuto-incremented, but editable
Invoice DateDefaults to today's date
Due DateDefaults to 30 days from today
Bill ToClient name, address, email, phone
Ship ToOptional separate shipping address (toggle to show)
CurrencyPer-invoice currency override
Tax RatePer-invoice tax percentage
NotesPayment terms or custom message
Authorized ByName shown under the signature line

Customization

10

Developers can customize the look and feel of both the application UI and the invoice layout by editing the SCSS files.

Design Tokens — src/styles/_variables.scss

All colors, spacing, and typography values are defined as SCSS variables here. Change these to re-theme the entire application:

src/styles/_variables.scss
// Brand colors — change these to re-theme the app
$primary:      #6366f1;   // Indigo — buttons, links, accents
$primary-dark: #4f46e5;   // Hover state
$accent:       #22d3ee;   // Cyan highlights

// Invoice layout colors
$invoice-header-bg: #1e2535;
$invoice-border:    #2a3144;
$invoice-text:      #f1f5f9;

// Typography
$font-base:  'Inter', system-ui, sans-serif;
$font-mono:  'JetBrains Mono', monospace;

Invoice Print Layout — src/styles/_invoice.scss

This file controls how the invoice looks when printed or exported as PDF. Edit it to match your brand:

src/styles/_invoice.scss (excerpt)
// Invoice preview wrapper
.invoice-preview {
  background: #fff;
  color: #1a1a2e;
  font-family: 'Inter', sans-serif;
  max-width: 794px;  // A4 width in px at 96dpi
  padding: 40px 48px;
}

// Header section with company info + logo
.invoice-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
}

// Customize the accent color of table headers
.invoice-table thead th {
  background: $primary;
  color: #fff;
}

SCSS File Overview

FileWhat to customize
_variables.scssColors, fonts, spacing tokens — start here
_invoice.scssInvoice layout, print styles, PDF appearance
_buttons.scssButton styles and hover states
_forms.scssInput, select, textarea styles
_layout.scssApp shell, split-pane editor layout
🎨

The project uses @use 'sass:color' with color.adjust() for all color manipulations — no deprecated darken() or lighten() functions. This ensures full compatibility with modern Sass.

Currency Support

11

The application ships with six currencies out of the box. The selected currency symbol is displayed throughout the invoice — in item prices, subtotal, tax, and grand total.

CurrencyCodeSymbol
US DollarUSD$
Indian RupeeINR
EuroEUR
British PoundGBP£
Australian DollarAUDA$
Canadian DollarCADC$

Adding a New Currency

To add a new currency, open src/app/core/models/invoice.model.ts and add an entry to the CURRENCIES array:

src/app/core/models/invoice.model.ts
export const CURRENCIES: CurrencyOption[] = [
  { code: 'USD', symbol: '$',  name: 'US Dollar' },
  { code: 'INR', symbol: '₹', name: 'Indian Rupee' },
  { code: 'EUR', symbol: '€', name: 'Euro' },
  { code: 'GBP', symbol: '£', name: 'British Pound' },
  { code: 'AUD', symbol: 'A$', name: 'Australian Dollar' },
  { code: 'CAD', symbol: 'C$', name: 'Canadian Dollar' },
  // Add your currency here:
  { code: 'JPY', symbol: '¥', name: 'Japanese Yen' },
];

The new currency will automatically appear in the currency dropdown on both the invoice editor and the settings page.

Printing & PDF Export

12

Print Invoice

Click the Print button in the top navigation bar. The application applies print-optimized CSS that hides the editor pane and displays only the invoice preview, perfectly formatted for your printer.

Export as PDF

Click the Export PDF button in the navigation bar. The PDF is generated entirely in the browser using html2pdf.js + html2canvas. The file is named after the invoice number (e.g., invoice-INV-0001.pdf).

How it works internally

StepWhat happens
1. User clicks Export PDFNavbarComponent calls PdfExportService.exportToPdf(invoiceNumber)
2. Lazy loadPdfExportService dynamically imports html2pdf.js (first time only)
3. Capture DOMhtml2canvas converts the #invoice-preview DOM element to a canvas
4. Generate PDFThe canvas is embedded into a PDF document with correct A4 page sizing
5. DownloadThe browser triggers a file download with the filename invoice-[number].pdf

PDF Quality Settings

PDF quality and page settings can be adjusted in src/app/core/services/pdf-export.service.ts:

pdf-export.service.ts (options)
const options = {
  margin:      [8, 8, 8, 8],     // top, right, bottom, left (mm)
  filename:    `invoice-${invoiceNumber}.pdf`,
  image:       { type: 'jpeg', quality: 0.98 },
  html2canvas: { scale: 2, useCORS: true },  // scale: 2 = retina quality
  jsPDF:       { unit: 'mm', format: 'a4', orientation: 'portrait' },
};

Troubleshooting

13

Common issues and their solutions. Click any item to expand.

Error 'ng' is not recognized as a command

Angular CLI is not installed or not in your system PATH. Run:

terminal
npm install -g @angular/cli

If you're on Windows and it still doesn't work, try restarting your terminal or running it as Administrator.

Error Node.js version is not compatible

Angular 21 requires Node.js 22 or later. Check your current version:

terminal
node --version

To upgrade, use nvm (Node Version Manager):

terminal
nvm install 22
nvm use 22
Error npm install fails with peer dependency errors

This can happen when npm's strict peer dependency resolution conflicts. Use the legacy flag:

terminal
npm install --legacy-peer-deps

If that still fails, try clearing the npm cache first:

terminal
npm cache clean --force
npm install --legacy-peer-deps
Error Port 4200 is already in use

Another process is using port 4200. Start the dev server on a different port:

terminal
ng serve --port 4300
Issue PDF export is blank or has missing styles

This can happen due to cross-origin font loading. Make sure the app is served from a proper domain (not file://). When running locally, use ng serve — don't open the index.html file directly in the browser.

For production, ensure your hosting provider serves assets with appropriate CORS headers.

Issue Settings not saving between page refreshes

The app uses localStorage for persistence. Check if:

  • Your browser has LocalStorage enabled (not in private/incognito mode with restrictions)
  • The browser's storage quota has not been exceeded
  • You haven't clicked "Clear All Data" in the app

Support

14

Need help? We're here for you.

If you have questions about setup, customization, or run into any issues, don't hesitate to reach out. We typically respond within 24 hours on business days.

Before contacting support

Please check the following first to speed up resolution:

CheckHow
Node.js versionRun node --version — must be 22+
Angular CLI versionRun ng version — should match Angular 21
Dependencies installedEnsure node_modules exists and npm install --legacy-peer-deps completed without fatal errors
Error messageCopy the full error from the terminal or browser console

If you find this product helpful, please consider leaving a 5-star rating on CodeCanyon. It helps a lot and is greatly appreciated!


Modern Invoice Generator Lite · Angular 21 · v1.0.0
© 2026 · All rights reserved · Licensed per CodeCanyon Standard/Extended License