How ummahrican/palestine-api works
Project type and purpose
• This is a standalone, stateless backend API service (“palestine-api”) built with FastAPI (Python 3.12) whose sole purpose is to wrap and expose the latest data from the external “palestine-datasets” repository as a JSON HTTP API. It has no frontend, no internal database, and is packaged in a Docker container.
File structure
• Top-level files:
– main.py: your FastAPI application entrypoint (defines routes/endpoints, implements HTTP handlers).
– __init__.py: makes the directory a Python package.
– pyproject.toml + uv.lock: dependency definitions (uv package manager, FastAPI, etc.).
– Dockerfile: container build configuration.
– test_main.py: pytest tests for your HTTP endpoints.
• No separate “frontend” or “backend” folders—this is purely a backend microservice.
• The Dockerfile plus uv.lock show containerization and reproducible environment.
• README emphasizes FastAPI, uv for dependency management, pytest, and Docker.
README for additional insights
• The service retrieves data at runtime from “palestine-datasets” (GitHub or their data API).
• Development commands use “uv run fastapi dev” (i.e. Uvicorn under the hood).
• There’s no in-house database; the external data repo is the “database.”
• Production deployment is pending, but Docker is the primary packaging mechanism.
Detail without over-fragmenting
• Lockfile under “Dependency Management” but don’t turn it into its own service.
• Dockerfile build context as part of the Deployment pipeline.