Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
import "server-only";
import { GoogleCalendarService } from "@/features/calendars/google/service";
type CalendarServiceProvider = {
provider: string;
credentials: unknown;
};
export const createCalendarService = async (
service: CalendarServiceProvider,
) => {
switch (service.provider) {
case "google":
return new GoogleCalendarService({
credentials: GoogleCalendarService.credentialsSchema.parse(
service.credentials,
),
});
default:
throw new Error(`Unsupported provider: ${service.provider}`);
}
};