A responsive, AI-powered dashboard for analyzing company layoff risks. Built with React, Vite, TypeScript, and Tailwind CSS.
- Risk Analysis: Visual gauge showing layoff risk score (0-100)
- Factor Analysis: SHAP-style visualization of contributing factors
- Trend Tracking: 30-day sparkline chart showing risk history
- Dark Mode: Toggle between light and dark themes
- Recent Lookups: Quick access to recently searched companies
- Responsive Design: Mobile-first approach with adaptive layouts
- Node.js (version 16 or higher)
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd layoff-radar- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env
# Edit .env with your API configuration- Start the development server:
npm run dev- Open your browser and visit
http://localhost:5173
The dashboard expects a REST API endpoint at /score/<company> that returns:
{
"company": "Tesla",
"risk": 82,
"top_factors": [
{"name": "Executive exits", "value": 0.34},
{"name": "Layoff-intent news", "value": 0.28},
{"name": "Funding cushion", "value": -0.05}
],
"history": [
{"date": "2025-06-11", "risk": 78}
],
"explanation": "High risk mainly because..."
}Set your API base URL in the .env file:
VITE_API_BASE_URL=https://your-api-domain.comnpm run buildThe built files will be in the dist directory.
- React - UI framework
- Vite - Build tool and dev server
- TypeScript - Type safety
- Tailwind CSS - Styling
- Recharts - Data visualization
- Radix UI - Accessible components
- Lucide React - Icons
MIT License