Skip to content

Repository files navigation

RiskWise

Maritime supply chain intelligence platform. Evaluate shipping routes for geopolitical, weather, labor, and congestion risk using a multi-agent AI pipeline. Get risk scores, narratives, alternative routes, and a live disruption feed.


Stack

Layer Tech
Frontend React 19, Tailwind CSS 4, Wouter, shadcn/ui
Backend Node.js, Express 4, tRPC 11, Drizzle ORM
Database PostgreSQL
AI OpenAI-compatible API (Ollama locally, OpenAI/Anthropic in prod)
Auth JWT via jose, cookie-based sessions
Logging Pino (structured JSON)
Scheduling node-cron (hourly Athena background scan)

Architecture

Three agents collaborate on every route evaluation:

  • Athena - researcher. Fetches live intelligence from GDELT RSS, NASA EONET, USGS. Runs hourly background scan to populate the disruption feed.
  • Hermes - risk modeler. Scores weather, geopolitical, labor, and congestion risk on a 0-100 scale, with per-factor breakdown.
  • Apollo - route optimizer. Suggests alternative routes when overall risk is high.

Risk thresholds: Green (0-30), Amber (31-60), Red (61-100). Critical alerts (score > 75) fire a console log and optional webhook.


Running Locally

Prerequisites

  • Node.js 20+
  • pnpm
  • PostgreSQL
  • Ollama for local LLM, or an OpenAI/Anthropic API key

Install

pnpm install

Environment

Create .env at the project root:

DATABASE_URL=postgresql://user:password@localhost:5432/riskwise
JWT_SECRET=your-secret-minimum-32-characters-long

# LLM config (defaults to Ollama + Mistral)
RISKWISE_LLM_BASE_URL=http://localhost:11434/v1
RISKWISE_LLM_API_KEY=ollama
RISKWISE_LLM_MODEL=mistral

# Optional
GOOGLE_MAPS_API_KEY=
RISKWISE_ALERT_WEBHOOK_URL=

Database

pnpm db:push

Dev server

pnpm dev
# http://localhost:5000

LLM options

Ollama (local, no API key):

ollama pull mistral && ollama serve

OpenAI:

RISKWISE_LLM_BASE_URL=https://api.openai.com/v1
RISKWISE_LLM_API_KEY=sk-...
RISKWISE_LLM_MODEL=gpt-4o

Anthropic (via OpenAI-compatible proxy or gateway):

RISKWISE_LLM_MODEL=claude-sonnet-4-5

Commands

pnpm dev        # start dev server
pnpm build      # production build
pnpm start      # run production build
pnpm test       # vitest (17 tests)
pnpm check      # TypeScript type check
pnpm format     # Prettier
pnpm db:push    # generate + apply DB migrations

Project Structure

client/src/
  pages/          RouteAnalyzer, ActiveDisruptions, RouteHistory, MapView
  components/     reusable UI + shadcn/ui primitives
  contexts/       ThemeContext, RouteMapContext
  hooks/          custom hooks
  lib/trpc.ts     tRPC client binding
  App.tsx         routing
  index.css       global styles, Tailwind config, cyberpunk tokens

server/
  agents.ts             Athena / Hermes / Apollo orchestration
  db.ts                 Drizzle query helpers
  realtime.ts           live data fetchers (GDELT, NASA EONET, USGS)
  scheduledHandlers.ts  hourly Athena scan via node-cron
  routers.ts            tRPC router assembly
  routers/riskwise.ts   route eval, history, disruptions, auth procedures
  _core/
    index.ts        Express app, middleware, request ID, Maps proxy
    context.ts      tRPC context + JWT resolution
    env.ts          Zod-validated env config (fails fast on missing vars)
    llm.ts          OpenAI-compatible LLM client
    logger.ts       Pino instance
    notification.ts console + optional webhook alerts
    errors.ts       typed HTTP error classes

shared/
  const.ts          cookie name, shared constants
  types.ts          re-exports DB types + error classes
  _core/errors.ts   HttpError base class

drizzle/
  schema.ts         PostgreSQL schema (users, risk_events, shipping_routes, route_evaluations)
  0000_init.sql     initial migration

Tests

17 tests in server/riskwise.test.ts covering:

  • Risk score color thresholds (Green/Amber/Red boundaries)
  • tRPC router procedures: events, routes, auth
  • Athena scan result validation (category/severity enums)
  • Critical notification threshold (score > 75)

RiskWise was initially ideated and bootstrapped using Manus AI for the Manus AI Hackathon at Boston Tech Week 2026.

About

A multi-agent system that predicts and mitigates global supply chain disruptions. Features AI agents (Athena, Hermes, Apollo) for research, risk modeling, and route optimization, with an interactive marine map, natural language query terminal, and real-time risk metrics dashboard. · Built with Manus

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages