This project implements a FuelEU Maritime Compliance Platform with a structured React + TypeScript + Node.js + PostgreSQL stack following Hexagonal (Ports & Adapters) architecture.
It demonstrates how to build an end-to-end compliance system handling:
- Route management
- Emissions comparison
- Compliance balance (CB) computation
- Banking and pooling features (Articles 20 & 21 of FuelEU regulation)
- Overview
- Architecture
- Features
- Tech Stack
- Setup β Backend
- Setup β Frontend
- Database & Prisma
- API Reference
- Testing
- Project Structure
- Future Improvements
- Author
FuelEU Maritime is designed to assess shipping routes' greenhouse gas (GHG) intensity and ensure compliance with FuelEU emission targets.
The platform includes:
- A REST API for route management, compliance calculations, and pooling logic.
- A React dashboard visualizing compliance data through tables and charts.
This project follows Hexagonal (Ports & Adapters) architecture for modularity and separation of concerns.
src/
core/ # Domain logic and entities
adapters/
inbound/http/ # Express controllers and routes
outbound/postgres/ # Prisma repositories (DB layer)
infrastructure/
db/ # Prisma client and schema
server/ # Express app setup
shared/ # Constants and types
src/
core/ # Domain models and hooks
adapters/
ui/ # React components and pages
infrastructure/ # Axios API client
shared/ # Common types
This architecture ensures:
- The core business logic is independent of frameworks.
- Adapters connect to infrastructure (HTTP, DB, UI).
- Code remains easy to test and extend.
- Fetch and display all shipping routes (
/routes) - Columns: vessel type, fuel type, year, GHG intensity, emissions
- βSet Baselineβ button to mark a baseline route
- Fetches
/routes/comparison - Shows baseline vs comparison GHG intensities
- Calculates % difference and compliance (
β / β) - Interactive bar chart using Recharts
Implements FuelEU Article 20 β Banking
- Fetch current Compliance Balance (CB)
- Bank surplus CB
- Apply stored CB to offset deficits
- Displays KPIs:
cb_before,applied,cb_after
Implements FuelEU Article 21 β Pooling
- Create a pool of ships sharing compliance surpluses
- Ensures:
- Ξ£ (Adjusted CB) β₯ 0
- Deficit ships canβt exit worse
- Surplus ships canβt exit negative
- Visual display of before/after CBs
- Green indicator for valid pool β
| Layer | Technology |
|---|---|
| Frontend | React, TypeScript, Vite, TailwindCSS, Recharts |
| Backend | Node.js, Express, TypeScript, Prisma ORM |
| Database | PostgreSQL |
| Styling | TailwindCSS |
| Architecture | Hexagonal (Ports & Adapters) |
| Tools | ESLint, Prettier, ts-node-dev, GitHub, AI Agents |
cd Backend
npm installDATABASE_URL="postgresql://postgres:<PASSWORD>@localhost:5432/fueleu?schema=public"npx prisma generate
npx prisma migrate dev --name initnpx ts-node prisma/seed.tsnpm run devBackend runs at π http://localhost:4000
cd Frontend
npm installnpm run devFrontend runs at π http://localhost:5173
Make sure your backend is running simultaneously.
Prisma Models
routesβ Route data (id, routeId, vesselType, fuelType, year, ghgIntensity, etc.)ship_complianceβ Ship-year CB recordsbank_entriesβ Banked surplus recordspoolsβ Pool registrypool_membersβ Pool participants with before/after CB
CB = (TargetIntensity - ActualIntensity) Γ (FuelConsumption Γ 41,000)
TargetIntensity(2025) = 89.3368 gCOβe/MJ
| Method | Endpoint | Description |
|---|---|---|
GET |
/routes |
Fetch all routes |
POST |
/routes/:id/baseline |
Set route as baseline |
GET |
/routes/comparison |
Baseline vs comparison data |
GET |
/compliance/cb?shipId&year |
Compute and return CB |
POST |
/compliance/banking/bank |
Bank surplus CB |
POST |
/compliance/banking/apply |
Apply banked surplus |
POST |
/pools |
Create compliance pool |
npm run test(Unit & integration tests recommended for core modules: CB calculation, Banking, Pooling)
Use Postman or browser to verify endpoints:
/routesβ list routes/routes/:id/baselineβ set baseline/routes/comparisonβ compare data/compliance/cb?shipId&yearβ check CB/poolsβ create pool
FuelEU-Maritime/
βββ Backend/
β βββ src/
β β βββ core/
β β βββ adapters/
β β βββ infrastructure/
β βββ prisma/
β βββ package.json
β βββ .env
βββ Frontend/
β βββ src/
β β βββ adapters/ui/
β β βββ adapters/infrastructure/
β β βββ core/
β βββ package.json
β βββ vite.config.ts
βββ README.md
βββ AGENT_WORKFLOW.md
βββ REFLECTION.md
- Add authentication (admin / ship operator roles)
- Add user-specific data filters and dashboards
- Deploy using Docker and CI/CD pipelines
- Add full Jest test coverage
- Add charts to Banking & Pooling tabs
Anuj Mundu
π MCA, Maulana Azad National Institute of Technology (MANIT), Bhopal
π GitHub
π§ Email: anujmark.edwin.ame@gmail.com