Overview
The customer management feature allows you to maintain a database of customer information that can be quickly selected when creating invoices. This eliminates repetitive data entry and ensures consistency across all invoices sent to the same customer.Customer data structure
Each customer record includes comprehensive contact and address information:logo are standard text fields. The logo is stored as a base64-encoded data URL.
Adding customers
Navigate to/customers to access the customer management page. The interface is split into two sections:
Customer form (left panel)
Fill in the following fields: Required fields:- Name: Customer or company name
- Email: Valid email address (validated with regex pattern)
- Customer logo: Upload an image (PNG, JPG, SVG) up to 2MB
- Address: Street address
- City: City name
- State: State or province
- Zip Code: Postal or ZIP code
- Country: Select from 86+ countries (defaults to United Kingdom)
Logo upload
Customer logos enhance invoice professionalism:- Supported formats: PNG, JPG, SVG, and other image types
- Maximum size: 2MB
- Storage: Base64-encoded in IndexedDB
- Display: 64×64px preview in customer list, 80×80px on invoices
Logos are stored as base64 data URLs, so larger images will consume more storage space in IndexedDB. Consider optimizing images before upload for better performance.
Customer list (right panel)
All saved customers appear in a scrollable list showing:- Customer logo (if uploaded)
- Customer name
- Email address
- Full address (if provided)
- Edit and delete buttons
Empty state
When no customers exist, the list displays:No customers yet. Add your first customer to get started.
Editing customers
Click the Edit button (pencil icon) on any customer card to:- Load customer data into the form
- Modify any fields
- Click Update Customer to save changes
- Click Cancel to discard changes
Deleting customers
Click the Delete button (trash icon) to remove a customer:- Confirmation dialog appears: “Are you sure you want to delete this customer?”
- Click OK to permanently delete
- Click Cancel to abort
Using customers in invoices
When creating or editing an invoice:- Navigate to the Customer Information section
- Click the Select Customer dropdown
- Choose a customer from the list (displayed as “Name (Email)”)
- All customer fields auto-fill instantly
- You can still edit fields before saving the invoice
app/components/InvoiceForm.tsx:208:
Quick navigation
From the invoice creation form, you can click Manage customers to open the customers page in a new context, allowing you to add missing customers without losing your invoice progress.Country support
The country dropdown includes 86+ countries with United Kingdom and United States at the top for convenience. The full list is defined inapp/customers/page.tsx:45 and includes countries from Afghanistan to Zimbabwe.
Data persistence
Customer data is stored locally using IndexedDB through these functions fromapp/lib/storage.ts:
Form validation
The customer form validates:- Name: Cannot be empty
- Email: Must be a valid email format (pattern:
/^[^\s@]+@[^\s@]+\.[^\s@]+$/) - Logo: Must be an image file under 2MB