Let's create a new app called
mkdir hello cd hello reflex init
This will create a directory structure like this:
hello ├── .web ├── assets ├── hello │ ├── __init__.py │ └── hello.py └── rxconfig.py
Let's go over each of these directories and files.
Each Reflex page will compile to a corresponding
.js file in the
assets directory is where you can store any static assets you want to be publicly available. This includes images, fonts, and other files.
For example, if you save an image to
assets/image.png you can display it from your app like this:
Initializing your project creates a directory with the same name as your app. This is where you will write your app's logic.
Reflex generates a default app within the
hello/hello.py file. You can modify this file to customize your app.
rxconfig.py file can be used to configure your app. By default it looks something like this:
import reflex as rx config = rx.Config( app_name="hello", )
We will discuss configuration in more detail in the next section.