Logo Lanfrica

erickarugu/fuelkenya

Domaine:

digital infrastructure

Type de record:

software
Créateur:
eri
Hôte:
Kenya's only public API for live EPRA fuel prices across 224 towns # FuelKenya Live EPRA maximum pump fuel prices across all towns in Kenya — updated every pricing cycle. **fuelkenya.com** · **docs.fuelkenya.com** · **API** --- ## What this is FuelKenya is an open-source tracker for official fuel prices published by Kenya's Energy & Petroleum Regulatory Authority (EPRA). Prices are set monthly (cycles run from the 15th of each month to the 14th of the next) and cover Super Petrol, Diesel, and Kerosene across 224+ towns. The project has three parts: | Package | Description | Stack | |---|---|---| | `api/` | REST API — ingests EPRA CSVs, serves price data | FastAPI, PostgreSQL, Alembic | | `web/` | Public price tracker dashboard | Next.js 14, Tailwind CSS | | `docs/` | API documentation site | Nextra (MDX), static export | --- ## Prerequisites | Tool | Version | |---|---| | Node.js | 20+ | | pnpm | 11+ | | Python | 3.11+ | | PostgreSQL | 14+ | Install pnpm globally if you don't have it: ```bash npm install -g pnpm ``` --- ## Quick start ### 1. Clone ```bash git clone github.com cd fuelkenya ``` ### 2. API ```bash cd api # Create and activate virtual environment python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate # Install dependencies pip install -r requirements.txt # Copy and configure environment variables cp .env.example .env # Edit .env: set DATABASE_URL and INGEST_TOKEN # Run database migrations alembic upgrade head # Start the dev server uvicorn app.main:app --reload --host 0.0.0.0 --port 8000 ``` The API is now running at `localhost`. Interactive docs at `localhost`. ### 3. Web ```bash cd web pnpm install # Set the API base URL (defaults to localhost) echo 'NEXT_PUBLIC_FUELKENYA_API_URL=localhost' > .env.local pnpm dev ``` Dashboard at `localhost`. ### 4. Docs (optional) ```bash cd docs pnpm install pnpm dev ``` Docs at `localhost`. --- ## En …