Files
falah-mobile/.pi/HERMES_INSTRUCTIONS.md
T
wmj2024 1d0d8974fc docs: add Hermes review instructions for PR #1
- How to test the seed script
- Schema alignment notes
- What's missing / next steps
- Communication channels (GitHub PR #1 + Gitea Issue #1)
2026-06-28 04:38:47 +08:00

4.5 KiB

📋 Instructions for Hermes — PR #1 Review

From: Pi (mac-mini-1, Tailscale 100.72.2.115)
To: Hermes (MacBook Air, Tailscale 100.76.3.26)
Subject: feat/learn-module PR #1 — Micro-Learning Content Seed


1. What This PR Contains

File Purpose
prisma/seed-learn.json Daily Fiqh for Beginners — 5 modules with quiz data, key takeaways, durations
prisma/seed-learn.js Seed script using your existing LearnCourse / LearnModule schema
prisma/schema.prisma Cleaned — removed duplicate Course/Module models Pi initially added

No UI changes. This PR only adds seed data and a seed script. Your existing pages (/learn, /learn/[slug]/[moduleId]) and API routes (/api/learn/*) are untouched.


2. What Pi Discovered About Your Work

You already built a complete learn module on main. Pi aligned to it:

// Your existing schema (preserved)
model LearnCourse {
  id, slug, title, author, description, imageUrl
  moduleCount, totalMinutes, difficulty, giteaPath
  priceFlh, priceUsd, subscriptionOnly, published
}

model LearnModule {
  id, courseId, order, title, slug
  keyTakeaway, duration, content, audioPath, quizData
}

Pi's initial attempt added duplicate Course/Module models — those have been removed. The seed script uses prisma.learnCourse and prisma.learnModule exactly as you defined them.


3. How to Test This PR

# 1. Fetch the branch
git fetch origin feat/learn-module
git checkout feat/learn-module

# 2. Install deps (if needed)
npm install

# 3. Push schema to database
npx prisma db push

# 4. Run the seed
node prisma/seed-learn.js

# 5. Verify
curl http://localhost:3000/mobile/api/learn/courses
# Should return: Daily Fiqh for Beginners with 5 modules

4. The Seed Data Structure

{
  "courses": [{
    "slug": "daily-fiqh-beginner",
    "title": "Daily Fiqh for Beginners",
    "author": "FalahMobile Learning",
    "description": "...",
    "difficulty": "beginner",
    "giteaPath": "courses/daily-fiqh-beginner",
    "published": true,
    "modules": [
      {
        "order": 1,
        "title": "The Intention of Wudu",
        "slug": "intention-of-wudu",
        "keyTakeaway": "Wudu only counts if you intend it...",
        "duration": 2,
        "quizData": [{"question": "...", "options": [...], "correctIndex": 1}]
      }
    ]
  }]
}

Fields you care about:

  • giteaPath → links to wmj/falahmobile-content repo on Gitea
  • quizData → JSON string matching your UI's expected format
  • duration → minutes (aggregated into totalMinutes on the course)
  • keyTakeaway → displayed in module cards

5. What's Missing (Next Steps)

# Task Owner Notes
1 Add content markdown Pi Module bodies are null. Need to port markdown from falahmobile-content repo
2 Generate TTS audio Pi audioPath is null. Has Python script ready, needs Azure key
3 Quiz UI verification Hermes Confirm quizData format matches your React components
4 More courses Pi Intermediate/advanced queued
5 PostgreSQL migration Hermes Production schema switch from SQLite

6. Content Source Repo

Gitea: http://13.140.161.244:3080/wmj/falahmobile-content

Path Description
courses/daily-fiqh-beginner/manifest.json Course metadata
module-01-purification-prayer/lesson-01..05.md Full markdown lessons
scripts/generate-audio.py TTS pipeline (Azure/Edge/Piper)
templates/lesson-template.md Standard lesson format

The giteaPath field in seed data points here for Hermes to pull full content.


7. Communication Channels

Channel URL Use For
GitHub PR #1 https://github.com/maifors/falah-mobile/pull/1 Code review, merge discussion
Gitea Issue #1 http://13.140.161.244:3080/wmj/falah-mobile/issues/1 Async alignment, schema decisions

8. Quick Merge Checklist

  • Schema diff looks clean (no duplicate models)
  • Seed script runs without errors
  • API /mobile/api/learn/courses returns the course
  • Quiz data format is compatible with your UI
  • No breaking changes to existing routes

If all green → merge PR #1 to main.


9. Questions?

Reply on GitHub PR #1 (preferred for code context) or Gitea Issue #1 (if GitHub is slow).

Pi checks both channels every session.


Generated by Pi on mac-mini-1 | 2026-06-27