Yamen Ahmad e70a2854f4 feat(frontend): Phase 2/3 hardening release
Roadmap P0
- Ship /logo.svg fallback and rewire asset references (superseded later by
  the project-manager PNG in a separate commit).

Roadmap P1
- Response envelope alignment ({items,total,page,size}) across services
  and query hooks.
- Approval/ticket UX updates tied to the new backend rollback semantics.

Roadmap P2
- React.lazy + Vite manualChunks to split vendor-radix/charts/icons/forms
  from the main bundle and cut initial JS.
- Fix the 181 tsc errors (PaginationParams class + per-service generics).
- Auto-refresh flow for JWT refresh tokens wired into api-client.ts.

Roadmap P3
- i18n: i18next + language detector, en/ar locales, RTL auto-switch,
  LanguageToggle component in RoleLayout and AdminLmsLayout.
- GDPR: PrivacyCenter page for data export and right-to-erasure, backed
  by gdpr.service.ts; logout via AuthContext after erasure.
- Human-in-the-loop exam review UI: admin ExamReviewQueue + ExamReviewDetail
  pages, useExamReview hooks, exam-review.service.ts.
- AI quality loop: AIPromptEditor (versioning + render preview),
  AIFeedbackButtons for students, AIFeedbackTriage admin page, dedicated
  services, hooks, and types.
- Dark mode: ThemeProvider + ThemeToggle + chart color tokens.
- Accessibility: DialogDescription on every DialogContent; alert-dialog
  and sheet updates.
- Retire dead pages: ExamPage marketing, Index, ProfilePage import.
- Playwright e2e scaffolding: playwright.config.ts + e2e/login.spec.ts
  smoke tests, npm scripts test:e2e / test:e2e:install.

Made-with: Cursor
2026-04-19 14:16:32 +04:00

EnCoach Backend v2 — Odoo 19 Adaptive Learning Platform

The Odoo 19 backend for the EnCoach adaptive learning and institutional LMS platform. Provides ~377 REST API endpoints serving a React 18 SPA frontend.

System Overview

Component Detail
Framework Odoo 19 Community Edition
Language Python 3.12+
Database PostgreSQL 16
LMS Foundation OpenEduCat Community (14 modules, ported to v19)
Custom Modules 27 encoach_* modules
AI/ML OpenAI GPT-4o, Whisper (local), AWS Polly, ELAI, GPTZero, FAISS
Authentication JWT (PyJWT)
Deployment Docker Compose

Module Architecture

new_project/
  custom_addons/           # 27 custom EnCoach modules
    encoach_api/           # REST API controllers (~120 routes)
    encoach_lms_api/       # OpenEduCat bridge API (~209 routes)
    encoach_adaptive_api/  # Adaptive learning API (~41 routes)
    encoach_resources/     # Resource library API (~7 routes)
    encoach_core/          # Users, entities, roles, permissions
    encoach_taxonomy/      # Subject > Domain > Topic taxonomy
    encoach_adaptive/      # Proficiency, learning plans, mastery
    encoach_adaptive_ai/   # AI for diagnostics, coaching, content
    encoach_exam/          # AI-powered exam engine
    encoach_ai/            # OpenAI service wrapper
    encoach_ai_generation/ # AI exam content generation
    encoach_ai_grading/    # AI grading (writing, speaking, math, IT)
    encoach_ai_media/      # TTS (Polly), STT (Whisper), ELAI avatars
    encoach_courseware/     # Chapters, materials, AI workbench
    encoach_communication/ # Discussion boards, announcements, messaging
    encoach_notification/  # Notification engine, rules, preferences
    encoach_faq/           # FAQ categories and items
    encoach_approval/      # Approval workflows, stages
    encoach_assignment/    # Exam-wrapper assignments
    encoach_classroom/     # Virtual classroom groups
    encoach_stats/         # Session tracking, statistics
    encoach_training/      # Training tips, walkthroughs, FAISS
    encoach_subscription/  # Packages, Stripe/PayPal/Paymob
    encoach_registration/  # User registration, batch import
    encoach_ticket/        # Support tickets
    encoach_sis/           # UTAS SIS integration
    encoach_branding/      # Whitelabeling
  openeducat_erp-19.0/     # 14 OpenEduCat community modules
    openeducat_core/       # Courses, batches, students, faculty
    openeducat_timetable/  # Timetable sessions
    openeducat_attendance/ # Attendance management
    openeducat_exam/       # Institutional exams, marksheets
    openeducat_assignment/ # Course assignments, submissions
    openeducat_admission/  # Admission registers, applications
    openeducat_classroom/  # Physical classrooms
    openeducat_facility/   # Facilities and assets
    openeducat_fees/       # Fee plans, student fees
    openeducat_library/    # Library media, movements, cards
    openeducat_activity/   # Student activities
    openeducat_parent/     # Parent-student relationships
    openeducat_erp/        # ERP connector
    theme_web_openeducat/  # Web theme

Staging

Service URL
Odoo Backend http://5.189.151.117:8069
React Frontend http://5.189.151.117:3000

Branching Workflow

This repo is connected to the staging server via a Git post-receive hook. All deployment is automatic after code review approval.

  1. Never push directly to main -- branch protection will block it.
  2. Push your changes to a feature branch (e.g. feature/full-backend-v1).
  3. Open a Pull Request on Gitea targeting main.
  4. Request review from devops (Talal).
  5. Once approved and merged, the staging server rebuilds and redeploys automatically.

The .env file is not committed. It lives only on the staging server at /opt/encoach/backend-v2/.env.

Local Development

Option A: Docker (easiest)

docker compose up -d

Open http://localhost:8069. First run: create a new database.

Stop: docker compose down

Option B: Source (venv + PostgreSQL)

Prerequisites: macOS, Homebrew, Python 3.11+, PostgreSQL 15+

brew install postgresql@15 wkhtmltopdf
brew services start postgresql@15
createuser -s $(whoami)

chmod +x setup.sh
./setup.sh
./run.sh

Open http://localhost:8069.

See MANUAL-RUN.md for step-by-step commands.

Document Description
ENCOACH_ODOO19_BACKEND_SRS.md Backend SRS v3.0 (definitive)
ENCOACH_UNIFIED_SRS.md Unified frontend + backend SRS v2.0
ENCOACH_PRODUCT_DESCRIPTION.md Non-technical product description
Description
No description provided
Readme 375 MiB
Languages
Python 70.8%
HTML 22.1%
JavaScript 3.9%
SCSS 2.1%
CSS 1.1%