Start a New React Project
Overview¶
If you want to build a new app or a new website fully with ReactPy, we recommend picking one of the ReactPy-compatible backends popular in the community. These backend frameworks provide features that most apps and sites eventually need, including routing, data fetching, and session management.
Built-in Backends¶
Note
Some of our backend frameworks are considered built-in, meaning that compatibility for these backends are contained within reactpy.backend.*
.
In order to use ReactPy with built-in backend, you will need to run reactpy.backend.*.configure(...)
on your ASGI application. This command will configure the necessary settings and routes for ReactPy to work properly.
For example, this is how you would configure ReactPy for FastAPI:
from fastapi import FastAPI
from reactpy.backend.fastapi import configure
asgi_app = FastAPI()
configure(asgi_app)
FastAPI¶
FastAPI is a high-performance web framework that is designed for speed and efficiency. It is built on top of the asyncio library and uses a number of optimizations to achieve its performance. FastAPI is a good choice for web applications that need to be fast and scalable.
Terminal
pip install reactpy[fastapi]
If you're new to FastAPI, check out the FastAPI tutorial.
You will need to configure FastAPI in order to use it with ReactPy.
Flask¶
Flask is a microframework that is lightweight and easy to use. It is a good choice for small and simple web applications. Flask does not include many features out of the box, but it is highly customizable and can be extended with a variety of third-party libraries.
Terminal
pip install reactpy[flask]
If you're new to Flask, check out the Flask tutorial.
You will need to configure Flask in order to use it with ReactPy.
Sanic¶
Sanic is a microframework that is designed for speed and performance. It is built on top of the asyncio library and uses a number of optimizations to achieve its performance. Sanic is a good choice for web applications that need to be fast and scalable.
Terminal
pip install reactpy[sanic]
If you're new to Sanic, check out the Sanic tutorial.
You will need to configure Sanic in order to use it with ReactPy.
Starlette¶
Starlette is a lightweight framework that is designed for simplicity and flexibility. It is built on top of the ASGI standard and is very easy to extend. Starlette is a good choice for web applications that need to be simple and flexible.
Terminal
pip install reactpy[starlette]
If you're new to Starlette, check out the Starlette tutorial.
You will need to configure Starlette in order to use it with ReactPy.
Tornado¶
Tornado is a scalable web framework that is designed for high-traffic applications. It is built on top of the asyncio library and uses a number of optimizations to achieve its scalability. Tornado is a good choice for web applications that need to handle a lot of traffic.
Terminal
pip install reactpy[tornado]
If you're new to Tornado, check out the Tornado tutorial.
You will need to configure Tornado in order to use it with ReactPy.
External Backends¶
Pitfall
External backends have ReactPy support, but have significantly different installation and configuration instructions than built-in backends.
Make sure to follow the configuration guide for your chosen external backend.
Django¶
Django is a full-featured web framework that provides a batteries-included approach to web development. It includes features such as ORM, templating, authentication, and authorization. Django is a good choice for large and complex web applications.
Terminal
pip install reactpy-django
If you're new to Django, check out the Django tutorial.
ReactPy has unique configuration instructions to use Django.
Jupyter¶
Jupyter is an interactive computing environment that is used for data science and machine learning. It allows users to run code, visualize data, and collaborate with others in a live environment. Jupyter is a powerful tool for data scientists and machine learning engineers.
Terminal
pip install reactpy-jupyter
If you're new to Jupyter, check out the Jupyter tutorial.
ReactPy has unique configuration instructions to use Jupyter.
Plotly Dash¶
Plotly Dash is a web application framework that is used to create interactive dashboards. It allows users to create dashboards that can be used to visualize data and interact with it in real time. Plotly Dash is a good choice for creating dashboards that need to be interactive and informative.
Terminal
pip install reactpy-dash
If you're new to Plotly Dash, check out the Plotly Dash tutorial.
ReactPy has unique configuration instructions to use Plotly Dash.
Deep Dive
Can I use ReactPy without a backend framework?
You can not ReactPy without a backendβthis project was designed to be built on-top of existing web frameworks.
Here's why.
You can think of ReactPy as ReactJS server side rendering, but with a Python server. We rely on Python web frameworks and webservers in order to process ReactPy traffic. This means that you can use any Python web framework as a ReactPy backend, as long as it supports the ASGI standard. As your project grows with every new feature, you may want to switch backends in the future. As a result, we recommend keeping all backend-related logic within hook functions in order to make the "points of integration" between ReactPy and your backend as small as possible.
If you're building a new app or a site fully with ReactPy, we recommend using your favorite backend combined with reactpy-router
to create a Single Page Application (SPA).