This dashboard is a Next.js app with pluggable authentication (Clerk or Auth0) selected via environment variables.
- Go to the dashboard folder:
cd src/tools/vintasend-dashboard- Install dependencies:
npm install- Create your local environment file from the example:
cp .env.example .env.local- Configure auth and backend variables in
.env.local. - Configure your VintaSend service in
lib/notifications/get-vintasend-service.ts(see section below). - Remove the
lib/notifications/get-vintasend-service.tsfrom the.gitignorefile. - Start the app:
npm run devOpen http://localhost:3000.
First, install dependencies and run the development server:
npm install
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
The dashboard uses lib/notifications/get-vintasend-service.ts as the backend
factory for all notification actions. You must adapt this file to your own
VintaSend implementation.
Minimum setup:
- Open
lib/notifications/get-vintasend-service.ts. - Replace imports from the Medplum example with imports from your service package/module.
- Build and return your configured VintaSend service in
getVintaSendService(). - Update
validateBackendConfig()so it checks only the environment variables required by your backend. - Ensure all required backend env vars are present in
.env.local.
You can use lib/notifications/get-vintasend-service.ts.example as a starting
point and keep a project-specific implementation in
lib/notifications/get-vintasend-service.ts.
The dashboard uses a strategy pattern: resolveAuthStrategy() reads
AUTH_PROVIDER and delegates auth operations to the chosen provider. The
proxy middleware (proxy.ts) protects routes and handles provider-specific
auth flows, while the app layout wraps the UI with the provider component.
- Clerk: Uses
clerkMiddleware()and renders Clerk components - Auth0 v4: Uses
auth0.middleware()which auto-mounts routes at/auth/*(no API route handlers needed)
- Create a Clerk application and copy the publishable/secret keys.
- Set
AUTH_PROVIDER=clerkin.env.local. - Add the Clerk keys listed below.
- Start the dev server and visit
/sign-in.
- Create an Auth0 Regular Web Application.
- Configure application URLs:
- Allowed Callback URLs:
http://localhost:3000/auth/callback - Allowed Logout URLs:
http://localhost:3000 - Allowed Web Origins:
http://localhost:3000
- Allowed Callback URLs:
- Set
AUTH_PROVIDER=auth0in.env.local. - Add the Auth0 values listed below.
- Start the dev server and visit
/auth/login.
Note: This dashboard uses Auth0 SDK v4, which no longer uses the /api prefix for auth routes. The routes are now mounted automatically by the middleware at /auth/*.
| Variable | Provider | Description |
|---|---|---|
| AUTH_PROVIDER | Clerk, Auth0 | Selects which auth strategy to use (clerk or auth0). |
| NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | Clerk | Clerk publishable key. |
| CLERK_SECRET_KEY | Clerk | Clerk secret key. |
| AUTH0_SECRET | Auth0 | Session cookie encryption secret. |
| APP_BASE_URL | Auth0 | Base URL of the app (e.g. http://localhost:3000). Note: In Auth0 v4, this was renamed from AUTH0_BASE_URL. |
| AUTH0_DOMAIN | Auth0 | Auth0 tenant domain without scheme (e.g. example.us.auth0.com). Note: In Auth0 v4, this was renamed from AUTH0_ISSUER_BASE_URL and no longer accepts https://. |
| AUTH0_CLIENT_ID | Auth0 | Auth0 application client ID. |
| AUTH0_CLIENT_SECRET | Auth0 | Auth0 application client secret. |
| GITHUB_REPO | Notifications preview | GitHub repository in owner/repo format used to fetch templates by commit. |
| GITHUB_API_KEY | Notifications preview | GitHub token with repository read access. |
| GITHUB_API_BASE_URL | Notifications preview | Optional GitHub API base URL (defaults to https://api.github.com). |
| GITHUB_TEMPLATES_BASE_PATH | Notifications preview | Optional base path prefixed to template paths before GitHub fetch. |
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.