ডকুমেন্টেশনAPI ডকুমেন্টেশন
মনচিত্র প্রজেক্ট গাইড

API ডকুমেন্টেশন

সংস্করণযুক্ত request/response contract, authentication সীমা, validation ও error behavior।

API JSON

Catalog ও content endpoint

RouteRequestResponse / নিয়ম
GET /api/booksclass, medium, subject, q, cursorপ্রকাশিত বইয়ের summary; filter যাচাই
GET /api/books/:bookIdbookId UUID বা slugবই metadata ও দৃশ্যমান chapter list
GET /api/chapters/:chapterIdchapterIdChapter metadata ও page index
GET /api/pages/:pageIdpageId, localeselectable text node ও licensed asset URL

শিক্ষার্থী data endpoint

RouteAccessValidation
POST /api/annotationsauthenticated ownerZod schema, page scope, kind/color allowlist, length limit
GET /api/annotationsauthenticated ownerpage/book filter auth.uid()-এ সীমাবদ্ধ
GET /api/questions/:chapterIdPublic active quiz বা authenticated learnersubmit-এর আগে answer key নয়
POST /api/quiz/submitauthenticated learnerসীমিত answer, এক attempt ID, server score, idempotency
GET /api/student/progressauthenticated student বা অনুমোদিত guardian summaryclient থেকে arbitrary userId গ্রহণ নয়

AI, auth ও subscription endpoint

RouteRequest / responseনিরাপত্তা
POST /api/auth/registerEmail, password, nickname, age/consent metadata; confirmation statusrate limit; account enumeration প্রতিরোধ; password log নয়
POST /api/ai/explainselected text, question, locale, chapter referenceserver-only Gateway, prompt limit, PII নয়, age-aware output filter
POST /api/subscriptionsplan ID ও idempotency key; pending intent ফেরত

Request ও response উদাহরণ

  • ভুল UUID, অজানা question ID, duplicate answer key, non-integer index ও অতিরিক্ত payload প্রত্যাখ্যান করুন।
  • স্থায়ী error code ও localized UI message দিন; SQL, provider বা raw auth error প্রকাশ করবেন না।
JSON contract http
POST /api/quiz/submit
Authorization: Bearer <access-token>
Idempotency-Key: 84a0...
Content-Type: application/json

{
  "chapterId": "chapter-10-motion",
  "answers": { "question-1": 0, "question-2": 2 }
}

200 OK
{
  "attemptId": "uuid",
  "score": 1,
  "total": 2,
  "review": [{ "questionId": "question-1", "correct": true }]
}

বাস্তবায়ন অবস্থা

  • বর্তমান route browser demo; উপরের অধিকাংশ REST contract নির্দিষ্ট, কিন্তু এখনো বাস্তবায়িত নয়।
  • authenticated ও unauthorized user দিয়ে deploy/test না করা পর্যন্ত endpoint live বলবেন না।
  • external client access-এর আগে pagination, rate limit, versioning ও deprecation নথিভুক্ত করুন।