Kenya's most precise rental platform. GPS-verified property listings with real neighbourhood intelligence — matatu routes, water schedules, and safety scores.
# PataKrib — Kenya Real Estate (Next.js 14)
Find your home in Kenya. Built with Next.js 14 App Router, Supabase PostgreSQL, Prisma, and NextAuth.
---
## Prerequisites
- Node.js 18+
- A free Supabase account
---
## Setup — Step by Step
### Step 1 — Install dependencies
```bash
npm install
```
---
### Step 2 — Set up Supabase
1. Go to supabase.com and create a new project.
2. Wait for the project to finish provisioning (~1 min).
3. Open **Settings → Database → Connection String** and copy the **URI** (not the pooler, unless you're on a serverless platform).
4. Open **Settings → API** and copy:
- **Project URL** (`NEXT_PUBLIC_SUPABASE_URL`)
- **anon/public** key (`NEXT_PUBLIC_SUPABASE_ANON_KEY`)
- **service_role** key (`SUPABASE_SERVICE_ROLE_KEY`) — keep this secret
5. Create two **Storage buckets** (Storage → New bucket):
- `property-images` — set to **Public**
- `property-videos` — set to **Public**
Fill in `.env.local` with the values you just copied:
```env
NEXTAUTH_SECRET=any-long-random-string
NEXTAUTH_URL=
localhost
DATABASE_URL=postgresql://postgres:[PASSWORD]@db.[PROJECT-REF].supabase.co:5432/postgres
NEXT_PUBLIC_SUPABASE_URL=
https://[PROJECT-REF].supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=...
SUPABASE_SERVICE_ROLE_KEY=...
NEXT_PUBLIC_MAPBOX_TOKEN=pk.your_token_here
```
---
### Step 3 — Generate Prisma client
```bash
npx prisma generate
```
This reads `prisma/schema.prisma` and generates type-safe DB client code into `node_modules/@prisma/client`.
---
### Step 4 — Push schema to Supabase
```bash
npx prisma db push
```
Creates all tables in your Supabase PostgreSQL database. Safe to re-run — it's idempotent in dev.
---
### Step 5 — Seed the database
```bash
npx prisma db seed
```
Creates:
- `admin@patacrib.co.ke` / `admin123` (ADMIN)
- `seeker@patacrib.co.ke` / `seeker123` (SEEKER)
- 6 sample properties across Westlands, Kilimani, South B, Karen, Lavington, Upperhill
You can verify the seed data in **Supabase Dashboard → Tabl …