invoify

repository·master·Indexed 27 days ago

https://github.com/al1abb/invoify

A web-based invoice generation application built with Next.js, TypeScript, and Shadcn UI. It allows users to create, preview, and manage professional invoices with support for multiple templates and locales. Features include exporting invoices as PDFs, JSON, XLSX, CSV, and XML, as well as sending PDFs via email using Nodemailer.

Tokens
1.4K
Snippets
4
Records
10
Agent score
92%

What's inside invoify

  1. Overview of Invoify features

    master

    Invoify is a web-based invoice generator built with Next.js, TypeScript, and Shadcn UI.

    Key Features:

    • Invoice Creation: Simple forms with live preview.
    • Storage: Save invoices in your browser for future retrieval.
    • Export Options: Download as PDF or send via email. Supports exporting data in JSON, XLSX, CSV, and XML formats.
    • Templates: Multiple invoice templates available.

    Known Issue: Users may encounter issues when using the Mozilla Firefox browser.

  2. Install and run Invoify locally

    master

    To set up Invoify on your local machine, ensure you have Node.js and npm installed. Follow these steps to clone the repository, install dependencies, and start the development server.

    Note: If you intend to use the feature that sends PDFs via email, you must configure the environment variables as described in the configuration section.

    git clone https://github.com/al1abb/invoify.git
    cd invoify
    npm install
    npm run dev
  3. Configure Nodemailer environment variables

    master

    To enable the feature for sending invoices via email, create an .env.local file in the root directory and provide your email credentials using the following keys:

    NODEMAILER_EMAIL=your_email@example.com
    NODEMAILER_PW=your_email_password
  4. Configure the Puppeteer cache directory

    master

    You can specify a custom location for the Puppeteer cache directory using the cacheDirectory property in puppeteer.config.cjs. This is useful for controlling where browser binaries are stored within the project structure.

    module.exports = {
        cacheDirectory: join(__dirname, ".cache", "puppeteer"),
    };
  5. Available Signature Colors and Fonts

    master

    Invoify supports specific signature styles for invoices:

    Colors:

    • black (rgb(0, 0, 0))
    • dark blue (rgb(0, 0, 128))
    • crimson (#DC143C)

    Fonts:

    • Dancing Script (var(--font-dancing-script))
    • Parisienne (var(--font-parisienne))
    • Great Vibes (var(--font-great-vibes))
    • Alex Brush (var(--font-alex-brush))
  6. Supported Locales

    master

    The application supports the following locales:

    CodeName
    enEnglish
    deDeutsch
    itItaliano
    esEspañol
    caCatalà
    frFrançais
    arالعربية
    plPolish
    pt-BRPortuguês (Brasil)
    trTürkçe
    zh-CN简体中文
    ja日本語
    nb-NONorwegian (bokmål)
    nn-NONorwegian (nynorsk)
  7. Invoice Form Data Schema

    master

    The FORM_DEFAULT_VALUES object defines the structure and default values for the invoice creation form. It includes sections for sender, receiver, and details (which contains items, currency, tax, discounts, shipping, and payment information).

    export const FORM_DEFAULT_VALUES = {
      sender: {
        name: "",
        address: "",
        zipCode: "",
        city: "",
        country: "",
        email: "",
        phone: "",
        customInputs: [],
      },
      receiver: {
        name: "",
        address: "",
        zipCode: "",
        city: "",
        country: "",
        email: "",
        phone: "",
        customInputs: [],
      },
      details: {
        invoiceLogo: "",
        invoiceNumber: "",
        invoiceDate: "",
        dueDate: "",
        items: [
          {
            name: "",
            description: "",
            quantity: 0,
            unitPrice: 0,
            total: 0,
          },
        ],
        currency: "USD",
        language: "English",
        taxDetails: {
          amount: 0,
          amountType: "amount",
          taxID: "",
        },
        discountDetails: {
          amount: 0,
          amountType: "amount",
        },
        shippingDetails: {
          cost: 0,
          costType: "amount",
        },
        paymentInformation: {
          bankName: "",
          accountName: "",
          accountNumber: "",
        },
        additionalNotes: "",
        paymentTerms: "",
        totalAmountInWords: "",
        pdfTemplate: 1,
      },
    };
  8. Merge Tailwind CSS classes with cn()

    master
    Use the cn utility function to conditionally merge Tailwind CSS classes. It combines the functionality of clsx (for conditional class logic) and tailwind-merge (to resolve Tailwind class conflicts, ensuring the last class applied wins).