1
Study System
nmemmert edited this page 2026-09-03 17:05:26 -04:00

Study System

The study platform lives at /study. It uses its own user accounts, separate from the admin.

User Accounts

  • Sign up at /study/signup with email + password
  • Sessions last 30 days (cookie-based)
  • Users enroll in one or more studies
  • Profile fields: display name, avatar URL, newsletter opt-in, reminder preferences

User data: data/study-users.json

Studies & Sections

Each study (e.g. "Colossians: Rooted in Christ", slug colossians) has a list of sections (lessons):

Field Description
id URL slug, e.g. 1-1-2
title Lesson title
releaseDate Locks the lesson until this date
scriptureText Passage text
commentary Instructor commentary
reflectionQuestions Array of questions
greekNotes Array of word study entries

URL pattern: /study/:studySlug/:sectionId

Progress Tracking

Completing all reflection questions marks a section complete. Progress is stored in data/study-progress/<userId>.json.

Completion unlocks the Next button to the following section.

Notes

Students take notes anchored to parts of each lesson (Scripture, Commentary, Reflection). Notes are stored in data/study-notes/<userId>.json as a map of anchor keys → HTML strings (TipTap rich text). Auto-saved with a 1.5-second debounce.

Community

Each study has a feed at /study/:studySlug/community.

  • Posts are scoped to a study, optionally to a specific lesson (sectionId)
  • Enrolled users can post, reply, and like posts
  • Likes stored as likedBy array of user IDs on each post
  • "Discuss this lesson" shortcut in the lesson sidebar links to the community pre-filtered to the current lesson

Data: data/study-community.json (up to 500 posts, 50 replies each)

Reminders & Re-engagement Emails

Users opt into study reminder emails via their account page.

Type Trigger
Lesson reminder New lesson released → email to enrolled users with reminders on
Re-engagement User inactive 7 / 14 / 30 days → tiered emails (T1/T2/T3)
Weekly digest Weekly lesson summary (for users who chose digest frequency)

User fields: studyRemindersEnabled, reminderFrequency (immediate or weekly), remindersPausedUntil.

Emails sent via Resend. Templates live in the Resend dashboard.

Certificates

Completing all sections of a study generates a certificate, emailed to the student. Publicly viewable at /certificate/:token.

Data: data/study-certificates.json

Streaks

Each section completion updates currentStreak and longestStreak on the user. Displayed on the account page.