Customer data structure
Customers are stored with the following fields (fromapp/lib/types.ts:6-16):
Accessing the customers page
Navigate to/customers to access the customer management interface. The page displays:
- Customer creation/edit form on the left
- List of existing customers on the right
Creating a new customer
Fill in required information
The customer form requires two mandatory fields:Name (required)
- Full customer name or business name
- Must not be empty
- Examples: “Acme Corporation”, “John Smith”
- Valid email address
- Validated with regex:
/^[^\s@]+@[^\s@]+\.[^\s@]+$/ - Used for invoice delivery
Add address details
Optional but recommended for complete customer records:
- Address: Street address or P.O. Box
- City: City or town
- State/Province: State, province, or region
- Zip/Postal Code: ZIP or postal code
- Country: Select from 85+ countries
- Defaults to “United Kingdom”
- Includes all major countries worldwide
Upload customer logo (optional)
You can add a logo for each customer:Logo requirements:Managing logos:
- Accepted formats: PNG, JPG, SVG
- Maximum file size: 2MB
- Stored as base64-encoded data URL
- Click Upload Logo to select an image
- Preview appears immediately after selection
- Click the X button on the preview to remove the logo
- Click Change Logo to replace an existing logo
Editing existing customers
To modify a customer’s information:- Locate the customer in the customer list on the right side
- Click the edit icon (pencil icon) at the bottom of the customer card
- The form on the left populates with the customer’s current information
- Make your changes to any fields
- Click “Update Customer” to save changes
- The customer list refreshes
- Future invoices will use the updated information
- Existing invoices are not affected (they store a customer snapshot)
When you edit a customer, existing invoices retain the original customer information because invoices store a
customer_snapshot (see schema.sql:23). This preserves historical accuracy.Deleting customers
To remove a customer from your list:- Click the delete icon (trash icon) on the customer card
- Confirm the deletion in the dialog prompt
- The customer is removed from your list
Using customers in invoices
When creating an invoice, customers from your list appear in the “Select Customer” dropdown:- Open the invoice creation form at
/invoices/create - Click the “Select Customer” dropdown in the Customer Information section
- Choose a customer from the list (displayed as “Name (Email)”)
- All customer fields auto-populate including name, email, address, city, state, zip code, and country
Database storage
Customers are stored in a dedicated table (fromapp/lib/schema.sql:4-14):
- Primary storage: SQLite database via
app/lib/storage.ts - Logos stored as base64-encoded strings directly in the database
- No file system storage required
Customer list display
The customer list shows each customer in a card format with:- Customer logo (if uploaded) displayed as a 40×40px rounded thumbnail
- Name in bold
- Email in muted text
- Full address formatted across multiple lines:
- Action buttons for editing and deleting
“No customers yet. Add your first customer to get started.”
Best practices
Keyboard and workflow tips
- Quick cancel: Click “Cancel” when editing to return the form to “Add Customer” mode
- Form resets: After successfully adding or updating a customer, the form automatically clears
- Validation feedback: Error messages appear in red below each field as you type
- Country selection: Start typing in the country dropdown to quickly find countries
Next steps
- Learn how to create invoices using your saved customers
- Set up company information for your invoices
- Configure payment details to include on invoices