Skip to content

fix(dev): restore local backend and frontend startup - #274

Draft
pengpengyi92 wants to merge 1 commit into
HKUDS:mainfrom
pengpengyi92:agent/fix-local-dev-bootstrap
Draft

fix(dev): restore local backend and frontend startup#274
pengpengyi92 wants to merge 1 commit into
HKUDS:mainfrom
pengpengyi92:agent/fix-local-dev-bootstrap

Conversation

@pengpengyi92

Copy link
Copy Markdown

Summary

Fixes the two local-development blockers reported in #271:

  • installs email-validator, which is required by Pydantic EmailStr models;
  • proxies Vite development /api requests to the local FastAPI server on port 8000.

Root cause

The backend requirements installed base Pydantic without the optional email validation dependency, causing application startup to fail when EmailStr models were imported.

The frontend uses a relative /api base, but the Vite development server had no proxy configured, so local API calls were sent to port 3000 instead of the FastAPI backend on port 8000.

Impact

A clean local setup can now:

  • install backend requirements and start without the missing email-validator error;
  • use the Vite frontend on port 3000 while forwarding /api requests to the backend on port 8000.

Production behavior is unchanged because the proxy applies only to the Vite development server.

Validation

  • clean Python 3.11 virtual environment installation from service/requirements.txt;
  • Pydantic EmailStr model import and validation;
  • FastAPI app creation with 122 registered routes;
  • /docs and /openapi.json return 200 through TestClient;
  • backend tests: 123 passed, 1 deprecation warning;
  • frontend TypeScript compilation and Vite production build;
  • local /api/trending request forwarded by Vite from port 3000 to a verification server on port 8000 and returned 200.

Environment note

On Windows, npm run build completes tsc and vite build successfully and writes dist, then the repository's existing Unix-only postbuild command (chmod -R a+rX dist) returns an error because chmod is unavailable. This PR does not change that unrelated script.

Closes #271.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local dev setup fails out of the box: email-validator missing from requirements, and no Vite proxy for the frontend's relative /api calls

1 participant