/starlette-react

An example React app using a Starlette backend

Primary LanguageJavaScriptMIT LicenseMIT

starlette-react

A basic example of using a React application with Starlette.

Setup

Backend

Requirements: Python 3.6+

  • Install starlette and uvicorn from the requirements file in the backend directory:

    pip install -r requirements.txt --upgrade

  • Run the application using uvicorn:

    python app.py

Uvicorn is the ASGI server used to run the application in this example, however other ASGI servers, such as Hypercorn and Daphne could be used as well.

Frontend

The React app was initially created using the create-react-app command.

  • Install the dependencies:

    yarn install

  • Run the server:

    yarn start