Kredal Docs
Reference

Routes and Server Actions

The route tree and the inventory of server actions in kredal-app.

Public routes

RoutePurpose
/Landing page.
/loginSign in. Redirects to /app if already authenticated.
/signupCreate an account.
/pricingPilot-phase pricing.
/securitySecurity & data-handling overview.

Authenticated routes (/app/**, gated by proxy.ts)

RoutePurpose
/appDashboard: workspace's companies (or clients, for consultants).
/app/companies/newCreate a company.
/app/companies/[companyId]Company detail + progress checklist.
/app/companies/[companyId]/editEdit company profile.
/app/companies/[companyId]/documentsDocument vault + required-doc checklist.
/app/companies/[companyId]/questionnaire8-section readiness questionnaire.
/app/companies/[companyId]/assessmentRun and view the rejection-risk assessment.
/app/companies/[companyId]/reportsGenerate reports.
/app/companies/[companyId]/reports/[reportId]View / copy / export a report.

Server actions

All mutations run server-side as the signed-in user (RLS-enforced). Each writes an audit_events row. Located in kredal-app/src/app/actions/.

ActionFileWhat it does
signUp, signIn, signOutauth.tsSupabase email auth.
createWorkspaceworkspace.tsCreate a workspace + owner membership.
createCompany, updateCompanycompany.tsCompany CRUD.
uploadDocument, deleteDocument, createSignedDocumentUrldocuments.tsPrivate-storage upload, delete, and short-lived signed preview URLs.
addOwner, deleteOwnerowners.tsUBO / shareholder management.
saveQuestionnaireSectionquestionnaire.tsUpsert answers for one section.
runReadinessAssessmentassessment.tsScore the company, snapshot the assessment, update status.
generateReportreports.tsRender and store a Markdown report.

Convention: forms and server actions

In a Server Component, always pass a server action to a form as a direct or bound reference:

<form action={createSignedDocumentUrl.bind(null, doc.storage_path)}>

Never pass an inline closure (action={() => createSignedDocumentUrl(...)}) from a Server Component — it is not serializable across the RSC boundary and throws "Functions cannot be passed directly to Client Components". Client components ("use client") do not have this restriction. This was a real bug fixed during live verification.

On this page