Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
51a848c
Update fumadocs Version
kschneider84 Mar 10, 2026
be289a2
implement openapi integration for fumadocs
kschneider84 Mar 10, 2026
bfeb53b
Update tsconfig and swagger
kschneider84 May 27, 2026
b354eec
Merge branch 'update-fumadocs' into openapi-test
kschneider84 May 27, 2026
cebc506
generate mdx files directly instead of virtual files
kschneider84 Jun 1, 2026
8f61965
update fumadocs
kschneider84 Jun 1, 2026
ed38a6c
change style
kschneider84 Jun 16, 2026
5a73f15
Remove apidoc components from swagger
kschneider84 Jun 16, 2026
4d66451
add profile-based config, improve index layout and styling
kschneider84 Jun 17, 2026
056585b
Fix json file
kschneider84 Jun 17, 2026
1b4f8bb
Add endpoint openAPI files in yaml format
kschneider84 Jun 19, 2026
b395b86
Restructure survey und study rules editor sections: remove subfolder …
kschneider84 Jun 19, 2026
be797a8
Remove schemas in index overview, sort endpoint grouping by oder of t…
kschneider84 Jun 19, 2026
bbf84a5
Update README with new OpenAPI handling
kschneider84 Jun 22, 2026
e59e841
Generate OpenAPI tech-docs
kschneider84 Jun 25, 2026
fb1f283
Remove redundant json files
kschneider84 Jun 26, 2026
5ebd736
Add endpoints "remove study session", "update study track account"
kschneider84 Jun 29, 2026
b28c5d7
Remove swagger-ui-react
kschneider84 Jul 1, 2026
c705336
remove swagger component
kschneider84 Jul 1, 2026
5ed53a0
update coderabbit review configs
kschneider84 Jul 1, 2026
8b3ff05
remove unused imports
kschneider84 Jul 1, 2026
d979d9d
add participant-api and smtp bridge to default inputs
kschneider84 Jul 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
reviews:
path_filters:
- "!case-docs/content/tech-docs/management-api/api/**"
- "!case-docs/content/tech-docs/participant-api/api/**"
- "!case-docs/content/tech-docs/smtp-bridge/api/**"
68 changes: 61 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,71 @@ Read the [Introduction](https://fumadocs.dev/docs/mdx) for further details.

## For API Documentation

Include the openapi spec file in the `public/openapi` directory.
OpenAPI docs are generated from profiles defined in `scripts/doc-profiles.ts`.

Add a new page with the name `api.mdx` in the `content/tech-docs/[api-name]` directory with the following content:
### 1. Add the OpenAPI spec

```mdx
---
title: My API
description: My API Description
---
Place your spec file in the `openapi` directory, for example:

- `openapi/my-api.yaml`

### 2. Add or update a docs profile

In `scripts/doc-profiles.ts`, add a new profile entry:

```ts
{
id: 'my-api',
input: './openapi/my-api.yaml',
outputDir: 'content/tech-docs/my-api/api',
baseUrl: '/tech-docs/my-api/api',
groupByTag: true,
}
```

`groupByTag: true` groups endpoints by OpenAPI tags in the generated docs.

Current profiles:

- `management-api` (`openapi/management-api.yaml`, `groupByTag: true`)
- `participant-api` (`openapi/participant-api.yaml`, `groupByTag: true`)
- `smtp-bridge` (`openapi/smtp-bridge.yaml`, `groupByTag: false`)

### 3. Add the Tech Docs section (only for a new API)

Create `content/tech-docs/my-api` with:

- `overview.mdx` (landing page)
- `meta.json` with `"pages": ["overview", "api"]`

Then add `my-api` to `content/tech-docs/meta.json` so the section appears in the sidebar.

### 4. Generate the API docs

List available profiles:

```bash
pnpm exec tsx --no-cache scripts/generate-docs.ts --list
```

Generate one profile:

```bash
pnpm exec tsx --no-cache scripts/generate-docs.ts my-api
```

Generate all profiles:

```bash
pnpm exec tsx --no-cache scripts/generate-docs.ts --all
```

### 5. Result

Generated API pages are written to `content/tech-docs/<api-id>/api` (including `index.mdx` and `meta.json`).

Note: these files are generated and should not be edited manually. Re-run the generator after spec changes.

## Learn More

To learn more about Next.js and Fumadocs, take a look at the following
Expand Down
4 changes: 2 additions & 2 deletions app/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function HomePage() {
<h2 className="text-2xl font-semibold mb-6">User Guides</h2>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
<Card
href="/docs/survey-editor/basics/editor-overview"
href="/docs/survey-editor/editor-overview"
title="Survey Editor"
description="Documentation for using the graphical survey editor"
icon={<PencilRuler className="w-6 h-6" />}
Expand All @@ -33,7 +33,7 @@ export default function HomePage() {
className="[&_div:has(svg)]:shadow"
/>
<Card
href="/docs/study-rules-editor/basics/editor-overview"
href="/docs/study-rules-editor/editor-overview"
title="Study Rules Editor"
description="Documentation for using the study rules editor"
icon={<GitFork className="w-6 h-6" />}
Expand Down
1 change: 0 additions & 1 deletion app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { notFound } from 'next/navigation';
import { createRelativeLink } from 'fumadocs-ui/mdx';
import { getMDXComponents } from '@/mdx-components';


export default async function Page(props: {
params: Promise<{ slug?: string[] }>;
}) {
Expand Down
17 changes: 13 additions & 4 deletions app/global.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
@import 'tailwindcss';
@import 'fumadocs-ui/css/black.css';
@import 'fumadocs-ui/css/solar.css';
@import 'fumadocs-ui/css/preset.css';
@import 'fumadocs-openapi/css/preset.css';

/* Hide the scheme container for Swagger UI */
.swagger-ui .scheme-container {
display: none;
html {
scrollbar-gutter: stable;
}

html>body[data-scroll-locked] {
margin-right: 0px !important;
--removed-body-scroll-bar-size: 0px !important;
}

:root {
--fd-layout-width: 1600px;
}
8 changes: 0 additions & 8 deletions app/tech-docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
import { notFound } from 'next/navigation';
import { createRelativeLink } from 'fumadocs-ui/mdx';
import { getMDXComponents } from '@/mdx-components';
import ApiDoc from '@/components/api-doc';


const basePath = process.env.NEXT_PUBLIC_BASE_PATH || '';
Expand All @@ -20,13 +19,6 @@ export default async function Page(props: {
const page = source.getPage(params.slug);
if (!page) notFound();

// Use the ApiDoc component for API pages (wrapper for Swagger UI)
if (params.slug?.includes('api')) {
return (
<ApiDoc specUrl={`${basePath}/openapi/${params.slug[0]}.json`} />
)
}

const MDXContent = page.data.body;

return (
Expand Down
29 changes: 0 additions & 29 deletions components/api-doc.tsx

This file was deleted.

6 changes: 6 additions & 0 deletions components/api-page.client.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use client';
import { defineClientConfig } from 'fumadocs-openapi/ui/client';

export default defineClientConfig({
// client-side config
});
7 changes: 7 additions & 0 deletions components/api-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { openapi } from '@/lib/openapi';
import { createAPIPage } from 'fumadocs-openapi/ui';
import client from './api-page.client';

export const APIPage = createAPIPage(openapi, {
client,
});
6 changes: 0 additions & 6 deletions content/docs/study-rules-editor/basics/meta.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Study Rules Editor
description: Overview of the study rules editor interface
title: Editor Overview
description: Main areas, navigation, and workflow for configuring study rules
---

## Introduction
Expand All @@ -15,14 +15,14 @@ description: Overview of the study rules editor interface

The **Study Rules Editor** is a graphical interface that allows you to create and manage these rules. It provides tools to define event handlers, configure contexts, and automate study workflows and participant management.

![Overview of study rules dashboard](../images/dashboardOverview.png)
![Overview of study rules dashboard](./images/dashboardOverview.png)


### Top Navigation Bar

- **"Project"**: Click here to open an existing project, save your project or export the study rules.
- **"Context"**: The editor context provides access to study and message keys, participant flags, reports and external event handlers that can be referenced in your rules.
You can import a context from a recent session or [create a new one](/docs/study-rules-editor/basics/editor-overview#context-editor) via the **"Open Context Editor"** button.
You can import a context from a recent session or [create a new one](/docs/study-rules-editor/editor-overview#context-editor) via the **"Open Context Editor"** button.


### General
Expand Down Expand Up @@ -102,7 +102,7 @@ Rules defined here are applied **when a participant leaves the study** (e.g., wh

The **Context Editor** is a configuration interface within the **Study Rules Editor**. It allows you to define the keys and identifiers that are used in **event handlers**, **conditions**, and **actions** throughout your study logic. These definitions ensure that all references to surveys, messages, flags, and other elements are valid and consistent.

![Overview of context editor](../images/contextEditor.png)
![Overview of context editor](./images/contextEditor.png)

### How to Access the Context Editor

Expand Down Expand Up @@ -179,4 +179,4 @@ Send data to external systems or trigger external workflows.

---

For a complete list of available expressions and actions you can use in your study rules, see the [Methods of the study engine](/docs/study-rules-editor/basics/study-rules).
For a complete list of available expressions and actions you can use in your study rules, see the [Methods of the study engine](/docs/study-rules-editor/study-rules).
2 changes: 1 addition & 1 deletion content/docs/study-rules-editor/guide/entry-handler.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This example shows how to configure actions that are executed automatically when
We’ll use the case where a **welcome message** is sent, the **intake survey** is assigned, and a **reminder message** for submitting the intake survey is scheduled.

## Prerequisite
Before you can configure ENTRY actions, make sure the Survey keys and Message keys are already defined in the [Survey context](/docs/study-rules-editor/basics/editor-overview#context-editor).
Before you can configure ENTRY actions, make sure the Survey keys and Message keys are already defined in the [Survey context](/docs/study-rules-editor/editor-overview#context-editor).

Needed for this example:
- Survey keys: `intake`
Expand Down
7 changes: 6 additions & 1 deletion content/docs/study-rules-editor/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
"title": "Study Rules Editor",
"description": "Documentation for using the graphical study rules editor",
"root": true,
"icon": "GitFork"
"icon": "GitFork",
"pages": [
"editor-overview",
"study-rules",
"guide"
]
}
7 changes: 0 additions & 7 deletions content/docs/survey-editor/basics/meta.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: Survey Editor Overview
description: Overview of the survey editor interface
title: Editor Overview
description: Main areas, navigation, and workflow for building surveys
---

## Survey Editor Dashboard

![Screenshot of survey editor dashboard](../images/dashboardEditor.png)
![Screenshot of survey editor dashboard](./images/dashboardEditor.png)

This dashboard shows you the key content and structure of your survey.

### Top Navigation Bar
- **Survey Editor**: displays the currently open editor.
- **File**: Click here to generate a new survey, open an existing survey, save survey to disk or exit survey editor.
- **View**: Click here to go to [Survey Properties](/docs/survey-editor/basics/editor-overview#survey-properties-workspace) section or Survey Simulator.
- **View**: Click here to go to [Survey Properties](/docs/survey-editor/editor-overview#survey-properties-workspace) section or Survey Simulator.
- **Survey Name:** Top left shows the unique key name of the current survey. Click on it to change its root key name.
- **Survey label**: Top center displays the survey label. You can rename the survey label by clicking on it.
- **Color Selector**: Click here to change the theme color of the survey.
Expand All @@ -24,18 +24,18 @@ This dashboard shows you the key content and structure of your survey.


### Survey Item List
- **Items**: This section lists all the [items](/docs/survey-editor/basics/item-structure#survey-items) of the survey. Each item has:
- **Items**: This section lists all the [items](/docs/survey-editor/item-structure#survey-items) of the survey. Each item has:
- an icon symbolizing the type of question (e.g. checkmark in circle for single choice question)
- an unique **Item Key** (e.g., `SCG1`).
- an optional **Label** text (e.g., `Single Choice Question`).
- Open the [item interface](/docs/survey-editor/basics/item-structure#item-interface) by clicking on the item or its icon shown in the left bar.
- Open the [item interface](/docs/survey-editor/item-structure#item-interface) by clicking on the item or its icon shown in the left bar.
- New items can be added by
- Click on **+ Add new item** at the bottom of the item list
- Click on **+** in the left sidebar.
- Items can be ordered by
- drag and drop them in the item list or left sidebar or
- toggle the switch `Use random ordering` in the **Item ordering** section to random order items when the survey runs.
- **Condition tab**: Switch to this tab to define [conditional logic](/docs/survey-editor/basics/conditions#conditions-and-expressions) that controls when items should be shown based on participant responses.
- **Condition tab**: Switch to this tab to define [conditional logic](/docs/survey-editor/conditions#conditions-and-expressions) that controls when items should be shown based on participant responses.

---

Expand All @@ -44,7 +44,7 @@ This dashboard shows you the key content and structure of your survey.
The **Survey Properties** workspace allows you to define and manage overall configuration and behavior of your survey.
Click on **View** dropdown menu and select **Survey Properties** to open this section (shortcut **⌘ Cmd + 1**).

![Screenshot of survey properties workspace basic information](../images/surveyPropertiesBasic.png)
![Screenshot of survey properties workspace basic information](./images/surveyPropertiesBasic.png)

### Overview of Functions

Expand All @@ -62,7 +62,7 @@ Click on **View** dropdown menu and select **Survey Properties** to open this se
Use the language toggle to view and edit content in different languages. This helps manage multilingual surveys efficiently.


![Screenshot of survey properties workspace access conditions](../images/surveyPropertiesAccess.png)
![Screenshot of survey properties workspace access conditions](./images/surveyPropertiesAccess.png)

- **Access Conditions**
Configure who is allowed to access and complete the survey.
Expand All @@ -75,7 +75,7 @@ Click on **View** dropdown menu and select **Survey Properties** to open this se
- **Submission requires Login**
Enable this toggle if participants must be logged in to submit their responses. If disabled, anyone with access to the survey can submit a response.

![Screenshot of survey properties workspace max items per page](../images/surveyPropertiesMaxItems.png)
![Screenshot of survey properties workspace max items per page](./images/surveyPropertiesMaxItems.png)

- **Max Items per Page**
Set the maximum number of question or content items that should appear on a single survey page for small and large screens.
Expand All @@ -90,7 +90,7 @@ The simulator allows you to preview and test your survey questions under differe
Below are the key components visible in the interface:


![Screenshot of survey simulator](../images/surveySimulator.png)
![Screenshot of survey simulator](./images/surveySimulator.png)


### Survey Items
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Select the option **"Question or Info item"**.
Select the option **"Consent"**. The consent item is now shown in your item list. Click on the item to see the content item interface.
</Step>
<Step>
Select the component you would like to edit by clicking on it (Read more about [item components](/docs/survey-editor/basics/item-structure#survey-items)).
Select the component you would like to edit by clicking on it (Read more about [item components](/docs/survey-editor/item-structure#survey-items)).
</Step>
<Step>
Write your title text e.g. *"Consent to Data Storage"* in the text field of the title component. Go back to consent item interface.
Expand Down Expand Up @@ -126,6 +126,6 @@ In the dropdown menu, scroll to the Templates section and select **“Consent qu
![Condition interface with consent condition template](../images/addContact3.png)
</Step>
<Step>
A response slot key is not required. Use the survey [simulator](/docs/survey-editor/basics/editor-overview#simulator) to verify that the conditional logic works as expected.
A response slot key is not required. Use the survey [simulator](/docs/survey-editor/editor-overview#simulator) to verify that the conditional logic works as expected.
</Step>
</Steps>
Loading