From 10ead69f71df005a3fd7f731a37bd1258a2912ad Mon Sep 17 00:00:00 2001 From: SHISKEBAB Date: Tue, 8 Jul 2025 10:06:51 +0530 Subject: [PATCH 1/7] Added a setup.md as per owner specification --- setup.md | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 setup.md diff --git a/setup.md b/setup.md new file mode 100644 index 0000000..7d5eedb --- /dev/null +++ b/setup.md @@ -0,0 +1,123 @@ +# Project Setup Guide + +Welcome to the D3Flo Invoice Intelligence Platform! 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: +``` +npm install -g pnpm +``` + +* PostgreSQL or compatible DB (used by Prisma) +--- +## Directory Structure Overview + +``` +/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 reporsitory +``` +git clone +cd your-project +``` +### 2. Install dependencies +``` +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: +``` +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 +``` +npx prisma migrate dev --name init +``` +You can also introspect the existing DB schema if needed: +``` +npx prisma db pull +``` +### 5. Start the development server +``` +pnpm dev +``` + +Visit [Preview Website](http://localhost:3000) to view the app. + +--- + +## Key Features +### 1. Invoice Intelligence (AI-powered) +Located in `/lib/invoiceAgent.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: +``` +pnpm lint +``` + +Or auro-fix: +``` +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. + +--- + +## Aditional 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` + +## Licences +MIT License – free to use and modify. \ No newline at end of file From fc1f0b31b190dffcb8451a48e09243dee813bcc6 Mon Sep 17 00:00:00 2001 From: SHISKEBAB Date: Tue, 8 Jul 2025 10:18:10 +0530 Subject: [PATCH 2/7] Modified the Readme after owner's comments --- setup.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.md b/setup.md index 7d5eedb..72f0f31 100644 --- a/setup.md +++ b/setup.md @@ -29,7 +29,7 @@ npm install -g pnpm --- ## Getting started -### 1. Clone the reporsitory +### 1. Clone the repository ``` git clone cd your-project @@ -84,7 +84,7 @@ Uses `@arcjet/next` in `lib/` and `trpc/`: * Token bucket model (10 requests/hour) --- -## Tooling & Configuration: +## Tooling & Configuration ESLint (`.eslintrc.json`) * Uses `next/core-web-vitals` config * Custom rules for TS usage and relaxed JSX handling @@ -102,7 +102,7 @@ Run lint checks: pnpm lint ``` -Or auro-fix: +Or auto-fix: ``` pnpm lint --fix ``` @@ -114,10 +114,10 @@ You can deploy to Vercel, Netlify, or any Node-compatible environment. Make sure --- -## Aditional Notes +## 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` -## Licences +## Licenses MIT License – free to use and modify. \ No newline at end of file From 7bbf14bfb3d3e1dfb95311bb29922f9853d02d79 Mon Sep 17 00:00:00 2001 From: SHISKEBAB Date: Tue, 8 Jul 2025 10:24:22 +0530 Subject: [PATCH 3/7] fixed the codeblocks and the Invoice intelligence codeblock too --- setup.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.md b/setup.md index 72f0f31..bc95ebc 100644 --- a/setup.md +++ b/setup.md @@ -48,11 +48,11 @@ ARCJET_KEY=your_arcjet_key ``` ### 4. Run the database migration ``` -npx prisma migrate dev --name init +pnpx prisma migrate dev --name init ``` You can also introspect the existing DB schema if needed: ``` -npx prisma db pull +pnpx prisma db pull ``` ### 5. Start the development server ``` @@ -65,7 +65,7 @@ Visit [Preview Website](http://localhost:3000) to view the app. ## Key Features ### 1. Invoice Intelligence (AI-powered) -Located in `/lib/invoiceAgent.ts` +Located in `lib/agents/invoice-analysis.ts` * Extracts structured data from invoice text * Performs financial insights analysis From 1eb9fc2fac3182f5b307d5fd428d98e5061f9353 Mon Sep 17 00:00:00 2001 From: SHISKEBAB Date: Tue, 8 Jul 2025 10:30:05 +0530 Subject: [PATCH 4/7] Added bash as language in codeblocks --- setup.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/setup.md b/setup.md index bc95ebc..5ff05d4 100644 --- a/setup.md +++ b/setup.md @@ -12,6 +12,8 @@ Ensure you have the following installed: Install it with: ``` +bash + npm install -g pnpm ``` @@ -31,11 +33,15 @@ npm install -g pnpm ## Getting started ### 1. Clone the repository ``` +bash + git clone cd your-project ``` ### 2. Install dependencies ``` +bash + pnpm install ``` ### 3. Set up your environment variables @@ -52,10 +58,14 @@ 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 ``` @@ -99,11 +109,15 @@ TypeScript (`tsconfig.json`) ## Quality & Linting Run lint checks: ``` +bash + pnpm lint ``` Or auto-fix: ``` +bash + pnpm lint --fix ``` From 92ee7396d4b959adca3c664419a1bc20c044a8c6 Mon Sep 17 00:00:00 2001 From: SHISKEBAB Date: Tue, 8 Jul 2025 10:43:11 +0530 Subject: [PATCH 5/7] fixed markdownlint (MD035) issue --- setup.md | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/setup.md b/setup.md index 5ff05d4..8c42bdc 100644 --- a/setup.md +++ b/setup.md @@ -2,7 +2,7 @@ Welcome to the D3Flo Invoice Intelligence Platform! 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: @@ -11,8 +11,7 @@ Ensure you have the following installed: * **pnpm** ≥ v8+ Install it with: -``` -bash +```bash npm install -g pnpm ``` @@ -32,20 +31,19 @@ npm install -g pnpm ## Getting started ### 1. Clone the repository -``` -bash +```bash git clone cd your-project ``` ### 2. Install dependencies -``` -bash +```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: + ``` DATABASE_URL=postgresql://user:password@localhost:5432/dbname LANGBASE_API_KEY=your_langbase_key @@ -53,18 +51,17 @@ 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 +```bash pnpx prisma db pull ``` ### 5. Start the development server -``` -bash +```bash pnpm dev ``` @@ -108,15 +105,13 @@ TypeScript (`tsconfig.json`) --- ## Quality & Linting Run lint checks: -``` -bash +```bash pnpm lint ``` Or auto-fix: -``` -bash +```bash pnpm lint --fix ``` From 714940ace40c1063b9e8c32875a40413f0d660f2 Mon Sep 17 00:00:00 2001 From: SHISKEBAB Date: Tue, 8 Jul 2025 10:50:04 +0530 Subject: [PATCH 6/7] added language identifer for directory tree, used syntax highlighing and striped trailing spaces for the codeblocks --- setup.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/setup.md b/setup.md index 8c42bdc..fcd909f 100644 --- a/setup.md +++ b/setup.md @@ -11,7 +11,7 @@ Ensure you have the following installed: * **pnpm** ≥ v8+ Install it with: -```bash +```bash npm install -g pnpm ``` @@ -20,7 +20,8 @@ npm install -g pnpm --- ## Directory Structure Overview -``` +```text + /app - App routes, API, UI components /components - Reusable UI elements /lib - Utilities (CSV export, invoice agents) @@ -31,7 +32,7 @@ npm install -g pnpm ## Getting started ### 1. Clone the repository -```bash +```bash git clone cd your-project @@ -44,14 +45,15 @@ 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 +```bash pnpx prisma migrate dev --name init ``` From 0e6d7608a815bb589600bc81060b8660c87edccf Mon Sep 17 00:00:00 2001 From: SHISKEBAB Date: Tue, 8 Jul 2025 13:44:00 +0530 Subject: [PATCH 7/7] Final correction in setup.md --- setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.md b/setup.md index fcd909f..f86753c 100644 --- a/setup.md +++ b/setup.md @@ -1,6 +1,6 @@ # Project Setup Guide -Welcome to the D3Flo Invoice Intelligence Platform! This guide walks you through the full setup required to run the application locally or in a development environment. +Welcome to the LaminarFlow! This guide walks you through the full setup required to run the application locally or in a development environment. --- ## Prerequisites