A high-performance Java core engine designed to interface with the UN Comtrade API, normalize global trade data, analyze commodity import/export flows, calculate market concentration risks, and render an executive terminal dashboard.
UNComtradeClient: Handles secure API communication and data retrieval from UN Comtrade endpoints.CometradeNormalizer: Parses and structures raw JSON trade data into strongly-typed domain models (TradeRecord,ComtradeAvailabilityRecord).TradeSignalAnalyzer: Extracts key market features, calculates trade balance (Imports vs. Exports), ranks trading partners by volume, and computes concentration shares (Top 1 & Top 3 supplier concentration).HistoricalDemandAnalyzer: Aggregates trade values across periods and calculates period-over-period demand growth/drop rates.PartnerJsonMapper/PartnerMetadataResolver: Comprehensive global metadata mapper resolving 200+ partner country codes and ISO regions dynamically.TradeSignalPrinter: Renders an executive ASCII/Unicode Global Supply Chain Intelligence Dashboard complete with risk alerts and visual capacity bars.
┌──────────────────────────────────────────────────────────────────────────┐
│ GLOBAL SUPPLY CHAIN INTELLIGENCE DASHBOARD │
└──────────────────────────────────────────────────────────────────────────┘
COMMODITY CODE : 620443
PERIOD / FLOW : 202606 / IMPORTS
TOTAL COMMODITY FLOW : $ 85,583,916.00
ACTIVE PARTNERS : 96
MARKET RISK PROFILE : [ Top 1 Share: 40.75% ] [ Top 3 Share: 65.76% ]
────────────────────────────────────────────────────────────────────────────
CRITICAL RISK ALERT: High single-source dependency detected.
Recommended Action: Divert incoming volume to alternative lane buffers.
────────────────────────────────────────────────────────────────────────────
RANK │ COUNTRY │ TRADE VOLUME (USD) │ MARKET SHARE & CAPACITY
──────┼───────────────┼──────────────────────┼────────────────────────────
#01 │ China │ $ 34,874,416.00 │ [■■■■■■■■■■░░░░░] 40.7%
#02 │ Vietnam │ $ 14,852,097.00 │ [■■■■░░░░░░░░░░░] 17.4%
#03 │ India │ $ 6,550,323.00 │ [■░░░░░░░░░░░░░░] 7.7%
#04 │ Indonesia │ $ 4,183,872.00 │ [■░░░░░░░░░░░░░░] 4.9%
#05 │ Italy │ $ 3,212,474.00 │ [░░░░░░░░░░░░░░░] 3.8%
────────────────────────────────────────────────────────────────────────────
- Clone the repository:
git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.git
- Build the project with Maven:
mvn clean compile
- Run the application:
mvn exec:java -Dexec.mainClass="com.saas.core.Main"