Skip to content

Event calendar using an existing Ministry Platform database

Notifications You must be signed in to change notification settings

austinginn/mp-events

Repository files navigation

MP Events

A lightweight, responsive, open source event calendar for use with Ministry Platform databases.

Features:

  • Ministry Platform API integration and event synchronization
  • Progressive Web App (PWA) compatibility
  • Offline caching
  • Custom dark and light themes
  • ICS hosting -- /api/ics
  • ICS calendar invites
  • Admin portal for creating custom themes and enabling features -- /admin

Experimental Features:

  • Weekly statistics email
  • Stats -- use stats(); in browser dev console
  • Debug log -- use debug(); in browser dev console

A running example: events.afumc.org

Installation

Method #1 (docker)

docker build -t mp-events https://github.com/austinginn/mp-events.git
nano .env

See .env section for creating your environment variables.

docker run --env-file ./.env -p 3000:3000 -d --name mp-events mp-events

Method #2 (node)

On a server with node installed:

git clone https://github.com/austinginn/mp-events.git
cd mp-events
git checkout stable
npm install
nano .env

See .env section for creating your environment variables. Once environment variables are configured:

npm start

Environment Variables

Create a .env file:

nano .env

Modify it with the following variables:

Key Description
CLIENT_ID Ministry Platform API Client ID (see MP Configuration)
CLIENT_SECRET Ministry Platform API Client Secret (see MP Configuration)
ROOT your subdomain that comes before the ministryplatform.com domain -- example.ministryplatform.com
EMAIL_HOST SMTP server for your email host
EMAIL_PORT SMTP server port
EMAIL_SECURE True for port 465, false for other ports
EMAIL_USER Email user name (typically noreply@example.com)
EMAIL_SECRET Email password
PORTAL_SECRET Password used to access admin portal -- events.example.com/admin
UPDATE_SECRET Secret used for webhook (see MP Configuration)
STATS_EMAIL Email where weekly stats will be sent to (experimental feature)

Your final .env file should look something like this:

CLIENT_ID=client
CLIENT_SECRET=averysecuresecret
ROOT=example
EMAIL_HOST=office.smtp.com
EMAIL_PORT=443
EMAIL_SECURE=false
EMAIL_USER=noreply@example.com
EMAIL_SECRET=noreplypassword
PORTAL_SECRET=averysecurepassword
UPDATE_SECRET=averysecuresecretforwebhook
STATS_EMAIL=example@example.com

*This file contains sensitive information. DO NOT push to a public repository.

Ministry Platform Configuration

API Client

With MP admin credentials navigate to your Ministry Platform page - example.ministryplatform.com/ministryplatform.

  • Administration -> API Clients -> New
  • Fill out the following fields
    • Display Name: MP Events
    • Client ID: mpevents
    • Client Secret: come up with something secure
    • Client User: apiuser
    • Authentication Flow: Client Credentials

Webhook

  • Administration -> Webhooks -> New
  • Fill out the following fields
    • Name: MP-Events Webhook
    • HTTP Method: Post
    • URI: your mp-events public domain/api/update -- https://events.example.com/api/update
    • Body Template: { "auth": "come up with something secure" } -- this should match .env UPDATE_SECRET from env section
    • Headers Template: Content-Type: application/json
    • Table Name: Events

Notes

There are many things outside of the scope of this document that need to be configured to make your MP-Events Calendar public. We use Digital Ocean at Alpharetta Methodist. You can support this project and get $100 in credits to host your own by creating an account using this link:
DigitalOcean Referral Badge
Here are some helpful resources from Digital Ocean:

Credit

Created and maintained by Austin Ginn for Alpharetta Methodist