Skip to content

m-Vins/Exam-Web-App-I

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exam #1: "StudyPlan"

Student: s294999 MEZZELA VINCENZO

React Client Application Routes

  • Route /:
    • if logged in : personal home page with the list of all the university courses and the studyplan (if any). Here the student can create/edit/delete the studyplan.
    • not logged in : home page with the list of all the university courses.
  • Route /login: Here the user can login.
  • Route *: Default route.

API Server

  • GET /api/courses

    • Get the list of all the university courses .

    • Response body contains the list of all the courses :

      [
        {
          code: "02GOLOV",
          name: "Architetture dei sistemi di elaborazione",
          credits: 12,
          preparatoryCourse: null,
          maxStudentsNumber: null,
          incompatibleCourses: ["02LSEOV"],
          currentStudentsNumber: 1,
        },
        ...
      ];
      
      
  • GET /api/studyplans

    • Get the studyplan of the logged-in student.
    • Response body contains information about the studyplan of the logged-in student :
      {
        option: "part-time",
        courses: ["01UDFOV", "03UEWOV", "01URROV", "01OTWOV", "01NYHOV"],
      }
      
  • POST /api/studyplans

    • Save the studyplan for the logged-in student.
    • Request body contains information about the new studyplan :
      {
        option: "part-time",
        courses: ["01UDFOV", "03UEWOV", "01URROV", "01OTWOV", "01NYHOV"],
      }
      
  • DELETE /api/studyplans

    • Delete the studyplan of the logged-in student.
  • GET /api/sessions/current

    • Get the information about the logged-in student.
    • Response body contains :
      { id: 1, username: "[email protected]" }
      
  • POST /api/sessions

    • Student log in.
    • Request body contains login information:
      { username: "[email protected]", password: "password" }
      
    • Resonse body contains user information:
      { id: 1, username: "[email protected]" }
      
  • DELETE /api/sessions/current

    • Student log out.

Database Tables

COURSES

This table stores the informations about all the courses.

code, name, credits, preparatoryCourse, maxStudentsNumber

STUDENTS

This table stores the informations about all the students and their studyplan option.

id, username, salt, hash, studyplan

STUDYPLANS

This table stores the all the courses codes of each student studyplan.

studentID, courseID

INCOMPATIBLECOURSES

This table stores the pairs of incompatible courses.

code_1, code_2

Legend

primary key, not null fields, optional fields

Main React Components

  • LogInForm (in LoginFormCompontents.js) : It is a simple form to handle the login.
  • NavbarComponent (in NavbarComponents.js) : It is a simple Navbar. it display the App name on the left, which is also clickable, and some other buttons (Login, Logout, Create Study Plan, ...) depending on the props passed to the component.
  • CourseTable (in TableComponents.js) : It is a course table, used both for the full courses list and for the studyplan. Its rendering depends on the props it receives, since this component is used for different purpose. It can expand a row to show other course info, also there can be different button to properly handle the editing of the studyplan, and finally course that cannot be added to/removed from the studyplan are marked with an red exclamation mark, and the reason is shown passing the mouse over.
  • DefaultRoute (in ViewRoutes.js) : It is the Component for the default page.
  • HomeRoute (in ViewRoutes.js) : It is the Component for the not logged-in home page with the list of all the university courses.
  • PersonalHome (in PersonalHomeComponents.js) : It is the component for logged-in home page. Here it is shown the list of all the university courses and the studyplan (if any). It also handle the studyplan with functions saveStudyplan,createStudyplan,deleteStudyplan,getStudyplan.

Screenshot

Home page

Users Credentials

Username Password Studyplan
[email protected] password part-time
[email protected] password full-time
[email protected] password full-time
[email protected] password part-time
[email protected] password

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published