Package Exports
- ra-soul
- ra-soul/src/index.ts
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ra-soul) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
RA-Soul-Provider
Description
RA-Soul-Provider is a data provider that helps you connect React Admin with Soul, a REST server that uses SQLite. This provider exports a list of auth provider methods and data provider methods that you can use to connect your React Admin application with Soul.
Provider Methods
Data Providers
- getList
- getOne
- getMany
- getManyReference
- create
- update
- updateMany
- delete
- deleteManyAuth Providers
- login
- logout
- checkAuth
- checkError
- getPermissions
- changePasswordUsage
1. Start the Soul server
Clone the Soul repository and follow the instructions in the README to run the server.
2. Install the ra-soul-provider
npm i ra-soul-provider3. Use the provider in your React Admin application
import { Admin, Resource } from "react-admin";
import { dataProvider, authProvider } from "ra-soul-provider";
import { AlbumList } from "./components/Album";
import { GenreList } from "./components/Genre";
import { ChangePassword } from "./components/auth/ChangePassword";
/** React Admin expects an id field for each resource, but if your database doesn't have an id
* field in each table, then you should map your primary key for each resource
**/
const primaryKeyDictionary = {
albums: "AlbumId",
tracks: "TrackId",
genres: "GenreId",
playlists: "PlayListId",
};
const soulApiUrl = "http://soul.api.url/tables";
function App() {
return (
<Admin
dataProvider={dataProvider(primaryKeyDictionary, soulApiUrl)}
authProvider={authProvider(soulApiUrl)}
loginPage={Login}
>
<Resource
name="genres"
list={GenreList}
create={GenreCreate}
edit={GenreEdit}
show={GenreShow}
/>
<Resource
name="albums"
list={AlbumList}
show={AlbumShow}
edit={AlbumEdit}
create={AlbumCreate}
/>
<Resource name="change-password" list={ChangePassword} />
</Admin>
);
}