Giter VIP home page Giter VIP logo

esame-pianodistudi's Introduction

Exam #1: Piano di studi

Student: s305535 SANTO LORENZO

React Client Application Routes

  • Route /: Questa è la route principale. Al suo interno vi è la visualizzazione dei diversi componenti gestita in maniera dinamica attraverso l'utilizzo degli stati
  • Route /login: Attraverso questa route gli studenti non autenticati possono accedere alla loro pagina personale. All'interno vi è un form contenente due campi obbligatori come username e password. Verificata la correttezza delle credenziali si torna alla route /

API Server

  • POST /api/sessions Richiesta Login

    • request body content:
    {
      "email": "[email protected]",
      "password": "password"
    }
    
    • Response : 401 Not authenticated.
  • GET /api/sessions/current Recupera la sessione di uno studente

{
    "id": 3,
    "username": "[email protected]",
    "name": "test"
}
  • Response : 200 OK 401 Not authenticated.

  • DELETE /api/sessions/current Elimina la sessione di uno studente

    • Response : 200 OK (success).
  • GET /api/courses Ritorna tutta la lista dei corsi

    • response body content:
    [
      {
          "id": "01UDFOV",
          "name": "Applicazioni Web I",
          "credits": 6,
          "num_students": 1,
          "max_num_students": null,
          "prerequisite": null,
          "course_incompatible": "01TXYOV"
      },
      {
          "code": "02GOLOV",
          "name": "Architetture dei sistemi di elaborazione",
          "credits": 12,
          "num_students": 1,
          "max_num_students": null,
          "prerequisite": null,
          "course_incompatible": "02LSEOV"
      },
    ...
    ]
    
    • Response : 500 Internal Server Error (generic error).
  • GET /api/plan Ritorna il piano di studi di uno studente

    • response body content:
    [
      {
          "id": "01UDFOV",
          "name": "Applicazioni Web I",
          "credits": 20,
          "prerequisite": null,
          "credit": 6,
      },
    ...
    ]
    
    • Response : 500 Internal Server Error (generic error).
  • GET /api/getNumberOfStudent Ritorna il numero di studenti di uno specifico corso

    • response body content:
    [
      {
          "id": "01UDFOV",
          "num_students": "3",
      },
    ...
    ]
    
    • Response : 500 Internal Server Error (generic error).
  • GET /api/getTypePlanStudent Ritorna il tipo di piano di uno studente

    • response body content:
      {
          "type": "Part-Time",
      }
    
    • Response : 500 Internal Server Error (generic error).
  • GET /api/constraint/:code Ritorna propedeuticità e incompatibilità del corso

    • request boy content: code
    • response body content:
      {
          "course_incompatible": "",
          "prerequisite": "",
      }
    
    • Response : 500 Internal Server Error (generic error).
  • POST /api/plan Controllo vincoli e aggiunta nel db del piano di studi

    • request body content:
     [
       {
          "id": "02GOLOV",
          "name": "Architetture dei sistemi di elaborazione",
          "credits": "12",
          "prerequisite": "null",
          "typePlan": "Full-Time",
          "numStudent": "1",
          "max_num_student": "3",
       }
     ]
    
    • Response : 201 OK (success), 422 (validation error), 500 Internal Server Error (generic error).
  • POST /api/typePlan Viene aggiunto il tipo di piano nella tabella PLan

    • request body content:
    {
          "id": "1",
          "typePlan": "Part-Time",
    }
    
    • Response : 201 OK (success), 422 (validation error), 503 Database Error (generic error).
  • DELETE /api/deleteCourses Elimina i corsi associati ad uno specifico studente

    • Response : 204 OK (success), 503 Database Error (generic error).
  • DELETE /api/deletePlan Elimina il piano di studi di uno studente

    • Response : 204 OK (success), 503 Database Error (generic error).

Database Tables

  • Table course - contiene la lista dei corsi con gli attributi: id, name, credits, num_students, max_num_students, prerequisite
  • Table course_has_student - contiene i corsi che lo studente sceglie. Attributi: id_course, id_student
  • Table incompatibility - contiene le incompatibilità per ogni corso. Attributi: id, course_incompatible, id_course
  • Table plan - contiene il tipo di piano scelto dallo studente. Attributi: id_plan, type, id_student
  • Table students - contiene tutti gli studenti. Attributi: id, email, name, hash, salt

Main React Components

  • CourseTableComp (in CourseTableComp.js): componente principale con lo scopo di visualizzare l'intera lista dei corsi. Contiene inoltre i controlli dei vincoli (fatti per marcare la riga della tabella in maniera differente)
  • CourseItemComp (in CourseItemComp.js): deriva dal componente descritto sopra. In particolare, questo componente si occupa di visualizzare le righe della tabella e di marcare una riga in base al risultato ottenuto dai controlli dei vincoli nel componente sopra
  • AddPlanComp (in AddPlanComp.js): si occupa dell'aggiunta di un nuovo piano. Viene mostrata la lista dei corsi che uno studente ha selezionato dall'intera lista dei corsi
  • ModifyStudyPlanComp (in ModifyStudyPlanComp.js): si occupa della modifica del piano. Viene mostrata la lista dei corsi che lo studente ha nel piano con la possibilità di eliminare o aggiungere corsi a esso.
  • StudyPlanTableComp (in StudyPlanTableComp.js): contiene il piano di studio dello studente a seguito di aggiunta o modifica. Se non esiste il piano viene mostrato un messaggio per segnalare che nessun piano è compilato

(only main components, minor ones may be skipped)

Screenshot

Screenshot

Users Credentials

esame-pianodistudi's People

Contributors

darxsky avatar

Stargazers

Alessio Carachino avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.