Logo Lanfrica

bethechange-tech/naija-rides

Domaine:

mobility

Type de record:

software
Créateur:
bet
Hôte:
# NR-Lagos (NaijaRides) A carpooling platform for Lagos, Nigeria. Drivers post recurring rides; riders search, join, and manage bookings — all matched against Lagos-specific location aliases. ## Monorepo structure ``` apps/ api/ Express 5 REST API (OpenAPI-backed, TypeScript) web/ Next.js frontend worker/ Background job worker packages/ db/ Prisma schema + shared Prisma client (PostgreSQL) queue/ BullMQ queue definitions docker-dev/ Local Docker Compose services ``` ## Prerequisites - Node.js 20+ - pnpm 9+ - Docker (for local Postgres) **or** a Neon project ## Getting started ### 1. Install dependencies ```bash pnpm install ``` ### 2. Set up the database **Option A — Local Docker** ```bash cd packages/docker-dev docker compose up -d postgres ``` Then create `packages/db/.env` from the template: ```bash cp packages/db/.env.example packages/db/.env # Edit .env and set the Docker connection strings: # DATABASE_URL="postgresql://postgres:postgres@localhost:5432/NR_LAGOS_dev?schema=public" # DIRECT_URL="postgresql://postgres:postgres@localhost:5432/NR_LAGOS_dev?schema=public" ``` **Option B — Neon (cloud)** ```bash cp packages/db/.env.example packages/db/.env # Paste your Neon DATABASE_URL (pooled) and DIRECT_URL (direct) into .env ``` ### 3. Run migrations ```bash pnpm --filter @repo/db migrate dev ``` ### 4. Seed the database ```bash pnpm --filter @repo/db seed # or from the db package directly: cd packages/db && pnpm seed ``` ### 5. Start the API in development mode ```bash pnpm --filter @repo/api dev ``` The API starts at `localhost`. Interactive docs are served at `localhost`. ## Running tests ```bash pnpm --filter @repo/api test --run ``` Tests reset and re-seed the database automatically before each file. ## Environment variables See `packages/db/.env.example` for all required variables. **Never commit a real `.env` file** — it is git-ignored. ## CI — Neon preview branches The workflow …