Maternal delivery preparation and support platform for rural Zimbabwe.
# AmaiReady
Maternal delivery preparation and support platform.
- **Client:** React + Vite + Tailwind + Better Auth
- **Server:** Elysia + Bun + Drizzle + PostgreSQL + Better Auth
## Project structure
```text
amai-ready/
api/ # Vercel Function wrapping the Elysia app
client/ # React frontend
server/ # Elysia API (also runs standalone for local development)
```
## Prerequisites
- Bun
- PostgreSQL database
## Setup
### 1. Server
```bash
cd server
cp .env.example .env
# edit .env with your DATABASE_URL and BETTER_AUTH_SECRET
bun install
bun run db:push
bun run db:seed
bun run dev
```
API defaults to `
localhost`.
`db:seed` is part of setup, not an optional extra. It loads the delivery
checklist, and without it the checklist screen is empty, dashboard progress
reads 0 of 0, and the delivery reminder cannot tell a mother what she is
missing. It is safe to re-run: items are matched on name, so re-seeding updates
wording without duplicating rows or touching what a mother has already marked.
### 2. Client
```bash
cd client
cp .env.example .env
# VITE_API_URL=
localhost
bun install
bun run dev
```
App defaults to `
localhost`.
## Scripts
### Server
| Script | Description |
|--------|-------------|
| `bun run dev` | Start API with watch mode |
| `bun run start` | Start API |
| `bun run test` | Run unit and API tests |
| `bun run db:push` | Push Drizzle schema to the database |
| `bun run db:seed` | Load the delivery checklist (safe to re-run) |
| `bun run db:generate` | Generate migrations |
| `bun run db:migrate` | Run migrations |
| `bun run db:studio` | Open Drizzle Studio |
### Client
| Script | Description |
|--------|-------------|
| `bun run dev` | Start Vite dev server |
| `bun run build` | Production build |
| `bun run lint` | Run Oxlint |
| `bun run test` | Run validation tests |
| `bun run preview` | Preview production build |
## Auth and roles
- Email/password auth via Better Auth
- Roles: `mother` (de …