# AutoSoko Kenya
AutoSoko Kenya is a Next.js vehicle marketplace for buyers, individual sellers, dealers and administrators. Marketplace data is persisted through authenticated API routes, Prisma and PostgreSQL. Browser storage is used only for the non-sensitive vehicle comparison shortlist.
## Requirements
- Node.js 22.x
- npm 10.x
- PostgreSQL 16 or a compatible managed PostgreSQL service
- Cloudinary account for public listing images
- Safaricom Daraja credentials for M-Pesa payments
- Resend account and verified sender for transactional email
- Upstash Redis for distributed production rate limiting
The supported runtime versions are enforced by `package.json`.
## Local development
1. Copy the environment template and configure development values:
```bash
cp .env.example .env
```
2. Install the exact dependency tree:
```bash
npm ci
```
3. Generate the Prisma client and apply the committed migrations:
```bash
npm run db:generate
npm run db:migrate:deploy
npm run db:migrate:status
```
4. Start the development server:
```bash
npm run dev
```
The application is available at `
localhost` by default.
## Production build
```bash
npm run release:preflight
npm run env:validate
npm run db:generate
npm run db:validate
npm run db:migrate:deploy
npm run test
npm run lint
npm run audit:production
npm run build
npm start
```
For the complete automated release sequence, run:
```bash
RELEASE_EVIDENCE_DIR="$PWD/artifacts/release" npm run release:execute
```
Set `RUN_EXTERNAL_SMOKES=true` to include Daraja, Cloudinary, Resend, Upstash and protected-cron smoke tests.
## Test commands
```bash
npm run test:unit
npm run test:integration
npm run test:e2e
npm run qa:static
```
The integration and browser suites require a running application, a migrated test database and the environment variables documented in `.env.example` and `PRODUCTION_DEPLOYMENT_CHECKLIST.md`.
## Production services
- **Database:** PostgreSQL with TLS, backups and point-in-time rec …