Frontend Type Generation & Sync
Keeping data types synced between the backend and frontend is a high priority. Follow this logic exactly:
- •Change Directory: Always start by moving into the
./frontend/directory. - •Connectivity Check: Check if the backend server is currently active by running:
pgrep -af uvicorn - •Execution Logic:
- •If Backend is Running: Execute
npm run generate:types. - •If Backend is NOT Running: Execute the fallback script:
../scripts/generate_fe_types.bash.
- •If Backend is Running: Execute
- •Verification: Confirm that the generated type files have been updated in ./frontend/src/types/types.generated.ts.
- •Application: Ensure that the new types are being used in the frontend codebase to maintain type safety and reduce bugs.