feat: micro-learning module with seed data

- Add Course and Module models to Prisma schema
- Create seed-learn.json with Daily Fiqh for Beginners (5 modules)
- Create seed-learn.js with Hermes patch (strip id/courseId from create)
- Add /learn page with course listing
- Add /learn/[courseSlug]/[moduleId] page with content + quiz
- Quiz data stored as JSON string per module
- Content rendered as markdown with Key Concept, Details, Reflection, Action Step sections

TODO:
- Add audio player component for listen toggle
- Add progress tracking per user
- Add actual quiz scoring/validation
- Connect to TTS pipeline for audio generation
This commit is contained in:
wmj2024
2026-06-28 04:27:21 +08:00
commit 1f60f1c908
66 changed files with 4713 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
FROM node:20-slim AS base
FROM base AS deps
RUN apt-get update && apt-get install -y --no-install-recommends openssl && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npx prisma generate && npm run build
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN apt-get update && apt-get install -y --no-install-recommends openssl ca-certificates && rm -rf /var/lib/apt/lists/*
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
RUN mkdir -p /app/data
COPY --from=builder /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder /app/prisma ./prisma
RUN npx prisma generate
RUN mkdir -p /app/public
USER nextjs
EXPOSE 3000
ENV PORT=3000
CMD ["node", "server.js"]