Getting Started

Installation

Set up OpenInvoice on your system

Prerequisites

Before you begin, make sure you have:

  • Node.js 18+ or Bun installed
  • PostgreSQL database (local or cloud)
  • Clerk account (for authentication) - Sign up here
  • Git installed

Installation Steps

1. Clone the Repository

Terminal
git clone https://github.com/usaikoo/openinvoice.git
cd openinvoice

2. Install Dependencies

Using Bun (recommended):

Terminal
bun install

Or using npm:

Terminal
npm install

3. Set Up Environment Variables

Copy the example environment file:

Terminal
cp env.example.txt .env.local

Edit .env.local and configure the following required variables:

Required Configuration

# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key

# Database
DATABASE_URL=postgresql://user:password@localhost:5432/openinvoice

# Clerk Redirect URLs
NEXT_PUBLIC_CLERK_SIGN_IN_URL="/auth/sign-in"
NEXT_PUBLIC_CLERK_SIGN_UP_URL="/auth/sign-up"
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL="/dashboard/overview"
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL="/dashboard/overview"

Optional Configuration

For full functionality, you may also want to configure:

See the Environment Variables guide for complete configuration details.

4. Set Up the Database

Generate Prisma Client:

Terminal
bun prisma generate

Run database migrations:

Terminal
bun prisma migrate dev

This will create all necessary database tables.

5. Run the Development Server

Start the development server:

Terminal
bun run dev

The application will be available at http://localhost:3000

Next Steps

  1. Set up Clerk - Configure authentication and organizations
  2. First Steps - Create your account and workspace
  3. Configure Integrations - Set up Stripe, Resend, and other services

Troubleshooting

If you encounter any issues during installation:

  • Database connection errors: Verify your DATABASE_URL is correct and PostgreSQL is running
  • Clerk errors: Make sure your Clerk keys are correct and the app is configured in Clerk Dashboard
  • Migration errors: Try resetting the database: bun prisma migrate reset

For more help, see the Troubleshooting section.