Installation
Prerequisites
Arkitekt Web is build on react and therefore requires react >16 to be installed.
React only
Arkitekt Web support is currently relying exlusively on React and its ecoystem. We are working on refactoring the codebase to support other frameworks as well.
Installation
The fully working arkitekt with all subservices can be installed via npm or yarn.
- npm
- yarn
npm install @jhnnsrs/arkitekt
yarn add @jhnnsrs/arkitekt
Usage
Arkitekts functionaly is within the Arkitekt Provider that itself sets up providers for the related services.
import { ArkitektProvider } from "@jhnnsrs/arkitekt";
import { useMikroQuery, MikroGuard } from "@jhnnsrs/mikro";
export const InnerApp = () => {
const [data] = useMikroQuery(
gql```
query {
myrepresentations {
id
name
}
}
```
); // Once configured this will return the data from the query
return <>{JSON.stringify(data)}</>
};
export const App = () => {
return (
<ArkitektProvider>
<MikroGuard fallback={<div>Mikro is not connected</div>}> {/* // This will only render the children if mikro is connected */}
<InnerApp>
</MikroGuard>
</ArkitektProvider>
);
};
info
This app will not work as is. You need to use both fakts
and herre
to first
configure the connected and then authenticate with them.
This documentation provides examples to be used with "react-router" and authenticating your web app as a public app (an app that users can login in with and authorize).