For active development, it's often easier to run the frontend and backend servers directly on your local machine.
First, set up and run the FastAPI backend.
# Navigate to the backend directory cd backend # Create a virtual environment (recommended) python3 -m venv venv source venv/bin/activate # Install the required Python packages pip install -r requirements.txt # Run the FastAPI server # The --reload flag will automatically restart the server when you make code changes uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
The backend API will now be running at http://localhost:8000.
In a separate terminal, set up and run the React development server.
# Navigate to the frontend directory cd frontend # Install the required npm packages npm install # Start the React development server npm start
This will automatically open a new browser tab with the application running at http://localhost:3000. The React development server will proxy API requests to the backend (running on port 8000) to avoid CORS issues.
You can now edit the source code in the frontend/src or backend/app directories, and the servers will automatically reload to reflect your changes.