A FastAPI and React app that ties sustainable aviation fuel feedstock, production batches, GHG intensity, ASTM pathway checks, ReFuelEU blending shares and CORSIA credit entries together. This post runs its tests and API on the repository's own seeded mock data. Not legal advice; every regulatory figure shown comes from the repository's data files, not from me. The repository is archived (read-only).
Open-Source Tools · How-To · Energy & fuels models
How to use saf-monitoring-system: track SAF batches against blending and carbon-credit rules
Revised
· v1.0.0 · what changed
Code: github.com/herrrickshaw/saf-monitoring-system
Watch the walkthrough
Watch on YouTube: youtu.be/7bqmJY5fiH0
Why it is useful
- Who benefits: SAF plant analysts, airline sustainability teams and students who want a working example of how feedstock, batches, certificates, blending and credits link together.
- What it replaces: stitching spreadsheets across feedstock logs, batch records and credit ledgers. The data model and the calculations are already laid out and tested.
- Evidence from the run: 39 tests passed in 3.95 seconds, the seeded database produced a dashboard summary, and one of three airports was flagged as below its mandate share.
- It keeps the regulatory numbers in editable files, and says in the README to confirm them against the current rules before real use.
What it is for
The backend (FastAPI with SQLite) models feedstock deliveries, production batches, ASTM D7566 pathways, SAF certificates, airline offtakes and deliveries, a CORSIA-style credit ledger and ReFuelEU blending records. A React frontend shows dashboards for each. On first start it seeds about twelve months of mock data.
This is a monitoring and learning tool. Not legal advice. Regulatory values in it are editable defaults, and the README tells you to confirm them against the official texts. All figures in this post are what the repository itself outputs on its mock data. The repository is archived, so it will not be updated when rules change.
Who it is for
- Students and analysts learning how SAF compliance data fits together
- Teams prototyping an internal SAF tracking tool
- Non-programmers who want an AI assistant to explain each calculation
- Real compliance reporting. Not legal advice, and the regulatory defaults may be out of date because the repository is archived.
- Quoting its mandate, baseline or lifecycle values as current law. Check the official sources.
- Treating the seeded numbers as real plant output. They are mock data.
What you need
| Requirement | Why | How to get it |
|---|---|---|
| Python 3.10 or newer | the backend uses X | None type hints | python.org or your package manager |
| Python packages in backend/requirements.txt | FastAPI, SQLAlchemy, pydantic, reportlab, openpyxl, pytest, httpx | pip install -r backend/requirements.txt |
| Node 18 or newer (optional) | only for the React frontend | nodejs.org. I did not run the frontend |
| Nothing paid | no accounts, keys or live data feeds | the database is seeded locally |
Get the code and an AI assistant
You do not have to be a programmer. Get the repository, give it to an AI assistant, and ask in plain language. Any of these routes works:
| Tool | What you need | Best for |
|---|---|---|
| GitHub | Free account to fork or star; git to clone, or the green Code button, then Download ZIP, or open in Codespaces | Getting the code and keeping up with updates |
| Claude Code | Claude subscription or API key; run claude inside the cloned folder | Letting the AI read and run the whole repo |
| Gemini CLI | Google account; run gemini inside the cloned folder | The same hands-on workflow with Gemini |
| Claude.ai, Gemini or ChatGPT in the browser | A chat account; upload README.md and the files you care about (or paste the output of git ls-files) | Understanding the project and asking questions without installing anything |
| Other tools (Copilot Chat, Cursor, Codex CLI) | Open the cloned folder in the tool and point it at README.md first | Editing and extending the code |
git clone https://github.com/herrrickshaw/saf-monitoring-system.git
cd saf-monitoring-system
claude # or: gemini
Install
- Get the code (the repository is archived, so you can clone it but not push)
git clone https://github.com/herrrickshaw/saf-monitoring-system.git cd saf-monitoring-system/backend - Create an environment and install
python3 -m venv .venv && source .venv/bin/activate pip install -r requirements.txt
Quick start: commands and what you should see
Run the tests
pytest -q
39 passed.
Start the API (it seeds mock data on first run), then open the Swagger page
uvicorn app.main:app --port 8000
Interactive docs at http://localhost:8000/docs. The repo's run_app.sh also starts the React frontend on port 5173 (not run here).
Ask for the dashboard and the blending records
curl localhost:8000/api/dashboard/summary
curl localhost:8000/api/compliance/blending
JSON with totals and per-airport blending records.
Sample outputs
Real output from a run on the date shown in the sources line; trimmed to fit.
Worked CORSIA calculation (the repo's own function and default table)
corsia.default_core_lca_value, lcef, reduction_pct, tco2e_saved
core LCA (HEFA-SPK, used cooking oil) : 13.9 gCO2e/MJ
L_CEF = 13.9 + 0 - 0 : 13.9 gCO2e/MJ
reduction vs 89 gCO2e/MJ baseline : 84.38 % eligible (>= 10 %): True
1,000,000 L delivered : 2478.3 tCO2e saved
The value 13.9 is the repository's default for this feedstock and pathway. I did not check it against the ICAO document.
Dashboard summary from the seeded mock database
GET /api/dashboard/summary
{"total_saf_liters": 42442105.0,
"total_tco2e_credited": 63151.264,
"active_contracts": 3,
"current_year_blending_pct": 2.28,
"current_year_mandate_pct": 2.0}
Mock data generated by the seeder, not a real plant.
Blending compliance flags (mock data)
GET /api/compliance/blending
EDDF 2026 SAF 17,000,000 L of 500,000,000 L actual 3.4 % mandate 2.0 % compliant True
EGLL 2026 SAF 4,000,000 L of 420,000,000 L actual 0.952 % mandate 2.0 % compliant False
LFPG 2026 SAF 9,500,000 L of 380,000,000 L actual 2.5 % mandate 2.0 % compliant True
One airport is deliberately seeded below the mandate to demonstrate the flag, as the README says.
ASTM conformance rule and the repo's mandate schedule
astm_pathways.is_conformant, mandate_schedule
is_conformant(SIP max 10 %, blend 15 %, lab ref) -> False
is_conformant(HEFA max 50 %, blend 30 %, lab ref) -> True
mandate_pct_for_year in the repo: 2025: 2.0 2030: 6.0 2035: 20.0 2050: 70.0 (percent, repo defaults)
Conformance means the blend is within the pathway maximum and a lab reference is recorded; the lab test itself is outside the system.
Ways to use it
| Method | How it works |
|---|---|
| Command line and tests | Run pytest and call the calculation functions directly. |
| REST API | Run uvicorn and use the Swagger page or curl; reports can be generated for airlines and credit entries. |
| Web app | Run run_app.sh for the React dashboards on port 5173. |
| Ask an AI assistant | Have it explain the difference between the two baselines or add a new pathway entry. |
Sample prompts for your AI assistant
Copy, paste and edit the parts in [brackets].
- Claude: Read backend/app/calculations/corsia.py and ghg.py and explain in plain language why the credit ledger uses a different baseline from the blending mandate.
- Gemini: Run the tests and summarise which regulatory frameworks each test file covers.
- ChatGPT: I pasted /api/compliance/blending. Which airport is below its mandate and by how much?
- GitHub (Copilot Chat): Add a new feedstock to DEFAULT_CORE_LCA_VALUES with a clear source comment and a test.
- Claude: List every regulatory constant in this repository and tell me which official document I should check each one against.
Limits and honest caveats
- Not legal advice. The README itself says to confirm all regulatory values against the current official texts before real compliance reporting.
- Regulatory defaults (mandate shares, baselines, pathway limits, lifecycle values) are frozen at whatever the author entered, and the repository is archived, so they will not follow later changes. I did not verify any of them.
- Everything the app shows on first start is seeded mock data, not real plant, airline or credit data.
- SAF is not yet a notified sector under India's carbon market per the repository; its India module is a what-if tool, not an active scheme.
- I ran the backend tests and API only. The React frontend and the PDF and Excel report paths were not run.
- The tests print many datetime.utcnow deprecation warnings (73 warnings), which will become errors in future Python versions.
Sources: Cloned github.com/herrrickshaw/saf-monitoring-system (archived) into a clean folder, ran pytest, and called its calculation functions and API through the FastAPI test client against a temporary seeded database, in a throwaway virtualenv with Python 3.14 on 23 October 2026. All regulatory figures shown are the repository's own defaults, not checked against official sources. The repository was not modified.
- v1.0.0 — 23 October 2026 — first published.
About this article: Researched, written and edited by Umashankar Triplicane Dwarakanathan, with AI research assistance; every figure is meant to trace to the primary source cited. See the Editorial Policy for how sourcing, AI use and corrections work.