# NurseSwap Kenya
A full-stack web app that helps nurses in Kenyan public hospitals find a verified match to swap
postings with. Built entirely on free tiers: React + Vite + Tailwind on the frontend, Supabase
(Auth, Postgres, Storage) on the backend, hosted free on Vercel or Netlify.
## Folder structure
```
nurseswap-kenya/
├── index.html
├── package.json
├── vite.config.js
├── tailwind.config.js
├── postcss.config.js
├── vercel.json # SPA rewrite rule for Vercel
├── .env.example # copy to .env and fill in your Supabase keys
├── public/
│ └── _redirects # SPA rewrite rule for Netlify
├── supabase/
│ └── schema.sql # tables, RLS policies, triggers, storage bucket
└── src/
├── main.jsx
├── App.jsx # route definitions
├── index.css # Tailwind layers + shared component classes
├── lib/
│ └── supabaseClient.js
├── data/
│ └── hospitals.js # editable list of Kenyan public hospitals
├── context/
│ └── AuthContext.jsx # session, profile, isAdmin, isVerified
├── components/
│ ├── Navbar.jsx
│ ├── Footer.jsx
│ ├── ProtectedRoute.jsx
│ ├── AdminRoute.jsx
│ ├── HospitalMultiSelect.jsx
│ └── StatusBadge.jsx
└── pages/
├── Landing.jsx # /
├── Register.jsx # /register
├── Payment.jsx # /payment
├── Login.jsx # /login
├── Dashboard.jsx # /dashboard (verified only)
├── Browse.jsx # /browse (verified only)
├── Profile.jsx # /profile
└── Admin.jsx # /admin (admin email only)
```
## 1. Create your Supabase project (free)
1. Go to supabase.com → New Project. The free tier covers this app
comfortably.
2. In **Project Settings → API**, copy the **Project URL** and **anon public key**.
3. In **SQL Editor**, paste the entire contents of `supabase/schema.sql` and run it.
4. **Before running it**, find the two `is_admin()` and `protect_verified_column` sections and
replace `'admin@example.com'` with the real email you will …