{"message":"TestPoint2 Hono backend ready","stats":{"users":66,"tests":6,"subjects":46,"questions":2463},"endpoints":[{"method":"GET","path":"/api/public/tests","auth":false,"description":"List all tests along with their grouped subjects.","category":"public","response":"Array of tests with nested subjects."},{"method":"GET","path":"/api/public/subjects","auth":false,"description":"List all subjects in the system.","category":"public","response":"Array of all subjects."},{"method":"GET","path":"/api/public/subjects/:testId","auth":false,"description":"List subjects filtered by a specific test ID.","category":"public","params":{"testId":"number (e.g. 1)"},"response":"Array of subjects belonging to the test."},{"method":"GET","path":"/api/public/exam/start/:subjectId","auth":false,"description":"Start an exam for a subject. Returns a set of randomized questions (30 or 100 for mock exam).","category":"public","params":{"subjectId":"number (e.g. 5)"},"response":"Array of questions with randomized options (without marking correct index directly)."},{"method":"GET","path":"/api/public/comments/:page","auth":false,"description":"Get comments and discussions posted on a specific page.","category":"public","params":{"page":"string (e.g. \"hec-usat\")"},"response":"Array of comment objects."},{"method":"POST","path":"/api/public/comments","auth":false,"description":"Submit a new comment or reply to an existing one.","category":"public","body":{"page":"string (e.g. \"hec-usat\")","comment_text":"string","parent_id":"number | null (optional)","user_name":"string (optional)","user_email":"string (optional)"},"response":"{ message: string, comment: Comment }"},{"method":"POST","path":"/api/public/contact","auth":false,"description":"Submit a message via the Contact Us form.","category":"public","body":{"name":"string","email":"string","message":"string"},"response":"{ message: string, contact: Contact }"},{"method":"POST","path":"/api/signup","auth":false,"description":"Register a new student account.","category":"auth","body":{"name":"string","email":"string (must be unique)","password":"string (min length 8)","avatar":"string (optional, e.g. \"boy1\", \"girl2\")"},"response":"{ access_token: string, token_type: \"Bearer\", user: User }"},{"method":"POST","path":"/api/login","auth":false,"description":"Authenticate user credentials and receive a token.","category":"auth","body":{"email":"string","password":"string"},"response":"{ access_token: string, token_type: \"Bearer\", user: User }"},{"method":"POST","path":"/api/logout","auth":true,"description":"Revoke and destroy the active API session token.","category":"auth","response":"{ message: string }"},{"method":"GET","path":"/api/user","auth":true,"description":"Retrieve details of the currently authenticated user.","category":"user","response":"{ id, name, email, role, avatar, ... }"},{"method":"GET","path":"/api/dashboard","auth":true,"description":"Get authenticated user dashboard stats (tests list, past exam results history).","category":"user","response":"{ tests: Array, results: Array }"},{"method":"GET","path":"/api/exam/take/:subjectId","auth":true,"description":"Begin a new exam or resume an existing ongoing exam for a subject.","category":"exam","params":{"subjectId":"number"},"response":"{ exam: Exam, questions: Array }"},{"method":"POST","path":"/api/exam/submit/:examId","auth":true,"description":"Submit candidate answers for scoring and finalization.","category":"exam","params":{"examId":"number"},"body":{"answers":"object mapping questionId -> selectedOptionId (e.g. { \"101\": 402, \"102\": 405 })"},"response":"{ message: string, score: number, total_points: number, exam_id: number }"},{"method":"GET","path":"/api/exam/result/:examId","auth":true,"description":"Fetch detailed results, stats, and correct answers for a completed exam.","category":"exam","params":{"examId":"number"},"response":"{ exam: Exam, answers: Array }"},{"method":"POST","path":"/api/public/exam/save-result","auth":true,"description":"Save exam result directly (used for quick guest exams saved to user account).","category":"exam","body":{"subject_id":"number","score":"number"},"response":"{ message: string, exam: Exam }"},{"method":"GET","path":"/api/admin/dashboard","auth":true,"admin":true,"description":"Fetch key stats for the Admin dashboard home.","category":"admin","response":"{ stats: { tests, subjects, questions, users } }"},{"method":"GET","path":"/api/admin/management","auth":true,"admin":true,"description":"Get detailed counts of all operational resources (tests, subjects, questions, users, comments, contacts).","category":"admin","response":"{ stats: { tests, subjects, questions, users, comments, contacts } }"},{"method":"POST","path":"/api/admin/test","auth":true,"admin":true,"description":"Create a new test category.","category":"admin","body":{"name":"string (e.g. \"MDCAT\")","duration":"number (minutes, e.g. 150)","pass_percentage":"number (e.g. 50)"},"response":"{ message: string, test: Test }"},{"method":"PUT","path":"/api/admin/test/:id","auth":true,"admin":true,"description":"Update test configuration details.","category":"admin","params":{"id":"number"},"body":{"name":"string","duration":"number","pass_percentage":"number"},"response":"{ message: string, test: Test }"},{"method":"DELETE","path":"/api/admin/test/:id","auth":true,"admin":true,"description":"Delete a test and all associated subjects/questions/exams.","category":"admin","params":{"id":"number"},"response":"{ message: string }"},{"method":"POST","path":"/api/admin/subject","auth":true,"admin":true,"description":"Create a subject under a test.","category":"admin","body":{"test_id":"number","name":"string"},"response":"{ message: string, subject: Subject }"},{"method":"PUT","path":"/api/admin/subject/:id","auth":true,"admin":true,"description":"Update a subject name.","category":"admin","params":{"id":"number"},"body":{"name":"string"},"response":"{ message: string, subject: Subject }"},{"method":"DELETE","path":"/api/admin/subject/:id","auth":true,"admin":true,"description":"Delete a subject and its questions.","category":"admin","params":{"id":"number"},"response":"{ message: string }"},{"method":"POST","path":"/api/admin/question","auth":true,"admin":true,"description":"Create a question with options.","category":"admin","body":{"subject_id":"number","question_text":"string","points":"number"},"response":"{ message: string, question: Question }"},{"method":"PUT","path":"/api/admin/question/:id","auth":true,"admin":true,"description":"Update a question.","category":"admin","params":{"id":"number"},"body":{"question_text":"string","points":"number"},"response":"{ message: string, question: Question }"},{"method":"DELETE","path":"/api/admin/question/:id","auth":true,"admin":true,"description":"Delete a question.","category":"admin","params":{"id":"number"},"response":"{ message: string }"},{"method":"GET","path":"/api/admin/users","auth":true,"admin":true,"description":"List all registered users.","category":"admin","response":"{ users: User[] }"},{"method":"POST","path":"/api/admin/user","auth":true,"admin":true,"description":"Create a new user manually.","category":"admin","body":{"name":"string","email":"string","password":"string","role":"string (\"admin\" or \"user\")","avatar":"string"},"response":"{ message: string, user: User }"},{"method":"PUT","path":"/api/admin/user/:id","auth":true,"admin":true,"description":"Update user info (name, email, role, avatar).","category":"admin","params":{"id":"number"},"body":{"name":"string","email":"string","role":"string","avatar":"string"},"response":"{ message: string, user: User }"},{"method":"DELETE","path":"/api/admin/user/:id","auth":true,"admin":true,"description":"Delete a user.","category":"admin","params":{"id":"number"},"response":"{ message: string }"},{"method":"GET","path":"/api/admin/comments","auth":true,"admin":true,"description":"List all comments in the system.","category":"admin","response":"{ comments: Comment[] }"},{"method":"POST","path":"/api/admin/comments/:commentId/reply","auth":true,"admin":true,"description":"Post an admin reply to a comment.","category":"admin","params":{"commentId":"number"},"body":{"comment_text":"string"},"response":"{ message: string, reply: Comment }"},{"method":"DELETE","path":"/api/admin/comments/:commentId","auth":true,"admin":true,"description":"Delete a comment.","category":"admin","params":{"commentId":"number"},"response":"{ message: string }"},{"method":"GET","path":"/api/admin/contacts","auth":true,"admin":true,"description":"List all contact messages.","category":"admin","response":"{ contacts: Contact[] }"},{"method":"POST","path":"/api/admin/contacts/:contactId/reply","auth":true,"admin":true,"description":"Record an admin reply to a contact form message.","category":"admin","params":{"contactId":"number"},"body":{"reply":"string"},"response":"{ message: string, contact: Contact }"},{"method":"DELETE","path":"/api/admin/contacts/:contactId","auth":true,"admin":true,"description":"Delete a contact message record.","category":"admin","params":{"contactId":"number"},"response":"{ message: string }"},{"method":"POST","path":"/api/admin/seed","auth":false,"description":"Seed dynamic test/demo data (warning: overwrites or adds new records).","category":"admin","body":{"force":"boolean (optional)","perSubject":"number (optional)"},"response":"{ message: string, counts: object }"}]}