Commit Graph

35 Commits

Author SHA1 Message Date
c809d049fe feat: certificate page for print, API certificate data, AI prompts for full lessons
- Certificate: page /certificate/[courseId] with print-friendly design, GET /certificates/:courseId/data
- Buttons 'Получить сертификат' open certificate page instead of data-URL
- AI: prompts for longer courses (more chapters/lessons), full detailed lesson content with examples (1000–1500+ words)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 11:32:58 +00:00
5241144bc5 feat: AI quiz generation per lesson + hide edit buttons for non-authors
- Generate unique quiz for each lesson using OpenRouter API
- Parse lesson content (TipTap JSON) and send to AI for question generation
- Cache quiz in database to avoid regeneration
- Hide Edit/Delete buttons if current user is not course author
- Add backendUser to auth context for proper authorization checks
- Show certificate button prominently when course is completed

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 11:04:37 +00:00
f39680d714 feat: AI-powered quiz generation with caching
- Add Quiz model to store generated questions in DB
- Integrate OpenRouter API to generate quiz from lesson content
- Cache quiz results to avoid regenerating on every request
- Extract text from TipTap JSON and send to AI
- Fallback to default questions if AI fails or no API key

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 10:58:15 +00:00
bed7e440c1 fix: useState hook error in catalog + add certificate download in learning page
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 10:55:24 +00:00
5ddb3db1ac feat: add certificates, groups, support system, and moderation
Backend changes:
- Add Certificate generation service with beautiful HTML templates
- Add CourseGroup, GroupMember, GroupMessage models for group collaboration
- Add Homework and HomeworkSubmission models with AI + teacher grading
- Add SupportTicket and TicketMessage models for help desk
- Add Moderation API for admin/moderator course approval workflow
- All new modules: CertificatesModule, GroupsModule, SupportModule, ModerationModule

Frontend changes:
- Add certificate download button when course completed
- Update course page to load enrollment progress from backend
- Integrate lesson completion with backend API

Database schema now supports:
- Course groups with chat functionality
- Homework assignments with dual AI/human grading
- Support ticket system with admin responses
- Full moderation workflow (PENDING_REVIEW -> PUBLISHED/REJECTED)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 10:50:04 +00:00
2ed65f5678 feat: add course catalog, enrollment, progress tracking, quizzes, and reviews
Backend changes:
- Add Enrollment and LessonProgress models to track user progress
- Add UserRole enum (USER, MODERATOR, ADMIN)
- Add course verification and moderation fields
- New CatalogModule: public course browsing, publishing, verification
- New EnrollmentModule: enroll, progress tracking, quiz submission, reviews
- Add quiz generation endpoint to LessonsController

Frontend changes:
- Redesign course viewer: proper course UI with lesson navigation, progress bar
- Add beautiful typography styles for course content (prose-course)
- Fix first-login bug with token exchange retry logic
- New pages: /catalog (public courses), /catalog/[id] (course details), /learning (enrollments)
- Add LessonQuiz component with scoring and results
- Update sidebar navigation: add Catalog and My Learning links
- Add publish/verify buttons in course editor
- Integrate enrollment progress tracking with backend

All courses now support: sequential progression, quiz tests, reviews, ratings,
author verification badges, and full marketplace publishing workflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 10:44:05 +00:00
dab726e8d1 fix: add openssl to ai-service and fix its DATABASE_URL for Docker
- Dockerfile.ai: install openssl (required by Prisma native engine)
- docker-compose.yml: set DATABASE_URL to postgres:5432 instead of
  localhost, add postgres healthcheck dependency

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 10:11:42 +00:00
dd7c0afaf5 fix: add globalEnv to turbo.json to fix stale rewrite cache in Docker builds
Without explicit globalEnv, Turborepo could cache Next.js builds
with wrong INTERNAL_API_URL, causing web container to proxy to
127.0.0.1 instead of the Docker service name.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 10:01:30 +00:00
a7fce5396d 123 2026-02-06 12:42:51 +03:00
af5f80c688 123 2026-02-06 12:35:32 +03:00
b42a1dfd16 123 2026-02-06 12:28:32 +03:00
6d96372682 update 2026-02-06 12:15:43 +03:00
d654b1ffc8 123 2026-02-06 12:00:44 +03:00
fd7bf76abd 123 2026-02-06 11:52:30 +03:00
1812de0baf 123 2026-02-06 03:40:46 +03:00
2b6b9f3f29 123 2026-02-06 03:37:31 +03:00
7027d3a3c6 123 2026-02-06 03:32:29 +03:00
7bb41caabb 123 2026-02-06 03:30:56 +03:00
c8032823fa 123 2026-02-06 03:26:24 +03:00
9e5e9ddca4 123 2026-02-06 02:55:46 +03:00
bbb453826b 123 2026-02-06 02:52:33 +03:00
7de2c33bfe 123
123
2026-02-06 02:50:44 +03:00
e15ca974fe 123 2026-02-06 02:46:55 +03:00
147d993a05 123 2026-02-06 02:43:00 +03:00
f9d26a41d1 123 2026-02-06 02:41:41 +03:00
ba2ff52394 123 2026-02-06 02:38:32 +03:00
d87d57ab3c 123 2026-02-06 02:36:02 +03:00
8f38e4bbac 123 2026-02-06 02:35:10 +03:00
8f32a138c8 123 2026-02-06 02:34:16 +03:00
34d158d496 123 2026-02-06 02:32:37 +03:00
43fb94c8bc 123 2026-02-06 02:30:37 +03:00
85e1120dd5 123 2026-02-06 02:29:51 +03:00
24e1b8a708 123 2026-02-06 02:28:38 +03:00
6ccdef56d3 123 2026-02-06 02:23:48 +03:00
b9d9b9ed17 project init 2026-02-06 02:17:59 +03:00