A Campus-Based E-Commerce Platform for Federal University Lokoja
Built with Next.js 14, TypeScript, PostgreSQL (Neon), Prisma ORM, and NextAuth.js.
| Layer | Technology |
|---|---|
| Frontend | Next.js 14 (App Router) + TypeScript |
| Styling | Tailwind CSS |
| Backend | Next.js API Routes |
| Auth | NextAuth.js (JWT) |
| Database | PostgreSQL via Neon (serverless) |
| ORM | Prisma |
| Deployment | Vercel |
git clone <your-repo>
cd campusmart
npm installcp .env.example .env.localFill in your values in .env.local:
DATABASE_URL— your Neon PostgreSQL connection stringNEXTAUTH_SECRET— runopenssl rand -base64 32to generateNEXTAUTH_URL—http://localhost:3000for local dev
# Generate Prisma client (required before build/dev)
npx prisma generate
# Push schema to your Neon database
npx prisma db push
# Seed demo data
npx prisma db seednpm run devNote:
postinstallrunsprisma generateautomatically after everynpm install/pnpm install. Thebuildscript also runs it. You only need to run it manually the very first time if you skip the install step.
Visit http://localhost:3000
| Role | Password | |
|---|---|---|
| Buyer | buyer@campusmart.ng | password123 |
| Vendor | vendor@campusmart.ng | password123 |
| Admin | admin@campusmart.ng | password123 |
campusmart/
├── app/
│ ├── api/ # API routes
│ │ ├── auth/ # NextAuth
│ │ ├── register/ # User registration
│ │ ├── products/ # Products CRUD
│ │ └── cart/ # Cart management
│ ├── dashboard/ # User dashboard
│ ├── login/ # Login page
│ ├── register/ # Registration page
│ ├── products/ # Product listing & detail
│ └── layout.tsx # Root layout
├── components/
│ ├── ui/ # Button, Input, Badge, Select
│ └── shared/ # Navbar, Footer, ProductCard
├── lib/
│ ├── auth.ts # NextAuth config
│ ├── prisma.ts # Prisma client
│ ├── utils.ts # Helper functions
│ └── validations.ts # Zod schemas
├── prisma/
│ ├── schema.prisma # Database schema
│ └── seed.ts # Demo data seeder
└── types/
└── next-auth.d.ts # Auth type extensions
- Push your code to GitHub
- Connect repo to Vercel
- Add environment variables in Vercel dashboard
- Deploy — Vercel auto-detects Next.js
- ✅ Sprint 1: Auth system (register/login), DB schema, project setup
- 🔄 Sprint 2: Product listings, categories, image upload
- ⏳ Sprint 3: Search/filter, product detail page
- ⏳ Sprint 4: Cart, orders, vendor dashboard
- ⏳ Sprint 5: Messaging, buyer dashboard
- ⏳ Sprint 6: Admin panel, polish, deployment