Skip to main content

App Routes Reference

All routes live under src/app/. The locale prefix [locale] is always present and validated against supported locales.

Route groups

GroupPath patternPurpose
(app)[locale]/(app)/...Full authenticated app with drawer nav and org context
(legal)[locale]/(app)/(legal)/...Static legal/info pages (no extra layout)
event[locale]/event/...Post-auth event landing pages (sign-in gate, error screens)

Page routes

Dashboard

RouteURL examplePurpose
[locale]/(app)/page.tsx/enActivity list (home). Deactivates expired activities on render.
[locale]/(app)/orglist/page.tsx/en/orglistList of orgs the user belongs to.
[locale]/(app)/e/orgchange/page.tsx/en/e/orgchangeSwitch active organization.

Activity — view (public)

RouteURL examplePurpose
[locale]/(app)/v/page.tsx/en/vPublic activity listing.
[locale]/(app)/v/[id]/page.tsx/en/v/abc123Public view of a single activity.

Activity — edit (authenticated)

RouteURL examplePurpose
[locale]/(app)/e/page.tsx/en/eEdit landing; shows Clerk <SignIn> if unauthenticated.
[locale]/(app)/e/new/page.tsx/en/e/newCreate a new activity.
[locale]/(app)/e/[id]/page.tsx/en/e/abc123Edit an existing activity.

Organization management (authenticated, org:admin)

RouteURL examplePurpose
[locale]/(app)/e/org/page.tsx/en/e/orgOrg settings overview.
[locale]/(app)/e/org/new/page.tsx/en/e/org/newCreate a new organization.
[locale]/(app)/e/org/activitydefaults/page.tsx/en/e/org/activitydefaultsDefault values applied to new activities.
[locale]/(app)/e/org/locales/page.tsx/en/e/org/localesManage which locales the org supports.
[locale]/(app)/e/org/contracts/page.tsx/en/e/org/contractsList data-processing contracts.
[locale]/(app)/e/org/contracts/new/page.tsx/en/e/org/contracts/newCreate a new contract.
[locale]/(app)/e/org/partners/page.tsx/en/e/org/partnersList data-processing partners.
[locale]/(app)/e/org/partners/new/page.tsx/en/e/org/partners/newCreate a new partner.
[locale]/(app)/e/org/partners/[id]/page.tsx/en/e/org/partners/abc123Edit a partner.

Organizational units (authenticated)

RouteURL examplePurpose
[locale]/(app)/e/ou/new/page.tsx/en/e/ou/newCreate a new OU.
[locale]/(app)/e/ou/[id]/page.tsx/en/e/ou/abc123View/edit an OU.

Templates (authenticated)

RouteURL examplePurpose
[locale]/(app)/e/tmp/page.tsx/en/e/tmpList org templates.
[locale]/(app)/e/tmp/[id]/page.tsx/en/e/tmp/abc123View/edit a template.
RouteURL examplePurpose
[locale]/(app)/(legal)/about/page.tsx/en/aboutAbout page.
[locale]/(app)/(legal)/about/third-party-licenses/page.tsx/en/about/third-party-licensesThird-party software licenses.
[locale]/(app)/(legal)/licenses/page.tsx/en/licensesApp software licenses.
[locale]/(app)/(legal)/privacy/page.tsx/en/privacyPrivacy policy.
[locale]/(app)/(legal)/terms/page.tsx/en/termsTerms of service.

Documentation (public)

RouteURL examplePurpose
[locale]/(app)/docs/embedding/page.tsx/en/docs/embeddingGuide for embedding activity declarations.

Event / post-auth gates (public)

RouteURL examplePurpose
[locale]/event/sign-in/page.tsx/en/event/sign-inAfter-sign-in redirect: org:admin/e, members → /.
[locale]/event/sign-out/page.tsx/en/event/sign-outAfter-sign-out landing page.
[locale]/event/language/page.tsx/en/event/languageLanguage picker for users with a non-configured locale.
[locale]/event/org-not-available/page.tsx/en/event/org-not-availablePrivate org accessed while unauthenticated.
[locale]/event/org-relay/page.tsx/en/event/org-relayCross-org redirect relay.
[locale]/event/organization-not-found/page.tsx/en/event/organization-not-foundOrg hostname does not resolve to a known org.
[locale]/event/organization-blocked/page.tsx/en/event/organization-blockedOrg is suspended/blocked.

Google Forms integration

RouteURL examplePurpose
[locale]/gforms/page.tsx/en/gformsGoogle Forms add-on UI. Resolves user via resolveGformsUser.

API / file-serving routes

Activity document export (Turnstile-protected)

RouteMethodPurpose
[locale]/[id]/route.tsGETReturns activity information or declaration as HTML. Query param type=activity-information|activity-declaration.
[locale]/[id]/pdf/route.tsGETReturns activity information or declaration as PDF (Playwright renderer + pdf-lib).
[locale]/(app)/ropa/route.tsGETFull ROPA PDF export for the org. Returns a hardcoded PDF for production/demo orgs, generates dynamically otherwise.
[locale]/(app)/e/tmp/download/[id]/route.tsGETDownloads a template preview as an HTML file.

Admin (requires x-admin-secret header)

RouteMethodPurpose
api/admin/cache-invalidate/route.tsGETInvalidates Next.js cache for a given shortName.
api/admin/org/export/route.tsGETExports org data as JSON or CSV.
api/admin/org/import/route.tsPOSTImports org data from JSON body or multipart/form-data ZIP.
api/admin/recreate-org/[tenant]/route.tsGETResets an org from its template.

Google Forms API (Clerk session or ?email= dual-auth)

RouteMethodPurpose
api/gforms/activities/route.tsGETLists activities for an org+locale. Query params: email, shortName, locale.
api/gforms/clause/route.tsPOSTGenerates a GDPR clause for an activity. Body: email, shortName, locale, activityId, formData.
api/gforms/locales/[locale]/route.tsGETReturns GForms UI translations for a locale. No auth required.

Utility

RouteMethodPurpose
api/locale-default/route.tsGETReturns the default locale for the org identified by the Host header. Used by the reverse proxy for root-path redirects. No auth.
api/logo/[organizationId]/route.tsGETServes a partner's logo PNG for the org identified by the Host header, with content-hash cache busting (?v=), ETag/304 and immutable caching. No auth — see Logo Serving.

Webhooks

RouteMethodPurpose
api/webhooks/clerk/route.tsPOSTHandles Clerk webhook events: organization.created/updated/deleted, user.created/deleted.