TypeScript and React

Budget: 2-3 weeks.

Why this matters

The frontend is the weakest layer in the current codebase. It is plain JSX with no types. You have already said design quality matters. Adding types catches most of the bugs you will hit as you add features, and it gives future hires a codebase they can navigate without reading every function.

What to learn

TopicTime
Modern JavaScript: arrow functions, destructuring, spread, async/await, modules, array methods1-2 days
TypeScript handbook (first half): interfaces, types, generics, unions, narrowing2-3 days
React mental model: UI as a function of state, pure components, effects as sync boundaries2 days
Hooks you will actually use: useState, useEffect, useMemo, useCallback, useRef2 days
One throwaway React app (todo list or weather fetcher) to get reps1 day
openapi-typescript setup against the FastAPI /openapi.json0.5 day
Port leaf components in frontend/src/components/ from .jsx to .tsx3-4 days
Port App.jsx to App.tsx once the types are in place2 days

Resources

Exercise

Port frontend/src/App.jsx and the components in frontend/src/components/ to TypeScript. Start with leaf components (MapSettingsPanel, RouteDetail, KpiPanel) and work up to App.tsx. Run openapi-typescript against the FastAPI server's /openapi.json and import the generated types into useChat.ts so the SSE payloads are typed. When you are done, remove allowJs from tsconfig.json and make sure the build is clean.