Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Project Setup Guide

Welcome to the LaminarFlow! This guide walks you through the full setup required to run the application locally or in a development environment.

---
## Prerequisites
Ensure you have the following installed:

* **Node.js** ≥ v18+

* **pnpm** ≥ v8+

Install it with:
```bash

npm install -g pnpm
```

* PostgreSQL or compatible DB (used by Prisma)
---
## Directory Structure Overview

```text

/app - App routes, API, UI components
/components - Reusable UI elements
/lib - Utilities (CSV export, invoice agents)
/trpc - Backend procedures and logic
/styles - Tailwind and global styles
```
---

## Getting started
### 1. Clone the repository
```bash

git clone <your-repo-url>
cd your-project
```
### 2. Install dependencies
```bash

pnpm install
```
### 3. Set up your environment variables
Create a `.env` file at the root of your project. You can copy from `.env.example` if provided, and define the following:

```dotenv

DATABASE_URL=postgresql://user:password@localhost:5432/dbname
LANGBASE_API_KEY=your_langbase_key
GOOGLE_API_KEY=your_google_api_key
ARCJET_KEY=your_arcjet_key
```
### 4. Run the database migration
```bash

pnpx prisma migrate dev --name init
```
You can also introspect the existing DB schema if needed:
```bash

pnpx prisma db pull
```
### 5. Start the development server
```bash

pnpm dev
```

Visit [Preview Website](http://localhost:3000) to view the app.

---

Comment thread
CoolatMax marked this conversation as resolved.
## Key Features
### 1. Invoice Intelligence (AI-powered)
Located in `lib/agents/invoice-analysis.ts`

* Extracts structured data from invoice text
* Performs financial insights analysis
* Auto-generates payment reminder emails using Gemini 2.0 via Langbase

### 2. CSV Export Utility
Found in `lib/downloadCSV.ts`

* Converts arrays of invoice data into CSV
* Adds timestamped filenames
* Displays toast notifications using `sonner`

### 3. API Rate Limiting
Uses `@arcjet/next` in `lib/` and `trpc/`:
* Based on IP (`ip.src`)
* Token bucket model (10 requests/hour)

---
## Tooling & Configuration
ESLint (`.eslintrc.json`)
* Uses `next/core-web-vitals` config
* Custom rules for TS usage and relaxed JSX handling

TypeScript (`tsconfig.json`)
* Strict mode enabled
* JSX support (`preserve`)
* Modern module resolution
* Path aliasing (`@/*` → `./*`)

---
## Quality & Linting
Run lint checks:
```bash

pnpm lint
```

Or auto-fix:
```bash

pnpm lint --fix
```

---
## Deployment

You can deploy to Vercel, Netlify, or any Node-compatible environment. Make sure to configure all `.env` variables in your hosting provider's dashboard.

---

## Additional Notes
* Uses `tailwind-merge` and `clsx` for clean class name composition
* Generates consistent section IDs with `createSectionId` helper
* Prisma Client and database utils found under `app/utils/db.ts`

## Licenses
MIT License – free to use and modify.