Setup

Installation

Developer installation guide for OpenInvoice

Prerequisites

Before you begin, ensure you have:

  • Node.js 18+ or Bun installed
  • PostgreSQL database (local or cloud)
  • Git installed
  • Clerk account for authentication
  • Basic knowledge of:
    • Next.js
    • TypeScript
    • React
    • PostgreSQL

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. Environment Variables

Copy the example environment file:

Terminal
cp env.example.txt .env.local

Configure required environment variables (see Environment Variables).

4. Database Setup

Generate Prisma Client:

Terminal
bun prisma generate

Run database migrations:

Terminal
bun prisma migrate dev

5. Start Development Server

Terminal
bun run dev

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

Development Scripts

Available Scripts

# Development
bun run dev          # Start development server

# Build
bun run build        # Build for production
bun run start        # Start production server

# Code Quality
bun run lint         # Run ESLint
bun run lint:fix     # Fix linting issues
bun run format       # Format code with Prettier

# Database
bun prisma generate  # Generate Prisma Client
bun prisma migrate   # Run migrations
bun prisma studio    # Open Prisma Studio

Project Structure

src/
├── app/                    # Next.js App Router
│   ├── api/               # API routes
│   ├── dashboard/         # Dashboard pages
│   └── (auth)/            # Auth pages
├── components/            # React components
│   ├── ui/               # Shadcn UI components
│   └── layout/           # Layout components
├── features/             # Feature modules
│   ├── invoicing/       # Invoice features
│   ├── kanban/          # Kanban features
│   └── overview/        # Dashboard features
├── lib/                  # Utilities
│   ├── db.ts            # Prisma client
│   └── utils.ts         # Helper functions
└── prisma/              # Database schema
    └── schema.prisma    # Prisma schema

Next Steps