React + TypeScript frontend for the RegAlpha Legislative Risk Engine.
-
Install Node.js 20+ (using nvm):
nvm install 20 nvm use 20
-
Install dependencies:
npm install
-
Configure environment:
cp .env.example .env # Edit .env with your backend URL (default: http://localhost:8000) -
Run development server:
npm run dev
The app will be available at http://localhost:5173
- React 18 + TypeScript (strict mode)
- Vite (build tool)
- Tailwind CSS (styling)
- TanStack Query (data fetching & caching)
- React Flow (graph visualization)
- Dagre (graph layout algorithm)
- Lucide React (icons)
src/
├── api/ # API client and TypeScript types
├── hooks/ # TanStack Query custom hooks
├── components/ # React components
└── utils/ # Helper functions and formatters
- Company Risk Analysis: View aggregate risk scores from multiple legislative risks
- Knowledge Graph: Interactive visualization of company relationships using React Flow
- Legislative Risks: Display active legislation affecting selected companies
- Real-time Data: Integrated with Polymarket probabilities for risk assessment
- Build:
npm run build - Preview:
npm run preview - Lint:
npm run lint
VITE_API_BASE_URL: Backend API base URL (default:http://localhost:8000)