Skip to content

abidingengineering-works/abiding-erp

Repository files navigation

Abiding Engineering Works ERP

Full-stack ERP web application for internal manufacturing operations.

Stack

  • Next.js 14 App Router + TypeScript
  • Tailwind CSS (industrial dark blue theme)
  • Prisma ORM + PostgreSQL
  • NextAuth Credentials (email/password)
  • UploadThing for tender PDF uploads
  • Role-based dashboards + route protection
  • Activity logging for create/update/delete actions

Folder Structure

abiding-erp/
├── app/
│   ├── (auth)/login/page.tsx
│   ├── activity-logs/page.tsx
│   ├── api/
│   │   ├── auth/[...nextauth]/route.ts
│   │   ├── logs/route.ts
│   │   ├── orders/route.ts
│   │   ├── payments/route.ts
│   │   ├── products/route.ts
│   │   ├── tenders/[id]/status/route.ts
│   │   ├── tenders/route.ts
│   │   ├── uploadthing/{core.ts,route.ts}
│   │   └── users/{route.ts,[id]/reset-password/route.ts}
│   ├── dashboard/page.tsx
│   ├── products/page.tsx
│   ├── tenders/page.tsx
│   ├── globals.css
│   ├── layout.tsx
│   └── page.tsx
├── components/sidebar.tsx
├── lib/
│   ├── activity-logger.ts
│   ├── auth.ts
│   ├── prisma.ts
│   ├── rbac.ts
│   └── route-auth.ts
├── prisma/{schema.prisma,seed.ts}
├── middleware.ts
└── .env.example

Roles

  • Owner
  • Sales
  • Manufacturing
  • TenderExecutive
  • Logistics
  • Quality
  • Accounts

Local Development

  1. Install dependencies:
    npm install
  2. Copy env:
    cp .env.example .env
  3. Run PostgreSQL and update DATABASE_URL.
  4. Generate Prisma client and migrate:
    npm run prisma:generate
    npm run prisma:migrate -- --name init
  5. Seed Owner user:
    npm run prisma:seed
  6. Start dev server:
    npm run dev

Default owner login after seed:

  • Email: owner@abiding.local
  • Password: owner1234

Vercel Deployment

  1. Push repository to Git provider.
  2. Import project into Vercel.
  3. Set environment variables:
    • DATABASE_URL
    • NEXTAUTH_SECRET
    • NEXTAUTH_URL
    • UPLOADTHING_SECRET
    • UPLOADTHING_APP_ID
  4. Add a managed PostgreSQL (Vercel Postgres/Neon/Supabase).
  5. Set build command:
    npm run prisma:generate && npm run build
  6. Run migrations from CI/CD or one-off release phase:
    npx prisma migrate deploy

Notes

  • API routes enforce role checks server-side.
  • Activity logs are owner-only in both middleware and API.
  • Product total cost is calculated server-side from subparts.
  • Tender status transitions are role-restricted.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages