A modern, full-stack website for TEXTKPTI (Technical Education & Training Institute) built with Next.js 15+, TypeScript, Supabase, and Prisma.
- Framework: Next.js 15+ (App Router, Server Components/Actions)
- Language: TypeScript (full type-safety)
- Styling: Tailwind CSS + shadcn/ui
- Database: Supabase PostgreSQL + Prisma ORM (pooled connection via Supavisor)
- Auth: NextAuth.js (credentials for admin dashboard only)
- Storage: Supabase Storage (gallery images, uploaded files)
- Payment: bKash Checkout API
- PDF Generation: pdf-lib (server-side)
- Forms: react-hook-form + Zod
- Icons: lucide-react
- Deployment: Vercel
kpti-website/
├── app/ # App Router
│ ├── (public)/ # Public routes (no auth)
│ │ ├── layout.tsx # Header, footer, nav
│ │ ├── page.tsx # Home (Landing page with ALL courses)
│ │ ├── about/page.tsx
│ │ ├── admission/page.tsx # Form + bKash flow
│ │ ├── gallery/page.tsx
│ │ ├── notices/page.tsx
│ │ └── contact/page.tsx
│ │ # Note: No separate course pages - all courses on landing page
│ ├── admin/ # Protected routes
│ │ ├── layout.tsx # Sidebar + header
│ │ ├── dashboard/page.tsx
│ │ ├── admissions/page.tsx # List + status update
│ │ ├── notices/page.tsx # CRUD
│ │ ├── courses/page.tsx
│ │ ├── gallery/page.tsx # Upload to Supabase Storage
│ │ └── settings/page.tsx
│ ├── api/
│ │ └── bkash/
│ │ ├── create/route.ts # Init payment
│ │ └── callback/route.ts # Handle callback
│ ├── admission-success/page.tsx # Success + PDF download
│ └── globals.css
├── components/
│ ├── ui/ # shadcn components
│ ├── layout/ # Header/Footer/Sidebar
│ ├── forms/ # Forms
│ └── shared/ # Cards, grids
├── lib/
│ ├── prisma.ts # Prisma client singleton
│ ├── supabase.ts # Supabase client (for storage)
│ ├── auth.ts # Auth.js config
│ ├── pdf.ts # PDF generator
│ └── bkash.ts # bKash helpers
├── prisma/
│ └── schema.prisma
├── public/ # Static assets
├── types/
├── middleware.ts # Protect admin routes
└── .env.local # Environment variables
- Node.js 18+ and npm/yarn/pnpm
- Supabase account (free tier works)
- bKash merchant account (sandbox for testing)
git clone <repository-url>
cd kpti-website
npm install- Create a new project in Supabase Dashboard
- Go to Project Settings → API and copy:
- Project URL
- Anon Key
- Go to Project Settings → Database and get connection string
- Use Transaction mode (port 6543) for pooled connection:
postgresql://postgres.[project-ref]:[PASSWORD]@aws-0-[region].pooler.supabase.com:6543/postgres?pgbouncer=true
Copy .env.example to .env.local and fill in:
cp .env.example .env.localRequired variables:
NEXT_PUBLIC_SUPABASE_URL- Your Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY- Your Supabase anon keyDATABASE_URL- Supabase pooled connection string (port 6543)NEXTAUTH_URL- Your app URL (http://localhost:3000 for dev)NEXTAUTH_SECRET- Generate with:openssl rand -base64 32BKASH_*- bKash API credentials (sandbox for testing)
# Push schema to database
npm run db:push
# (Optional) Seed initial data
npm run db:seed- Go to Storage in Supabase Dashboard
- Create buckets:
gallery(public)files(public or private as needed)
- Set bucket policies if needed
# Install a component (example: button)
npx shadcn@latest add button
# Install commonly used components
npx shadcn@latest add card table form input label textarea select dialog dropdown-menunpm run devVisit http://localhost:3000
- Course: Course information (title, description, duration, fee)
- Admission: Student admission applications with payment status
- Notice: Public notices/announcements
- GalleryImage: Gallery images stored in Supabase Storage
- User: Admin users for dashboard access
- Create admin user via Prisma Studio or seed script:
npx prisma studio
- Hash password with bcrypt before saving
- Login at
/admin-login
- Get sandbox credentials from bKash Developer Portal
- Update
.env.localwith bKash credentials - Test payment flow in sandbox mode
- Update
BKASH_BASE_URLto production URL when ready
- Push code to GitHub
- Import project in Vercel
- Add environment variables in Vercel dashboard
- Deploy!
Vercel automatically:
- Detects Next.js
- Sets up HTTPS
- Provides preview URLs for PRs
- Optimizes builds
- Phase 1 (5-8 days): Setup, public pages, data fetching
- Phase 2 (5-8 days): Admin dashboard, auth, CRUD, storage upload
- Phase 3 (7-12 days): Admission form, bKash integration, PDF generation
- Phase 4 (3-5 days): Polish, responsive design, SEO, deployment
Private project for TEXTKPTI