logo
E

Getting Started

Configuration

Ecclesia DPM uses environment variables for service configuration and database-driven feature toggles for per-organization settings.

Environment Variables

Required Variables

VariableDescriptionExample
DATABASE_URLPostgreSQL connection stringpostgresql://user:pass@host:5432/db
NEXTAUTH_SECRETAuth.js session encryption keyRandom 32+ char string
NEXTAUTH_URLApplication base URLhttp://localhost:3000
AUTH_SECRETAuth.js secretRandom 32+ char string

Optional Variables

VariableDescriptionDefault
AWS_ACCESS_KEY_IDS3 file uploads—
AWS_SECRET_ACCESS_KEYS3 file uploads—
AWS_REGIONS3 bucket region—
AWS_BUCKET_NAMES3 bucket name—
PAYSTACK_SECRET_KEYPayment processing—
NEXT_PUBLIC_PAYSTACK_PUBLIC_KEYClient-side Paystack—
RESEND_API_KEYEmail service—
YOUTUBE_API_KEYLive stream integration—

Feature Toggle System

Features are controlled per-organization via the OrganizationFeatureSettings model. This allows each parish to enable only the features they need.

Default-Enabled Features

FeatureToggleDescription
Parishioner ManagementenableParishionerManagementCore member management
Sacramental RecordsenableSacramentalRecordsBaptism, Confirmation, etc.
Financial ManagementenableFinancialManagementPayments and offerings
Mass IntentionsenableMassIntentionsIntention booking
AppointmentsenableAppointmentsBooking system
AnnouncementsenableAnnouncementsParish announcements
Email NotificationsenableEmailNotificationsEmail service

Default-Disabled Features

FeatureToggleDescription
Live StreamingenableLiveStreamingYouTube/Facebook streams
SMS NotificationsenableSMSNotificationsSMS service
Online PaymentsenableOnlinePaymentsPaystack integration
Mobile AppenableMobileAppPWA features

Checking Feature Toggles

Server-side (Server Actions / API Routes):

import db from "@/lib/db";

const settings = await db.organizationFeatureSettings.findUnique({
  where: { organizationId: session.user.organizationId },
});

if (!settings?.enableMassIntentions) {
  return { error: "Mass intentions are not enabled for this organization" };
}

Client-side (React Components):

import { useFeatureSettings } from "@/hooks/use-feature-settings";

function MassIntentionButton() {
  const { settings } = useFeatureSettings();

  if (!settings?.enableMassIntentions) return null;

  return <Button>Book Mass Intention</Button>;
}