React 18 + Vite + TypeScript single-page application for exploring research trends through AI-powered analysis.
- React 18 with hooks and functional components.
- Vite for lightning-fast dev server and Rollup-based production builds.
- Tailwind CSS plus shadcn/ui (Radix primitives) for styling and accessible UI components.
- Type-safe API client (axios) auto-generated from the shared OpenAPI spec via bash script
- Built and linted with ESLint and shipped via Docker + Nginx.
src/
├── api/
│ └── client.ts # Pre-configured OpenAPI client instances
├── generated/
│ └── api/ # Auto-generated axios client (git-ignored)
├── components/
│ ├── ui/ # Base shadcn components
│ ├── Header.tsx
│ ├── QueryForm.tsx
│ ├── SettingsForm.tsx
│ ├── StartExploringForm.tsx
│ ├── AnalysisHistory.tsx
│ ├── AnalysisItem.tsx
│ └── TopicResult.tsx
├── hooks/
│ ├── useStartAnalysis.ts # Start analysis + polling logic
│ └── useAnalysisHistory.ts # Fetch & manage analysis list
├── lib/
│ └── utils.ts # Helper utilities (Tailwind class merge, etc.)
├── index.css # Tailwind entry
└── main.tsx # React root
- Query submission with optional advanced settings.
- Live status updates (“classifying”, “fetching articles”, …) with animated progress.
- Topic & article visualisation including relevance scores.
- Analysis history with removal and dark-mode support.
For detailed backend endpoints see the Swagger Docs.
The frontend uses the OpenAPI-generated axios client located in src/generated/api, wrapped by src/api/client.ts. Run the generator anytime after the spec changes:
npm run generate-client- QueryForm collects the search terms and hands control to
useStartAnalysis. - useStartAnalysis sends a
startAnalysisrequest via the generated OpenAPI client. - The Spring API Server kicks off an asynchronous pipeline (LLM classification → article fetcher → embedding & topic discovery).
- The hook polls
getAnalysisfor status updates. Progress messages drive the loading UI. - Once the server marks the job
COMPLETED, React state updates and visual components (AnalysisHistory,TopicResult) re-render with final data.
npm install # install deps
npm run dev # start Vite dev server on http://localhost:5173npm run build # builds to dist/The multi-stage Dockerfile builds the static assets and serves them via Nginx:
docker build -t niche-explorer-client ./web-clientThen run with:
docker run -p 80:80 niche-explorer-client