This is a simple API that allows admins to manage a list of student, create courses and assign students to courses. Students can also sign up when there assist to a course.
npm install
npx prisma generate --schema=src/prisma/schema.prisma
dumps/dump1.sql
DATABASE_URL=mysql://root:root@localhost:8889/web_sign
MY_UNIQUE_SALT=BlQWa1y5PbbOmxqy68dpXPOlbJV
JWT_SECRET=dsjkgfhseughezugbezvbez
npm run dev
npm run build
npm start
/login
- params:
{
"email": "email.exemple@gmail.com",
"password": "password"
}
you must use the response token as Bearer Token for authentificate (if role: true -> admin; false -> student)
- admin:
{
"email": "admin@admin.com",
"password": "azerty"
}
- student:
{
"email": "student@student.com",
"password": "azerty"
}
/admin/student
- params:
{
"email": "student.exemple@gmail.com",
"password": "password"
}
/admin/student
- params:
{
"email": "admin.exemple@gmail.com",
"password": "password"
}
/admin/course
- params:
{
"title": "course title",
"date": "2028-07-30T18:00:00.000Z (dateTime format)",
"userIds": [5, 6, 11]
}
/admin/course
(id is the courses id)
/admin/student-courses/:id
/admin/students
/admin/admin
/admin/user
/admin/user/:id
/student/sign/id_course
/student/courses
/student/current-courses