No description
| .forgejo/workflows | ||
| .kilo/plans | ||
| data/secrets | ||
| scripts/hermes | ||
| src | ||
| tests | ||
| .env.example | ||
| .eslintrc.json | ||
| .gitignore | ||
| .quickfix-plan.md | ||
| .semgrepignore | ||
| AGENTS.md | ||
| bun.lock | ||
| drizzle.config.ts | ||
| lefthook.yml | ||
| next-env.d.ts | ||
| next.config.js | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.js | ||
| README.md | ||
| tailwind.config.js | ||
| tsconfig.json | ||
| vitest.config.ts | ||
Forgeflow
A hardware-first project tracker that turns BOM + revisions + supplier comms into a single, searchable timeline.
Features
- BOM Workspace + Part Library — Create parts with MPN, manufacturer, lifecycle, preferred supplier, lead time, unit cost, and attachments
- BOM Import (CSV) — Upload a spreadsheet BOM, map columns, dedupe parts by MPN, and generate a clean baseline
- Revisioned BOM Snapshots — Every change creates a revision with diff (qty, MPN swap, supplier swap, cost/lead-time edits)
- Change Requests + Approvals — Propose substitutions/qty changes, route for approval, and automatically create a new BOM revision when approved
- Project Timeline — A chronological feed combining BOM revisions, change approvals, and key milestones
- Supplier/Quote Tracker — Track supplier quotes per part (price breaks, MOQ, lead time, validity date)
- Export Pack — One-click export of current BOM (CSV) plus a revision diff
Tech Stack
- Next.js 14+ App Router
- React 18 + TypeScript (strict)
- Drizzle ORM + PostgreSQL
- Tailwind CSS + shadcn/ui
- Clerk (auth + orgs)
- Stripe (subscriptions)
- Resend (emails)
- UploadThing (file uploads)
Getting Started
-
Clone the repository
-
Install dependencies:
npm install -
Set up environment variables:
cp .env.example .env.localFill in all required environment variables.
-
Set up the database:
npm run db:push -
Run the development server:
npm run dev -
Open http://localhost:3000 in your browser.
Environment Variables
| Variable | Description |
|---|---|
DATABASE_URL |
PostgreSQL connection string |
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY |
Clerk public key |
CLERK_SECRET_KEY |
Clerk secret key |
CLERK_WEBHOOK_SECRET |
Clerk webhook secret (optional) |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY |
Stripe public key |
STRIPE_SECRET_KEY |
Stripe secret key |
STRIPE_WEBHOOK_SECRET |
Stripe webhook secret |
RESEND_API_KEY |
Resend API key |
UPLOADTHING_SECRET |
UploadThing secret |
UPLOADTHING_APP_ID |
UploadThing app ID |
Database Schema
The application uses the following entities:
- User — Application users synced from Clerk
- Organization — Workspaces/teams
- OrgMember — Organization membership with roles
- Project — Hardware projects
- Part — Component library (deduped by MPN)
- Bom — Bill of Materials
- BomRevision — Versioned BOM snapshots
- BomLine — Individual BOM entries
- ChangeRequest — Proposed changes
- ChangeItem — Individual change items
- Quote — Supplier quotes
- TimelineEvent — Project activity feed
API Routes
| Method | Route | Description |
|---|---|---|
| GET | /api/orgs/current | Get current org context |
| GET | /api/projects | List projects |
| POST | /api/projects | Create project |
| GET | /api/projects/:id | Get project details |
| GET | /api/projects/:id/boms | List project BOMs |
| GET | /api/projects/:id/timeline | Get project timeline |
| POST | /api/boms/import | Import BOM from CSV |
| GET | /api/boms/:id/revisions | List BOM revisions |
| GET | /api/boms/:id/revisions/:revId | Get revision with lines |
| GET | /api/changes | List change requests |
| POST | /api/changes | Create change request |
| POST | /api/changes/:id/decide | Approve/reject change |
Deployment
The application is designed to be deployed on Vercel:
- Push your code to GitHub
- Connect your repository to Vercel
- Configure environment variables in Vercel dashboard
- Deploy!
License
MIT