-
Notifications
You must be signed in to change notification settings - Fork 7
Added a setup.md as per owner specification #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
CoolatMax
wants to merge
7
commits into
yashdev9274:main
Choose a base branch
from
CoolatMax:setupbr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
10ead69
Added a setup.md as per owner specification
fc1f0b3
Modified the Readme after owner's comments
7bbf14b
fixed the codeblocks and the Invoice intelligence codeblock too
1eb9fc2
Added bash as language in codeblocks
92ee739
fixed markdownlint (MD035) issue
714940a
added language identifer for directory tree, used syntax highlighing …
0e6d760
Final correction in setup.md
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 <your-repo-url> | ||
| 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. | ||
|
|
||
| --- | ||
|
|
||
CoolatMax marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## Key Features | ||
| ### 1. Invoice Intelligence (AI-powered) | ||
| Located in `/lib/invoiceAgent.ts` | ||
|
|
||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * 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. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.