EduCrudApi
CRUD JSON API over the existing Edu SQL Server tables. All responses are JSON; there is no XML formatter.
Authentication
Students sign in against tbl_student and receive a JSON Web Token. Send it on
later requests as Authorization: Bearer <token>.
| POST | /api/auth/login | Body {"identifier":"…","password":"…"}, where identifier is the student's email or phone (email and phone also work as field names). Returns the token, its expiry and the student. 401 on any failure. |
| GET | /api/auth/me | The signed-in student, re-read from the database. Requires a token. |
| POST | /api/auth/change-password | Body {"currentPassword":"…","newPassword":"…"}. Stores the new password BCrypt-hashed. Requires a token. 204 on success. |
Every resource route below requires a token. Without one they answer
401. Only POST /api/auth/login and this page are anonymous.
Any signed-in student may read and write every table — there is no per-role
restriction yet.
Resources
Each resource below supports the same five operations, where {id} is the row's integer key.
| Resource | Collection | Filters on GET (collection) |
|---|---|---|
| Courses | /api/courses | branchId, departId, q |
| Chapters | /api/chapters | courseId, semId, subjectId, departmentId |
| Videos | /api/videos | courseId, semId, subjectId, chapterId, vType |
| PDFs | /api/pdfs | courseId, semId, subjectId, chapterId |
| Students | /api/students | department, course, flag, q |
| Student courses | /api/studentcourses | studId, courseId, subjectId, classId, status |
Operations
| GET | /api/{resource} | List rows. Paging: skip (default 0), take (default 100, max 500). |
| GET | /api/{resource}/{id} | One row, or 404. |
| POST | /api/{resource} | Insert. 201 with a Location header. |
| PUT | /api/{resource}/{id} | Update. |
| DELETE | /api/{resource}/{id} | Delete. |
Extras
- GET
/api/students/{id}/courses— the courses one student is enrolled in.