Features
Onboarding

Onboarding Module

Once the user registers for the first time, or creates another instance of a tenant from the current administration panel, they will be redirected to the onboarding process for that new tenant. The onboarding is ideal for accepting the terms and conditions, or for the user to fill out any required fields for each tenant, or simply to show them a guide or highlight the best features of your system.

Onboarding Flow

<CompleteOnBoarding
  isOnboardingCompleted={organization.isOnboardingCompleted ?? false}
/>

This component is placed in the Main Layout for all the pages that pertain to a tenant.

export default async function OrganizationLayout({children }: {
    children: ReactNode;
    }) {
 
        const { organization, userMembership } = await getMembership();
 
        return
            ....
            <CompleteOnBoarding
            isOnboardingCompleted={organization.isOnboardingCompleted ?? false}
            />
        }

If the tenant has not yet completed the onboarding process, we redirect them to the page /home/admin/onboarding, where we will place our form as needed. Then, in our logic, we will integrate the function to mark that this tenant has completed the onboarding.

//button complete onboarding
const handleCompleteOnboarding = () => {
  makeOrganizationOnboardingCompleted();
};
"use server";
 
import prisma from "@/lib/db";
import { refreshOrganizationData } from "@/utils/facades/serverFacades/organizationFacade";
import { getMembership } from "@/utils/facades/serverFacades/userFacade";
 
export const makeOrganizationOnboardingCompleted = async () => {
  const { organization } = await getMembership();
 
  await prisma.organization.update({
    where: {
      id: organization.id,
    },
    data: {
      isOnboardingCompleted: true,
    },
  });
 
  refreshOrganizationData();
 
  return "ok";
};