A full-stack web application for monitoring and managing maritime greenhouse gas emissions compliance under the EU's FuelEU Maritime Regulation.
This platform helps maritime operators track, calculate, and manage their compliance with FuelEU Maritime regulations. It implements the complete regulation framework including:
- Compliance Balance (CB) Calculations - Automated GHG intensity monitoring
- Banking & Borrowing - Surplus credit management and deficit borrowing
- Pooling Mechanisms - Multi-ship compliance aggregation with greedy allocation
- Penalty Calculations - Automatic non-compliance penalty computation
Built with clean hexagonal architecture, the system separates business logic from infrastructure concerns, making it maintainable and testable.
- Routes Management: Track maritime routes with comprehensive filtering (vessel type, fuel type, year)
- Baseline Comparison: Visual comparisons against regulation targets with compliance indicators
- Real-time Calculations: Automatic GHG intensity and compliance balance computations
- Banking System: Store surplus credits for future use with validation
- Borrowing Mechanism: Borrow up to 2% of target with 10% aggravation (Article 20.3-20.5)
- Pooling with Greedy Allocation: Create multi-ship pools with automated surplus distribution (Article 21)
- Penalty Calculator: Automatic penalty computation for non-compliance
- β 100% FuelEU Maritime Compliant
- β Full GHG intensity formula (WtT + TtW with slip coefficients)
- β Dynamic targets (2025-2050) with annual reduction schedule
- β 5-decimal precision as per regulation (page 29)
- β Consecutive year borrowing prevention
- β Penalty formula with multipliers (Annex IV Part B)
- Runtime: Node.js 18+
- Language: TypeScript
- Framework: Express.js
- Database: PostgreSQL 14+
- ORM: Prisma
- Architecture: Hexagonal (Ports & Adapters)
- Testing: Jest, Supertest
- Framework: React 18
- Language: TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS
- Charts: Recharts
FuelEU-Maritime/
βββ backend/
β βββ prisma/
β β βββ schema.prisma # Database schema
β β βββ seed.ts # Seed data
β βββ src/
β β βββ core/
β β β βββ domain/ # Domain entities
β β β βββ application/ # Use cases & services
β β β βββ ports/ # Interface definitions
β β βββ adapters/
β β β βββ inbound/
β β β β βββ http/ # Controllers & routes
β β β βββ outbound/
β β β βββ postgres/ # Repository implementations
β β βββ infrastructure/
β β βββ server/ # Express app setup
β βββ package.json
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ api/ # API client
β β βββ App.tsx
β β βββ main.tsx
β βββ package.json
βββ README.md
βββ AGENT_WORKFLOW.md
βββ REFLECTION.md
- Node.js 18 or higher
- npm or yarn
- Either: PostgreSQL 14+ OR Supabase account (recommended)
-
Create a free account at supabase.com
-
Create a new project:
- Project name:
fueleu-maritime - Database password: Choose a strong password (save it!)
- Region: Choose closest to you
- Plan: Free tier is sufficient
- Project name:
-
Get your connection string:
- Go to Settings β Database
- Find Connection string β URI β Session mode
- Copy the connection string (it will look like):
postgresql://postgres.PROJECT_REF:[YOUR-PASSWORD]@aws-region.pooler.supabase.com:5432/postgres
-
Replace
[YOUR-PASSWORD]with your actual database password
- Download and install PostgreSQL 14+
- Create a database named
fueleu_maritime - Note your connection details (username, password, host, port)
-
Navigate to the backend directory:
cd backend -
Install dependencies:
npm install
-
Create a
.envfile:cp .env.example .env
-
Update the
.envfile with your database connection string:For Supabase:
DATABASE_URL="postgresql://postgres.PROJECT_REF:YOUR_PASSWORD@aws-region.pooler.supabase.com:5432/postgres" PORT=3001 NODE_ENV=development
For Local PostgreSQL:
DATABASE_URL="postgresql://user:password@localhost:5432/fueleu_maritime?schema=public" PORT=3001 NODE_ENV=development
-
Generate Prisma client:
npm run prisma:generate
-
Run database migrations:
For first-time setup (recommended):
npx prisma db push
OR for migration files (optional):
npm run prisma:migrate dev --name init
-
Seed the database:
npm run prisma:seed
-
Start the development server:
npm run dev
The backend API will be available at http://localhost:3001
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start the development server:
npm run dev
The frontend will be available at http://localhost:3000
GET /api/routes- List all routes with optional filtersGET /api/routes/:id- Get a specific routePOST /api/routes/:id/baseline- Set a route as baselineGET /api/routes/comparison- Compare routes against baselinePOST /api/routes- Create a new route
GET /api/compliance/cb?shipId=&year=- Calculate compliance balanceGET /api/compliance/adjusted-cb?shipId=&year=- Get adjusted CB after bankingGET /api/compliance/target?year=- Get target GHG intensity for year
GET /api/banking/records?shipId=&year=- Get bank recordsPOST /api/banking/bank- Bank surplus CBPOST /api/banking/apply- Apply banked surplus
POST /api/pools- Create a compliance poolPOST /api/pools/validate- Validate pool configuration
GET /api/borrowing/validate?shipId=xxx&year=2025- Check borrowing eligibilityPOST /api/borrowing/borrow- Borrow deficit (max 2%, 10% aggravation)GET /api/borrowing/history?shipId=xxx- Get borrowing history
Run All Tests:
cd backend
npm test -- --no-coverageRun Specific Tests:
# Calculation utilities (10 tests - all passing β)
npm test -- --no-coverage calculations
# Service tests
npm test -- --no-coverage ComplianceService
npm test -- --no-coverage PoolingService
# Integration tests (requires database)
npm test -- --no-coverage integrationRun with Coverage:
npm testWatch Mode:
npm run test:watchTest Status:
- β 10/10 Calculation utility tests (rounding, penalty, borrowing)
- β 3/3 Pooling service tests
- β 20+ Integration test scenarios (API endpoints)
- Compliance Balance Calculation (Annex IV Part A)
- GHG Intensity with WtT/TtW (Annex I)
- Banking & Surplus Management (Article 19)
- Pooling with Greedy Allocation (Article 21)
- Borrowing Mechanism (Article 20.3-20.5)
- Max 2% borrowing limit
- 10% aggravation on repayment
- Two-year consecutive rule
- Penalty Calculation (Annex IV Part B)
- Formula: |CB| / (GHGIEactual Γ 41,000) Γ 2,400 EUR
- Consecutive year multiplier
- 5-Decimal Precision (Regulation page 29)
CB [gCO2eq] = (GHGIEtarget - GHGIEactual) Γ Energy[MJ]
GHGIEactual = Ξ£(Mi Γ GHGi Γ LCVi) / Ξ£(Mi Γ LCVi Γ RWDi)
Where:
Mi: Mass of fuel i (tonnes)GHGi: GHG emission factor (WtT + TtW)LCVi: Lower calorific value (MJ/g)RWDi: Reward factor (2 for RFNBOs, else 1)
- 2025-2029: 89.3368 gCO2eq/MJ (2% reduction)
- 2030-2034: 85.6904 gCO2eq/MJ (6% reduction)
- 2035-2039: 79.2808 gCO2eq/MJ (13% reduction)
- 2040-2044: 68.3700 gCO2eq/MJ (26% reduction)
- 2045-2049: 57.4592 gCO2eq/MJ (37% reduction)
- 2050+: 18.2320 gCO2eq/MJ (80% reduction)
cd backend
npm run build
npm startcd frontend
npm run build
npm run previewThe database is seeded with 5 sample routes:
- R001: Container ship, HFO, 2024
- R002: Bulk Carrier, LNG, 2024
- R003: Tanker, MGO, 2024
- R004: RoRo, HFO, 2025
- R005: Container, LNG, 2025
And 3 sample ships with compliance data (SHIP001, SHIP002, SHIP003).
ISC
This is a demonstration project for FuelEU Maritime compliance calculations.