This project is to serve the backend of the meet parasite, so that the clients can change data with each others.
- Using Python FastAPI.
- Connecting method:
- Server -> Clients: web socket
- Clients -> Server: http methods
Using http to send data to server because FastAPI has a convenient and perfect type checking, which helps avoid some basic problems.
- main.py: The backend server entry script. It should be start with uvicorn.
- page.tsx: The main page of the example.
-
(Optional) Create a Python virtual environment and use it.
python -m venv .venv source .venv/bin/activate
-
Install the dependencies.
pip install -r requirements.txt
-
Host the server with uvicorn.
uvicorn main:app
The default port is 8000. There is a auto-generated document at http://localhost:8000/redoc and http://localhost:8000/docs
The client website is just an example to show that how to connect with the server, which is developed with Next.js.
-
Navigate to
client_example
-
Install the dependencies.
yarn install
or using npm
npm install
-
Start the website
yarn run dev
or using npm
npm run dev
The default port is 3000. Browsing http://localhost:3000 and try it!