Skip to content

Commit 6f3f824

Browse files
committed
flatten file structure
1 parent ef50c26 commit 6f3f824

File tree

189 files changed

+670
-594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+670
-594
lines changed

docs_headless/astro.config.mjs

Lines changed: 118 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -31,87 +31,163 @@ export default defineConfig({
3131
},
3232
{
3333
label: 'Guides & Concepts',
34-
autogenerate: {
35-
directory: 'guides',
36-
},
34+
items: [
35+
'architecture',
36+
'datafetchingguide',
37+
'crud',
38+
'forms',
39+
'securityguide',
40+
'routing',
41+
'translation',
42+
'store',
43+
'features',
44+
],
3745
},
3846
{
3947
label: 'App Configuration',
40-
autogenerate: {
41-
directory: 'app-configuration',
42-
},
48+
items: ['coreadmin', 'resource', 'customroutes'],
4349
},
4450
{
4551
label: 'Data Fetching',
46-
autogenerate: {
47-
directory: 'data-fetching',
48-
},
52+
items: [
53+
'dataproviders',
54+
'actions',
55+
'dataproviderlist',
56+
'dataproviderwriting',
57+
'fetchjson',
58+
'usecreate',
59+
'usedataprovider',
60+
'usedelete',
61+
'usedeletemany',
62+
'usegetlist',
63+
'usegetmany',
64+
'usegetmanyreference',
65+
'usegetone',
66+
'useinfinitegetlist',
67+
'useupdate',
68+
'useupdatemany',
69+
'withlifecyclecallbacks',
70+
],
4971
},
5072
{
5173
label: 'Security',
52-
autogenerate: {
53-
directory: 'security',
54-
},
74+
items: [
75+
'authentication',
76+
'authproviderlist',
77+
'authproviderwriting',
78+
'permissions',
79+
'authenticated',
80+
'canaccess',
81+
'useauthenticated',
82+
'useauthprovider',
83+
'useauthstate',
84+
'usecanaccess',
85+
'usegetidentity',
86+
'uselogin',
87+
'uselogout',
88+
'usepermissions',
89+
'addrefreshauthtoauthprovider',
90+
'addrefreshauthtodataprovider',
91+
],
5592
},
5693
{
5794
label: 'List Page',
58-
autogenerate: {
59-
directory: 'list',
60-
},
95+
items: [
96+
'listtutorial',
97+
'filteringtutorial',
98+
'listbase',
99+
'infinitelistbase',
100+
'listiterator',
101+
'filterliveform',
102+
'withlistcontext',
103+
'uselist',
104+
'uselistcontext',
105+
'uselistcontroller',
106+
'useunselect',
107+
'useunselectall',
108+
],
61109
},
62110
{
63111
label: 'Creation & Edition Pages',
64-
autogenerate: {
65-
directory: 'create-edit',
66-
},
112+
items: [
113+
'edittutorial',
114+
'validation',
115+
'createbase',
116+
'editbase',
117+
'form',
118+
'usecreatecontext',
119+
'usecreatecontroller',
120+
'useeditcontext',
121+
'useeditcontroller',
122+
'userecordfromlocation',
123+
'useregistermutationmiddleware',
124+
'usesavecontext',
125+
'useunique',
126+
],
67127
},
68128
{
69129
label: 'Show Page',
70-
autogenerate: {
71-
directory: 'show',
72-
},
130+
items: ['showbase', 'useshowcontext', 'useshowcontroller'],
73131
},
74132
{
75133
label: 'Common',
76-
autogenerate: {
77-
directory: 'common',
78-
},
134+
items: [
135+
'withrecord',
136+
'usegetrecordid',
137+
'usenotify',
138+
'userecordcontext',
139+
'useredirect',
140+
'userefresh',
141+
],
79142
},
80143
{
81144
label: 'Fields',
82-
autogenerate: {
83-
directory: 'fields',
84-
},
145+
items: [
146+
'fields',
147+
'fieldsforrelationships',
148+
'referencearrayfieldbase',
149+
'referencefieldbase',
150+
'referencemanycountbase',
151+
'referencemanyfieldbase',
152+
'referenceonefieldbase',
153+
'usefieldvalue',
154+
],
85155
},
86156
{
87157
label: 'Inputs',
88-
autogenerate: {
89-
directory: 'inputs',
90-
},
158+
items: ['inputs', 'useinput'],
91159
},
92160
{
93161
label: 'Preferences',
94-
autogenerate: {
95-
directory: 'preferences',
96-
},
162+
items: [
163+
'usestore',
164+
'useremovefromstore',
165+
'useresetstore',
166+
'usestorecontext',
167+
],
97168
},
98169
{
99170
label: 'I18N Provider & Translations',
100-
autogenerate: {
101-
directory: 'i18n',
102-
},
171+
items: [
172+
'translationsetup',
173+
'translationlocales',
174+
'translationtranslating',
175+
'translationwriting',
176+
'translate',
177+
'uselocalestate',
178+
'usetranslate',
179+
],
103180
},
104181
{
105182
label: 'Other Components & Hooks',
106-
autogenerate: {
107-
directory: 'other',
108-
},
183+
items: [
184+
'recordrepresentation',
185+
'usegetrecordrepresentation',
186+
],
109187
},
110188
{
111189
label: 'Recipes',
112-
autogenerate: {
113-
directory: 'recipes',
114-
},
190+
items: ['caching', 'unittesting'],
115191
},
116192
],
117193
components: {

docs_headless/src/content/docs/data-fetching/Actions.md renamed to docs_headless/src/content/docs/Actions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ To execute some logic after a query or a mutation is complete, use the `onSucces
310310

311311
**Tip**: React-admin provides the various hooks to handle the most common side effects:
312312

313-
- [`useNotify`](../common/useNotify.md): Return a function to display a notification.
314-
- [`useRedirect`](../common/useRedirect.md): Return a function to redirect the user to another page.
315-
- [`useRefresh`](../common/useRefresh.md): Return a function to force a rerender of the current view (equivalent to pressing the Refresh button).
313+
- [`useNotify`](./useNotify.md): Return a function to display a notification.
314+
- [`useRedirect`](./useRedirect.md): Return a function to redirect the user to another page.
315+
- [`useRefresh`](./useRefresh.md): Return a function to force a rerender of the current view (equivalent to pressing the Refresh button).
316316

317317
### `onSuccess`
318318

docs_headless/src/content/docs/guides/Architecture.md renamed to docs_headless/src/content/docs/Architecture.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ React-admin relies on a several design decisions that structure its codebase.
1010

1111
React-admin is specifically designed to build [Single-Page Applications (SPA)](https://en.wikipedia.org/wiki/Single-page_application). In a react-admin app, the browser fetches the required HTML, CSS, and JavaScript to render the application only once. Subsequently, data is fetched from APIs through AJAX calls. This is in contrast to traditional web applications, where the browser fetches a new HTML page for each screen.
1212

13-
<img class="no-shadow" src="../../img/SPA-lifecycle.png" alt="SPA lifecycle" />
13+
<img class="no-shadow" src="../img/SPA-lifecycle.png" alt="SPA lifecycle" />
1414

1515
The SPA architecture ensures that react-admin apps are [exceptionally fast](./Features.md#fast), easy to host, and compatible with existing APIs without requiring a dedicated backend.
1616

17-
To achieve this, react-admin utilizes an internal router, powered by `react-router`, to display the appropriate screen when the user clicks on a link. Developers can define routes using the [`<Resource>`](../app-configuration/Resource.md) component for CRUD routes and the [`<CustomRoutes>`](../app-configuration/CustomRoutes.md) component for other routes.
17+
To achieve this, react-admin utilizes an internal router, powered by `react-router`, to display the appropriate screen when the user clicks on a link. Developers can define routes using the [`<Resource>`](./Resource.md) component for CRUD routes and the [`<CustomRoutes>`](./CustomRoutes.md) component for other routes.
1818

1919
For example, the following react-admin application:
2020

@@ -58,7 +58,7 @@ The `<Resource>` component allows react-admin to automatically link CRUD pages b
5858

5959
React-admin does not make any assumptions about the specific structure of your API. Instead, it defines its own syntax for data fetching, authentication, internationalization, and preferences. To interact with your API, react-admin relies on adapters called **providers**.
6060

61-
<img class="no-shadow" src="../../img/providers.png" alt="Providers" />
61+
<img class="no-shadow" src="../img/providers.png" alt="Providers" />
6262

6363
For example, to fetch a list of records from the API, you would use the `dataProvider` object as follows:
6464

@@ -99,9 +99,9 @@ Content-Range: posts 0-4/27
9999
]
100100
```
101101

102-
React-admin comes with [more than 50 data providers](../data-fetching/DataProviderList.md) for various backends, including REST, GraphQL, Firebase, Django REST Framework, API Platform, and more. If these providers do not suit your API, you have the flexibility to [develop a custom provider](../data-fetching/DataProviderWriting.md).
102+
React-admin comes with [more than 50 data providers](./DataProviderList.md) for various backends, including REST, GraphQL, Firebase, Django REST Framework, API Platform, and more. If these providers do not suit your API, you have the flexibility to [develop a custom provider](./DataProviderWriting.md).
103103

104-
This approach is why react-admin components do not call `fetch` or `axios` directly. Instead, they rely on the data provider to fetch data from the API. Similarly, it is recommended that your custom components follow the same pattern and utilize [data provider hooks](../data-fetching/Actions.md), such as [`useGetList`](../data-fetching/useGetList.md):
104+
This approach is why react-admin components do not call `fetch` or `axios` directly. Instead, they rely on the data provider to fetch data from the API. Similarly, it is recommended that your custom components follow the same pattern and utilize [data provider hooks](./Actions.md), such as [`useGetList`](./useGetList.md):
105105

106106
```jsx
107107
import { useGetList } from 'ra-core';
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
layout: default
3+
title: "Supported Auth Provider Backends"
4+
sidebar:
5+
order: 2
6+
label: Supported Backends
7+
---
8+
9+
It's very common that your auth logic is so specific that you'll need to write your own `authProvider`. However, the community has built a few open-source Auth Providers that may fit your need:
10+
11+
<div class="providers-list" markdown="1">
12+
13+
- ![Appwrite Logo](../../img/backend-logos/appwrite.svg "Appwrite Logo")**[Appwrite](https://appwrite.io/)**: [marmelab/ra-appwrite](https://github.com/marmelab/ra-appwrite)
14+
- ![auth0 Logo](../../img/backend-logos/auth0.svg "auth0 Logo")**[Auth0 by Okta](https://auth0.com/)**: [marmelab/ra-auth-auth0](https://github.com/marmelab/ra-auth-auth0/blob/main/packages/ra-auth-auth0/Readme.md)
15+
- ![amplify Logo](../../img/backend-logos/amplify.svg "amplify Logo")**[AWS Amplify](https://docs.amplify.aws)**: [MrHertal/react-admin-amplify](https://github.com/MrHertal/react-admin-amplify)
16+
- ![cognito Logo](../../img/backend-logos/aws.png "cognito Logo")**[AWS Cognito](https://docs.aws.amazon.com/cognito/latest/developerguide/setting-up-the-javascript-sdk.html)**: [marmelab/ra-auth-cognito](https://github.com/marmelab/ra-auth-cognito/blob/main/packages/ra-auth-cognito/Readme.md)
17+
- ![azure Logo](../../img/backend-logos/microsoft.svg "azure Logo")**[Microsoft Entra ID (using MSAL)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser)**: [marmelab/ra-auth-msal](https://github.com/marmelab/ra-auth-msal/blob/main/packages/ra-auth-msal/Readme.md) ([Tutorial](https://marmelab.com/blog/2023/09/13/active-directory-integration-tutorial.html))
18+
- ![casdoor Logo](../../img/backend-logos/casdoor.svg "casdoor Logo")**[Casdoor](https://casdoor.com/)**: [NMB-Lab/reactadmin-casdoor-authprovider](https://github.com/NMB-Lab/reactadmin-casdoor-authprovider)
19+
- ![directus Logo](../../img/backend-logos/directus.svg "directus Logo")**[Directus](https://directus.io/)**: [marmelab/ra-directus](https://github.com/marmelab/ra-directus/blob/main/packages/ra-directus/Readme.md)
20+
- ![firebase Logo](../../img/backend-logos/firebase.png "firebase Logo")**[Firebase Auth (Google, Facebook, GitHub, etc.)](https://firebase.google.com/docs/auth/web/firebaseui)**: [benwinding/react-admin-firebase](https://github.com/benwinding/react-admin-firebase#auth-provider)
21+
- ![google Logo](../../img/backend-logos/google.svg "google Logo")**[Google Identity & Google Workspace](https://developers.google.com/identity/gsi/web/guides/overview)**: [marmelab/ra-auth-google](https://github.com/marmelab/ra-auth-google/blob/main/packages/ra-auth-google/Readme.md)
22+
- ![keycloak Logo](../../img/backend-logos/keycloak.svg "keycloak Logo")**[Keycloak](https://www.keycloak.org/)**: [marmelab/ra-keycloak](https://github.com/marmelab/ra-keycloak/blob/main/packages/ra-keycloak/Readme.md)
23+
- ![supabase Logo](../../img/backend-logos/supabase.svg "supabase Logo")**[Supabase](https://supabase.io/)**: [marmelab/ra-supabase](https://github.com/marmelab/ra-supabase/blob/main/packages/ra-supabase/README.md)
24+
- ![surrealdb Logo](../../img/backend-logos/surrealdb.svg "surrealdb Logo")**[SurrealDB](https://surrealdb.com/)**: [djedi23/ra-surrealdb](https://github.com/djedi23/ra-surrealdb)
25+
26+
</div>
27+
28+
Beyond ready-to-use providers, you may find help in these third-party tutorials about integrating more authentication backends:
29+
30+
<div class="providers-list" markdown="1">
31+
32+
- ![loopback Logo](../../img/backend-logos/loopback4.svg "loopback Logo")**[Loopback](https://loopback.io/doc/en/lb4/Authentication-overview.html)**: [appsmith dev.to tutorial](https://dev.to/appsmith/building-an-admin-dashboard-with-react-admin-86i#adding-authentication-to-reactadmin)
33+
- ![openid Logo](../../img/backend-logos/openid.svg "openid Logo")**[OpenID Connect (OIDC)](https://openid.net/connect/)**: [marmelab/ra-example-oauth](https://github.com/marmelab/ra-example-oauth)
34+
35+
</div>
36+
37+
If you have released a reusable `authProvider`, or a tutorial for another auth backend, please open a PR to add it to this list!

0 commit comments

Comments
 (0)