{"id":50516294,"url":"https://github.com/opencpo/opencpo-admin","last_synced_at":"2026-06-03T00:04:28.029Z","repository":{"id":362131938,"uuid":"1195555589","full_name":"opencpo/opencpo-admin","owner":"opencpo","description":"🖥️ CPO admin dashboard — chargers, sessions, tariffs, PKI, skin gallery, OCPP message viewer","archived":false,"fork":false,"pushed_at":"2026-06-02T21:15:47.000Z","size":560,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T21:23:14.017Z","etag":null,"topics":["admin","cpo","dashboard","ev-charging","fastapi","htmx","jinja2","ocpp"],"latest_commit_sha":null,"homepage":"https://opencpo.io","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opencpo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-29T19:55:41.000Z","updated_at":"2026-06-02T21:15:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/opencpo/opencpo-admin","commit_stats":null,"previous_names":["opencpo/opencpo-admin"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/opencpo/opencpo-admin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencpo%2Fopencpo-admin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencpo%2Fopencpo-admin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencpo%2Fopencpo-admin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencpo%2Fopencpo-admin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opencpo","download_url":"https://codeload.github.com/opencpo/opencpo-admin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencpo%2Fopencpo-admin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33842020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admin","cpo","dashboard","ev-charging","fastapi","htmx","jinja2","ocpp"],"created_at":"2026-06-03T00:04:26.751Z","updated_at":"2026-06-03T00:04:28.017Z","avatar_url":"https://github.com/opencpo.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OCPP Admin\n\n**Network management dashboard for OCPP Core.**\n\nFastAPI + Jinja2 + HTMX. No React, no npm, no build step.\n\n\u003e ✅ **Built-in authentication.** JWT-based login with bcrypt password hashing. First-time setup wizard on first visit. No hardcoded credentials.\n\n---\n\n## Features\n\n| Feature | Description |\n|---------|-------------|\n| 📊 **Dashboard** | Network overview — charger status, session counts, PKI health |\n| 🔌 **Chargers** | List, filter, manage chargers; remote control (start/stop/reset/unlock) |\n| ⚡ **Sessions** | Live session monitoring with enriched data (RFID, energy, duration) |\n| 💰 **Tariffs** | Create and manage pricing configurations |\n| 🏷️ **RFID / Tokens** | Token management, whitelist/blacklist, group assignment |\n| 👥 **Groups** | Charger groups and load-balancing configuration |\n| 🧾 **Invoices** | Session-based invoicing and export |\n| 🔐 **PKI** | Certificate lifecycle dashboard — issue, revoke, inspect |\n| 📡 **OCPP Messages** | Real-time OCPP event stream viewer |\n| 🛡️ **Security** | Security events, alert history, PKI health |\n| 🎛️ **Features** | Feature flags and runtime configuration |\n| 🚀 **Onboarding** | Self-service PKI onboarding for operators (Root CA + personal cert) |\n\n---\n\n## Authentication\n\nThe admin panel uses JWT-based authentication against the OCPP Core API. On first access, you'll be redirected to `/setup` — a 6-step wizard where you create your admin account, configure the organization name, and set up SMTP. After setup, login uses email + password with bcrypt-hashed credentials stored in the `ocpp.users` table. Session tokens are stored as HTTP-only cookies (`opencpo_session`).\n\n### First-time Setup Flow\n\n1. Visit `http://localhost:8080` → redirected to `/setup`\n2. Step 1: Create admin account (email + password)\n3. Step 2: Configure organization name and public URL\n4. Step 3: SMTP settings (can be skipped)\n5. Step 4: PKI configuration (can be skipped)\n6. Step 5: Default pricing (can be skipped)\n7. Step 6: Feature flags (can be skipped)\n8. Redirected to `/login` — sign in with your new credentials\n\nAll steps are skippable. You can return to `/setup` anytime to fill in missing configuration.\n\n## Quick Start\n\n### 1. Install dependencies\n\n```bash\npython -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n```\n\n### 2. Configure\n\nCopy the example env file and fill in your values:\n\n```bash\ncp .env.example .env\n```\n\nAt minimum you need:\n\n```bash\nOCPP_CORE_API=http://localhost:8000\n```\n\n### 3. Run\n\n```bash\n# With .env file\npython-dotenv run -- python main.py\n\n# Or export vars manually\nexport OCPP_CORE_API=http://localhost:8000\npython main.py\n```\n\nOpen http://localhost:8080 — you'll be redirected to the setup wizard on first visit.\n\n---\n\n## Configuration Reference\n\nAll configuration is via environment variables (`.env` file supported via `python-dotenv`).\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `APP_TITLE` | `OCPP Admin` | Application name shown in UI |\n| `HOST` | `127.0.0.1` | Bind address for uvicorn |\n| `PORT` | `8080` | Bind port |\n| `DB_HOST` | `127.0.0.1` | PostgreSQL host |\n| `DB_PORT` | `5432` | PostgreSQL port |\n| `DB_NAME` | `ocppcore` | PostgreSQL database name |\n| `DB_USER` | `ocpp` | PostgreSQL user |\n| `DB_PASS` | *(required)* | PostgreSQL password |\n| `OCPP_CORE_API` | `http://localhost:8000` | OCPP Core REST API base URL |\n| `PKI_DATA_DIR` | `../ocpp-core/data/pki` | Path to PKI data dir (contains `root-ca.crt` and `users/`) |\n\n---\n\n## Architecture\n\n```\nBrowser ←─HTMX─→ CPO Admin (FastAPI)\n                        │\n                        ├─ PostgreSQL (sessions, tokens, tariffs, groups)\n                        │\n                        └─ OCPP Core API (chargers, PKI, OCPP commands)\n```\n\n- **OCPP Core** handles the WebSocket charger connections and exposes a REST API\n- **CPO Admin** is a pure UI layer — it reads from Postgres and calls OCPP Core\n- **HTMX** powers live updates via SSE and partial HTML swaps (no WebSocket from browser)\n- **Tailwind CSS** (CDN) — no build step required\n- `python main.py` and it runs\n\n---\n\n## Skin Customization\n\nThe UI supports swappable skins via the `skins/` directory.\n\n```\nskins/\n  base/          ← generic default skin\n```\n\nThe `logo.svg` in `static/` is the primary branding asset (generic OpenCPO lightning bolt). Replace `static/logo.png` with your own PNG logo; it is not generated automatically.\n\nSet `SKIN=base` (default) to use the generic skin. To use a custom skin:\n\n1. Copy `skins/base/` to `skins/my-brand/`\n2. Edit colors, logo, and CSS in your skin directory\n3. Set `SKIN=my-brand` in your `.env`\n\nCopy `skins/base/` as a starting point for your own branded skin.\n\n---\n\n## PKI / Onboarding\n\nThe `/onboarding` page provides self-service certificate distribution:\n\n1. Operators visit `/onboarding`\n2. They download the Root CA certificate and install it in their OS trust store\n3. They enter their email to request a personal certificate (PKCS#12 or PEM)\n4. The admin authenticates via mutual TLS with their personal cert\n\nPKI operations are delegated to OCPP Core via `POST /api/v1/pki/issue/user`.\n\nThe PKI data directory (cert storage) is configured via `PKI_DATA_DIR`.\n\n---\n\n## Requirements\n\n- Python 3.11+\n- PostgreSQL 14+\n- OCPP Core service running (for charger control and PKI)\n- `openssl` CLI available (for DER conversion in onboarding)\n\n---\n\n## License\n\nApache 2.0 — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencpo%2Fopencpo-admin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopencpo%2Fopencpo-admin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencpo%2Fopencpo-admin/lists"}