Profile-Derived Context (PDC)
Profile-Derived Context (PDC)
Section titled “Profile-Derived Context (PDC)”The most important pattern in school-footprint. One profile definition drives all runtime behavior.
How It Works
Section titled “How It Works”When you say “I’m a dance school”, this happens:
Input: schoolType = "dance" │ ▼ ┌── danceProfile ──┐ │ │ ▼ ▼ Modules ON: Modules OFF: ✓ students ✗ departments ✓ academics ✗ workflow ✓ attendance ✓ scheduling ✓ fees │ ├── Terminology: Student → Dancer, Grade → Level ├── Scheduling: time-slots strategy ├── Fee model: per-class strategy └── Theme: rose (#c0506a)Step by Step
Section titled “Step by Step”Step 1: Define a profile
Section titled “Step 1: Define a profile”export const danceProfile = defineProfile({ id: "dance", displayName: "Dance Studio", modules: [students, academics, attendance, scheduling, fees], config: { schedulingPattern: "time-slots", services: { org: true, people: true, academics: true, scheduling: true }, moduleFlags: { grades: true, sections: true, attendance: true }, theme: { label: "Rose", accent: "#c0506a" }, },});Step 2: Profile selects strategies
Section titled “Step 2: Profile selects strategies”export const schoolStrategyMappings = [ { capabilityId: "schedule-class", profileAdapters: { k12: "fixed-timetable", // rigid weekly grid dance: "time-slots", // flexible start/end, drop-ins music: "appointments", // 1-on-1 lesson booking kindergarten: "activity-blocks", // morning/afternoon blocks tutoring: "flexible-slots", // any available window }, },];Step 3: Profile configures terminology
Section titled “Step 3: Profile configures terminology”// The same action says different things per school type://// K-12: "Enrolled Student Alice in Grade 5"// Dance: "Enrolled Dancer Alice in Level 3"// Kindergarten: "Enrolled Child Alice in Age Group Pre-K"Step 4: Zero code changes
Section titled “Step 4: Zero code changes”Adding a new school type (e.g., “martial-arts”) requires:
- One profile definition (20 lines)
- One terminology entry per term (16 lines)
- One strategy mapping (2 lines)
- Zero changes to flows, routes, or services
The 5 School Types
Section titled “The 5 School Types”| Type | Scheduling | Theme | Unique Feature |
|---|---|---|---|
| k12 | Fixed Timetable | Teal | Departments, streams, workflow |
| dance | Time Slots | Rose | Drop-in classes, flexible timing |
| music | Appointments | Indigo | 1-on-1 instrument lessons |
| kindergarten | Activity Blocks | Green | Age groups, no formal grading |
| tutoring | Flexible Slots | Slate | Any-window booking, per-session fees |
Why “Profile-Derived”?
Section titled “Why “Profile-Derived”?”The profile is the single source of truth. It’s not a configuration file that’s read once — it’s the context that every layer uses to make decisions at runtime.
Profile → Module registry → "Is attendance enabled?" → YES/NOProfile → Strategy bridge → "Which scheduler?" → time-slotsProfile → Term resolver → "What's a Student called?" → DancerProfile → Theme tokens → "What color?" → roseNo if/switch on schoolType anywhere in the codebase. The profile drives behavior through registries and mappings.