Logo Lanfrica

HackEAC/locations-API

Domaine:

geospatialdigital infrastructure

Type de record:

software
Créateur:
Hac
HĂ´te:
Live Tanzania 🇹🇿 locations API 🔥 # Location Data API Compatibility-first REST API for Tanzania location data backed by PostgreSQL and Prisma ORM 7. ## What Changed - Prisma ORM 7 with a generated client in `src/generated/prisma` - Dual API base paths: `/v1` is canonical and `/api` remains as a compatibility alias - Reproducible Prisma migration + seed flow for local development and CI - Request IDs, structured HTTP logs, cache headers, and safer full-text search - Dependabot and GitHub Actions for ongoing dependency updates and verification ## Requirements - Node.js `22.13.0+` - pnpm `10.7.0+` - PostgreSQL `16+` recommended ## Quick Start 1. Install dependencies. ```bash pnpm install ``` 2. Create your environment file. ```bash cp .env.example .env ``` 3. Start PostgreSQL and update your connection strings if needed. - Local and test environments use a direct PostgreSQL `DATABASE_URL`. - Production can use either a direct PostgreSQL `DATABASE_URL` or a Prisma Accelerate `DATABASE_URL`. - If `DATABASE_URL` points at Prisma Accelerate, also provide `DIRECT_DATABASE_URL` so migrations can talk to Postgres directly. - Legacy environments that already use `DIRECT_URL` are still accepted as a fallback for direct Postgres access. 4. Apply the checked-in schema and seed deterministic fixture data. ```bash pnpm db:migrate pnpm db:seed ``` > ⚠️ **WARNING**: `pnpm db:seed` is destructive — it truncates all tables before inserting fixture data. Do not run it against a database you need to preserve. 5. Start the development server. ```bash pnpm dev ``` ## Useful Scripts ```bash pnpm db:migrate pnpm db:seed pnpm lint pnpm typecheck pnpm build pnpm test pnpm test:ci pnpm openapi:json ``` ## Runtime Protection - API routes are protected by per-IP rate limits with both sustained and burst thresholds - `/search` has a stricter limit than the rest of the API because it is the easiest expensive endpoint to abuse - Request bodies are capped with `REQUEST_BODY_LIMIT`, even though the public API is m …

Licenses