Skip to content

Add invoice template system with custom branding #240

Description

@davedumto

Feature: Add invoice template system with custom branding

User Story

As a freelancer, I want to customize invoice appearance (logo, colors, footer text) so my brand is consistent across all client communications.

Current Behavior

  • All invoices use default LancePay template
  • No customization options
  • Generic "LancePay" branding

Proposed Feature

Add invoice template editor:

API Endpoints:

GET  /api/routes-d/branding/templates       // List templates
POST /api/routes-d/branding/templates       // Create template
PUT  /api/routes-d/branding/templates/[id]  // Update template
GET  /api/routes-d/branding/templates/[id]  // Get template

Template Schema:

interface InvoiceTemplate {
  id: string;
  userId: string;
  name: string;
  isDefault: boolean;
  
  // Branding
  logoUrl?: string;
  primaryColor: string;   // hex color
  accentColor: string;
  
  // Customization
  showLogo: boolean;
  showFooter: boolean;
  footerText?: string;    // "Thank you for your business!"
  
  // Layout
  layout: 'modern' | 'classic' | 'minimal';
  
  createdAt: Date;
  updatedAt: Date;
}

Invoice Preview:

┌─────────────────────────────────────┐
│ [USER LOGO]          Invoice #12345 │
│                                     │
│ Bill To: client@company.com         │
│ Amount: $500.00                     │
│ Due: Jan 30, 2026                   │
│                                     │
│ [Pay with USDC Button]              │
│                                     │
│ Custom footer: "Thanks for your     │
│ business! Net 30 terms apply."      │
└─────────────────────────────────────┘

Acceptance Criteria

  • Users can upload custom logo (max 2MB)
  • Hex color picker for primary/accent colors
  • Live preview of invoice template
  • Set default template (applies to all new invoices)
  • Max 5 templates per user
  • Templates apply to email notifications too
  • Export invoice as branded PDF

Files to Create

  • app/api/routes-d/branding/templates/route.ts
  • app/api/routes-d/branding/templates/[id]/route.ts
  • components/settings/TemplateEditor.tsx
  • lib/invoice-renderer.tsx (PDF generation)

Database Migration

model InvoiceTemplate {
  id           String   @id @default(cuid())
  userId       String
  name         String
  isDefault    Boolean  @default(false)
  logoUrl      String?
  primaryColor String   @default("#000000")
  accentColor  String   @default("#059669")
  showLogo     Boolean  @default(true)
  showFooter   Boolean  @default(true)
  footerText   String?
  layout       String   @default("modern")
  createdAt    DateTime @default(now())
  updatedAt    DateTime @updatedAt
  
  user User @relation(fields: [userId], references: [id], onDelete: Cascade)
  
  @@index([userId, isDefault])
}

Priority

Medium - Nice-to-have for brand-conscious freelancers

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions