This project demostrates how to link a React frnotend with a FastAPI backend using Python. This application showcases basic communication between the frontened and backend for various HTTP methods.
- Node.js: Ensure that you have Node.js installed on your machine
- Python: Install Python on your machine, preferbally version 3.9 or later.
- Navigate to the
react-ui
directory:
cd react-ui
- Instll dependencies:
npm install
Start the development server:
npm start
Vist http://localhost:3000/ in your browser to view the React Application
- Navigate to the
api
direcotry:
cd api
- Create a virual enviorment (recomended):
pythom -m venv venv
- Activate the virual envioment
- On windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
Start the FastAPI server:
python running.py
Vist https://localhost:8000/ in your browser to check that is is running
The project includes examples for various HTTP methods (GET, POST, PUT, DELETE) between the React frontend and FastAPI backend. Explore the code in both frontend and backend directories to understand how the communication is established.
If you'd like to contribute, please fork the repository and create a pull request.
This project is licensed under the MIT License - see the LICENSE.md
file for details.