You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/CreateReactAdmin.md
+79-10Lines changed: 79 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,25 +5,38 @@ title: "The create-react-admin CLI"
5
5
6
6
# `create-react-admin`
7
7
8
-
`create-react-admin`is a package that generates a react-admin app scaffolding using [Vite](https://vitejs.dev/). It is designed to work on most setups and produces predictable and consistent results. It's the preferred way to create a new react-admin application.
8
+
Use `create-react-admin`to quickly bootstrap a react-admin project using [Vite](https://vitejs.dev/). It's the preferred way to create a new react-admin application.
- the package manager to use to install the dependencies
18
+
This will create an empty react-admin application in a directory called `your-admin-name`.
19
+
20
+
**Tip**: You can replace `npx` with `npm`, `yarn`, or `bun`
21
+
22
+
## Options
23
+
24
+
The command accepts the following options:
25
+
26
+
*`--interactive`: Enable the CLI interactive mode
27
+
*`--data-provider`: Set the data provider to use ("data-fakerest", "data-simple-rest", "data-json-server", "supabase" or "none")
28
+
*`--auth-provider`: Set the auth provider to use ("local-auth-provider" or "none")
29
+
*`--resource`: Add a resource that will be initialized with guessers (can be used multiple times). Set to "skip" to bypass the interactive resource step.
30
+
*`--install`: Set the package manager to use for installing dependencies ("yarn", "npm", "bun" or "skip" to bypass the interactive install step)
31
+
32
+
## `--interactive`
33
+
34
+
When using this option, the terminal will ask you to choose:
35
+
36
+
* a [data provider](#data-provider)
37
+
* an [auth provider](#auth-provider)
38
+
* the names of the [resources](#resources) to add
39
+
* the [package manager](#package-manager) to use to install the dependencies
@@ -39,4 +52,60 @@ Once the installation is complete, you can run the app with:
39
52
npm run dev
40
53
# or
41
54
yarn dev
55
+
# or
56
+
bun run dev
57
+
```
58
+
59
+
## `--data-provider`
60
+
61
+
`create-react-admin` currently supports five presets for the application's data provider:
62
+
63
+
*`fakerest`: A client-side data provider that use a JSON object for data, powered by [FakeRest](https://github.com/marmelab/FakeRest).
64
+
*`json-server`: A data provider based on the [JSON Server](https://github.com/typicode/json-server) API
65
+
*`simple-rest`: A data provider for [simple REST APIs](https://github.com/marmelab/react-admin/tree/master/packages/ra-data-simple-rest)
66
+
*`supabase`: A data provider for [Supabase](https://github.com/marmelab/ra-supabase/tree/main/packages/ra-supabase). The auth-provider and resources steps will be skipped.
67
+
*`none` (default): You'll configure the data provider myself.
68
+
69
+
You can set your data provider directly with the `--data-provider` option:
**Warning:** the `--resource` flag is incompatible with a `--data-provider supabase` due to a specific [`<AdminGuesser>` component](https://github.com/marmelab/ra-supabase/tree/main/packages/ra-supabase#usage) from `ra-supabase`.
97
+
98
+
## `--install`
99
+
100
+
`create-react-admin` can install dependencies using any of the following package managers:
101
+
102
+
*`npm` (default)
103
+
*`yarn`
104
+
*`bun`
105
+
*`none` (if you want to install dependencies yourself)
106
+
107
+
You choose an alternative package manager with the `--install` option:
108
+
109
+
```sh
110
+
npx create-react-admin@latest your-admin-name --install bun
0 commit comments