{"openapi":"3.0.0","info":{"version":"0.0.1","title":"3dinsights LMS","description":"API for managing an LMS with integrated 3D Model Interaction"},"servers":[{"url":"https://virtserver.swaggerhub.com/ErasmusEObeth/3dinsights/0.0.1","description":"SwaggerHub API Auto Mocking"}],"tags":[{"name":"Users","description":"Operations related to user management, authentication, and roles."},{"name":"Courses","description":"Operations related to course management and enrollments."},{"name":"Assessments","description":"Operations related to course assessments."},{"name":"Discussions","description":"Operations related to discussion rooms and chat messages."},{"name":"Resources","description":"Operations related to course resources like PDFs, videos, and links."},{"name":"3D Models","description":"Operations related to 3D models used within courses."},{"name":"Progress","description":"Operations related to tracking user progress within courses."},{"name":"File Storage","description":"Operations related to file uploads and storage."}],"paths":{"/users":{"get":{"tags":["Users"],"summary":"Get all users","responses":{"200":{"description":"A list of users","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}}}},"post":{"tags":["Users"],"summary":"Create a new user","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"responses":{"201":{"description":"User created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}}}}},"/users/{userId}":{"get":{"tags":["Users"],"summary":"Get a user by ID","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The user data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}}}},"put":{"tags":["Users"],"summary":"Update a user by ID","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"responses":{"200":{"description":"User updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}}}},"delete":{"tags":["Users"],"summary":"Delete a user by ID","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"User deleted"}}}},"/auth/login":{"post":{"tags":["Users"],"summary":"Log in a user","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthLogin"}}}},"responses":{"200":{"description":"User logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthToken"}}}}}}},"/auth/social-login":{"post":{"tags":["Users"],"summary":"Log in a user using social authentication","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialAuthLogin"}}}},"responses":{"200":{"description":"User logged in via social authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthToken"}}}}}}},"/courses":{"get":{"tags":["Courses"],"summary":"Get all courses","responses":{"200":{"description":"A list of courses","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Course"}}}}}}},"post":{"tags":["Courses"],"summary":"Create a new course","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course"}}}},"responses":{"201":{"description":"Course created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course"}}}}}}},"/courses/{courseId}":{"get":{"tags":["Courses"],"summary":"Get a course by ID","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The course data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course"}}}}}},"put":{"tags":["Courses"],"summary":"Update a course by ID","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course"}}}},"responses":{"200":{"description":"Course updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course"}}}}}},"delete":{"tags":["Courses"],"summary":"Delete a course by ID","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Course deleted"}}}},"/courses/{courseId}/users":{"get":{"tags":["Courses","Users"],"summary":"Get all users enrolled in a specific course","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"A list of enrolled users","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}}}}},"/courses/{courseId}/enroll":{"post":{"tags":["Courses","Users"],"summary":"Enroll a user in a course","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollRequest"}}}},"responses":{"201":{"description":"User enrolled in the course","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseEnrollment"}}}}}}},"/courses/{courseId}/resources":{"get":{"tags":["Courses","Resources"],"summary":"Get all resources for a specific course","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"A list of course resources","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Resource"}}}}}}},"post":{"tags":["Courses","Resources"],"summary":"Add a new resource to a course","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"}}}},"responses":{"201":{"description":"Resource added to the course","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"}}}}}}},"/courses/{courseId}/assessments":{"get":{"tags":["Courses","Assessments"],"summary":"Get all assessments for a specific course","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"A list of course assessments","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Assessment"}}}}}}},"post":{"tags":["Courses","Assessments"],"summary":"Add a new assessment to a course","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assessment"}}}},"responses":{"201":{"description":"Assessment added to the course","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assessment"}}}}}}},"/courses/{courseId}/discussions":{"get":{"tags":["Courses","Discussions"],"summary":"Get all discussion rooms for a specific course","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"A list of discussion rooms","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DiscussionRoom"}}}}}}},"post":{"tags":["Courses","Discussions"],"summary":"Create a new discussion room for a course","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscussionRoom"}}}},"responses":{"201":{"description":"Discussion room created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscussionRoom"}}}}}}},"/courses/{courseId}/discussions/{discussionId}/messages":{"get":{"tags":["Discussions"],"summary":"Get all messages in a discussion room","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}},{"name":"discussionId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"A list of discussion messages","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DiscussionMessage"}}}}}}},"post":{"tags":["Discussions"],"summary":"Add a new message to a discussion room","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}},{"name":"discussionId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscussionMessage"}}}},"responses":{"201":{"description":"Message added to the discussion room","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscussionMessage"}}}}}}},"/courses/{courseId}/progress":{"get":{"tags":["Courses","Progress"],"summary":"Get the progress of all users in a course","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"A list of user progress data","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Progress"}}}}}}}},"/courses/{courseId}/3dmodels":{"get":{"tags":["Courses","3D Models"],"summary":"Get all 3D models for a specific course","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"A list of 3D models","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/3DModel"}}}}}}},"post":{"tags":["Courses","3D Models"],"summary":"Add a new 3D model to a course","parameters":[{"name":"courseId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/3DModel"}}}},"responses":{"201":{"description":"3D model added to the course","content":{"application/json":{"schema":{"$ref":"#/components/schemas/3DModel"}}}}}}},"/files/upload":{"post":{"tags":["File Storage"],"summary":"Upload a file","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":"File uploaded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/File"}}}}}}}},"components":{"schemas":{"User":{"type":"object","properties":{"id":{"type":"integer"},"username":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"social_auth":{"type":"object","additionalProperties":true}}},"AuthLogin":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}}},"SocialAuthLogin":{"type":"object","properties":{"provider":{"type":"string"},"token":{"type":"string"}}},"AuthToken":{"type":"object","properties":{"token":{"type":"string"}}},"Course":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string"},"teacher_id":{"type":"integer"}}},"EnrollRequest":{"type":"object","properties":{"user_id":{"type":"integer"}}},"CourseEnrollment":{"type":"object","properties":{"user_id":{"type":"integer"},"course_id":{"type":"integer"}}},"Resource":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"type":{"type":"string"},"url":{"type":"string"},"course_id":{"type":"integer"}}},"Assessment":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"course_id":{"type":"integer"},"description":{"type":"string"},"due_date":{"type":"string","format":"date-time"}}},"DiscussionRoom":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"course_id":{"type":"integer"}}},"DiscussionMessage":{"type":"object","properties":{"id":{"type":"integer"},"discussion_id":{"type":"integer"},"user_id":{"type":"integer"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}}},"Progress":{"type":"object","properties":{"user_id":{"type":"integer"},"course_id":{"type":"integer"},"progress":{"type":"number","format":"float"}}},"3DModel":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"model_url":{"type":"string"},"course_id":{"type":"integer"}}},"File":{"type":"object","properties":{"id":{"type":"integer"},"file_url":{"type":"string"}}}}}}