Version: 0.1.0
Last Updated: April 2026
Technology: T3 Stack (Next.js 15, TypeScript, Prisma, tRPC)
The KAAA Tender Management System is a comprehensive web-based platform designed to manage the complete tender lifecycle — from project creation and tender publishing to vendor bidding, comparative analysis, board review, and contract awards.
git clone <repository-url> cd kaaa-tender
npm install
This will automatically run prisma generate after installation (configured in postinstall script).
Create a .env file in the root directory:
DATABASE_URL="postgresql://username:password@localhost:5432/kaaa_tender" AUTH_SECRET="your-secret-key-here" NODE_ENV="development"
.env file to version control. It is already included in .gitignore.
# Push schema to database (development only) npm run db:push # OR create a migration and apply it npm run db:generate npm run db:migrate # Seed the database with initial data npm run db:seed
npm run dev
Open http://localhost:3000 in your browser.
| Command | Description |
|---|---|
npm run dev | Start development server with Turbopack (fast refresh) |
npm run check | Run linter and TypeScript type checking |
npm run lint | Check code with ESLint |
npm run lint:fix | Auto-fix linting issues |
npm run format:write | Format code with Prettier |
npm run format:check | Check code formatting |
| Command | Description |
|---|---|
npm run db:push | Push schema changes without migrations (dev only) |
npm run db:generate | Create a new migration from schema changes |
npm run db:migrate | Apply pending migrations to database |
npm run db:seed | Populate database with seed data |
npm run db:studio | Open Prisma Studio GUI for database browsing |
# Build for production npm run build # Start production server npm run start # Or build and preview locally npm run preview
| Role | Description | Key Permissions |
|---|---|---|
| SUPER_ADMIN | System administrator | Full system access, user management, system settings |
| PROJECT_MANAGER | Project lead | Create/edit projects, manage tenders, oversee bidding |
| ADMIN_STAFF | Administrative support | Assist with tender management, vendor coordination |
| FINANCE_OFFICER | Financial oversight | Review financial aspects, budget tracking |
| BOARD_MEMBER | Board reviewer | Review bids, vote on awards, access board decisions |
| VENDOR | External bidder | View published tenders, submit bids, track status |
| Status | Description |
|---|---|
DRAFT | Tender is being prepared, not visible to vendors |
PUBLISHED | Tender is live and open for submissions |
SUBMISSIONS_RECEIVED | Deadline passed, reviewing submissions |
UNDER_ANALYSIS | Comparing and analyzing received bids |
BOARD_REVIEW | Sent to board for decision |
AWARDED | Contract awarded to a vendor |
REJECTED | Tender was rejected (no suitable bids) |
RE_TENDERED | Process restarted with new tender |
kaaa-tender/ ├── prisma/ │ ├── schema.prisma # Database schema definition │ ├── seed.ts # Database seed script │ └── migrations/ # Database migration files ├── public/ # Static assets ├── src/ │ ├── app/ # Next.js App Router pages │ │ ├── (dashboard)/ # Dashboard layout group │ │ ├── login/ # Authentication pages │ │ ├── register/ # User registration │ │ ├── reports/ # Reports and analytics │ │ └── vendor-portal/ # Vendor-facing pages │ ├── components/ # Reusable UI components │ │ ├── bid/ # Bid-related components │ │ ├── items/ # Item management components │ │ └── ui/ # Base UI components (shadcn) │ ├── server/ # Backend logic │ │ ├── routers/ # tRPC API routers │ │ ├── services/ # Business logic services │ │ └── trpc.ts # tRPC configuration │ ├── lib/ # Utility libraries │ │ ├── hooks/ # React Query hooks │ │ ├── formatters/ # Data formatting utilities │ │ ├── auth.ts # NextAuth configuration │ │ ├── db.ts # Prisma client instance │ │ └── utils.ts # General utilities │ ├── trpc/ # tRPC client setup │ └── styles/ # Global CSS styles ├── .env # Environment variables (DO NOT COMMIT) ├── package.json # Node.js dependencies └── README.md # Project documentation
React framework with file-based routing. Uses the App Router with server-side rendering and client-side navigation.
Type-safe JavaScript that catches errors during development and improves code maintainability.
Type-safe database ORM for PostgreSQL. Schema defined in prisma/schema.prisma.
Type-safe API layer between frontend and backend. No code generation needed — types are inferred automatically.
Authentication library with support for multiple providers, JWT sessions, and role-based access control.
Utility-first CSS framework for rapid UI development. Custom design system with shadcn/ui components.
| Router | Description |
|---|---|
auth.router.ts | Authentication and user management |
project.router.ts | Project CRUD operations |
tender.router.ts | Tender notice management |
vendor.router.ts | Vendor registration and management |
boq.router.ts | Bill of Quantities operations |
report.router.ts | Reporting and analytics |
notification.router.ts | User notifications |
| Procedure | Access Level |
|---|---|
publicProcedure | Anyone (no auth required) |
protectedProcedure | Any authenticated user |
adminProcedure | SUPER_ADMIN, ADMIN_STAFF, PROJECT_MANAGER |
superAdminProcedure | SUPER_ADMIN only |
financeProcedure | SUPER_ADMIN, FINANCE_OFFICER |
boardProcedure | SUPER_ADMIN, BOARD_MEMBER |
vendorProcedure | VENDOR only |
Database connection fails
Check that PostgreSQL is running and DATABASE_URL in .env is correct.
Prisma Client not found
Run npm run postinstall or npx prisma generate to regenerate the client.
Port 3000 already in use
Either stop the other process or change the port: npm run dev -- -p 3001
Migration errors
Reset the database (development only): npx prisma migrate reset
TypeScript errors
Run npm run typecheck to see all type errors. Fix them before building.
npm run build automaticallyAUTH_SECRET="strong-production-secret" DATABASE_URL="postgresql://prod-db-url" NODE_ENV="production"
npm run db:migrate (not db:push) on productionNODE_ENV=productionThis manual provides a quick start guide for the KAAA Tender Management System. For detailed technical documentation, refer to the inline code comments and the official documentation of the respective technologies used.