Getting started with Rimdian apps development.
iframe
inside the Rimdian UI Console.
The app is loaded with a ?token=xxx
URL parameter that is signed by Rimdian with your APP_SECRET_KEY
. This is how your app can authenticate that it has been loaded by a legit Rimdian parent window.
The app can interact with the Rimdian API using a Service Account, which is a special type of admin
access that has full access to the API.
The app can receive webhooks from Rimdian, such as tasks
& data_hooks
, and process them to update the app state & sync data.
Your apps can be hosted anywhere, as long as they are hosted over SSL.
The capabilities of your app are described in a manifest.json file that you provide to Rimdian when you create a new private app.
App iframe area
tasks
& data hooks
.
.env.local
file with the following content:access_token
.
The dev server will start with SSL. You can access the app at https://localhost:3000.
manifest.json
- A default app manifest that describes the app and its capabilities.src/pages/api/*
- API routes for the backend API. It receives tasks
& data_hooks
webhooks from Rimdian.src/app/*
- The app UI that will be loaded in the Rimdian UI Console as an iframe.src/app/app_context.tsx
- React context that reads the ?token=xxx
parameter provided by Rimdian in the iframe URL, and fetches the app config from the API.src/app/page.tsx
- Root page that redirects to the proper screen after loading the app_context
.src/app/dashboard
- Folder containing the app dashboard when your app is active.src/app/initializing
- Folder containing the app initialization screen where you will collect the Service Account credentials & whatever data required to activate your app.src/app/invalid-token
- Screen showed when the app_context
fails to fetch your app from the API.src/app/stopped
- Screen showed when your app has been stopped.src/app/components.tsx
- React components used by Rimdian to make your app looking similar.src/app/actions.ts
- Server actions that are be exposed to the app UI, to query the Rimdian API.src/processTasks.ts
- Example of a webhook processing a task described in your manifest.json
.src/processDataHooks.ts
- Example of a webhook processing a data_hook described in your manifest.json
..env.local
- The environment variables that are used in the app (your secret app key & DB credentials).APP_SECRET_KEY
should be kept secret and not shared with anyone.APP_SECRET_KEY
is used to sign the webhook payloads sent by Rimdian to your app.APP_SECRET_KEY
is used to sign the token provided by Rimdian to your iframe, as a URL parameter ?token=xxx
. That’s how your app can authenticate that it has been loaded by a legit Rimdian parent window.Dockerfile
to build a production image of your app. Don’t forget to set the APP_SECRET_KEY
& other environment variables in your production environment.
cloudbuild.yaml
file to deploy your app to Google Cloud Run with a simple git push
, combined with Google Cloud Build triggers.
You can map your custom domain to Google Cloud Run and it will provision a SSL certificate for you.
The cloudbuild.yaml
file is configured to name your app rimdian-app
by default & deploy it in the europe-west1
region.
In Google Cloud Run, you should set the APP_SECRET_KEY
environment variable in the “Variables” section of your app in the Google Cloud UI.