Giter Site home page Giter Site logo

nveobono / santatecla-listados-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codeurjc-daw-2018-19/santatecla-listados-1

0.0 2.0 0.0 8.29 MB

License: Apache License 2.0

JavaScript 13.04% TypeScript 8.06% HTML 14.48% CSS 52.10% PureBasic 0.01% Java 12.26% Dockerfile 0.01% Shell 0.05%

santatecla-listados-1's Introduction

santatecla-listados-1

VIDEO

https://www.youtube.com/watch?v=YpddcBuo2FY&feature=youtu.be

PHASE 0

APP Name

AULA VIRTUAL - MOODDLE

Group members

Name and Surname Mail Github
Hector Mediero de la Morena [email protected] HectorM15
Ana Álvarez Ortiz [email protected] ana11alvarez
Aitana Cerezo Camino [email protected] Aitanaceca
Sandra Cañadas Gómez [email protected] sandra1012
Ernesto Baltasar Nve Obono [email protected] nveobono

Auxiliary tools

TRELLO

Bibliography

  1. Github

  2. Best practices GitHub

  3. Good commit messages

  4. Trello

  5. New tolls,forums and features Github

PHASE 1

Screenshots

Login: It is a view, where the user's login is required. There are three login options: through Facebook, twitter or Google, by using email and password or in guest / visitor mode. Depending on the type of user, it takes us to the corresponding main view type.

login

Teacher Started View: In this view, the topics and concepts appear, and the option to delete or add them, which only appear if you have logged in as a teacher. There is also a button to see a diagram with progress, another to return to start and another to close the session. We also add the option to search, to access a topic or concept faster.

started view teacher

Student / Visitor Started View: In this view, we only have the reading mode of the topics and concepts because the session has been logged as a student or visitor. In the started view of the student or visitor mode, we also find the start button, the diagrams button, the log out button and the search option.

started view student

Teacher Concept View: In this view we have two tables, one with already corrected items, where the correct or incorrect option is already checked and there is also the option to delete. In the second table we have uncorrected answers where there are two options per answer to mark if it is correct or incorrect. Below the first table, we have a button to add items, where a pop up appears. And in the upper right corner we have the option of log out.

concept teacher concept teacher 2

Student / Visitor Concept View: In this view we have a table with two parts: corrected questions and questions to be corrected. The corrected questions appear with a tick or with a cross depending on whether the question is correct or not. Below is an icon of a sum, to add an item, and the button of diagrams, where we have used a modal to have a pop up where we can see the progress once we have data. Finally, in the upper right corner, we have the option of log out.

concept student

Questions: It is a view to add questions, where in each type of question there is a generate button to create the dialogue of the question of that type.

questions

Navigation diagrams

diagrama de navegacion

Bibliography

  1. Página principal
  2. Demo
  3. Repositorio GitHub para descargar
  4. Documentación:
  5. Echarts

PHASE 2

Navigation diagrams

diagrama de navegacion

screenshots

Login: login

Main Page Teacher : mainpage teacher1 mainpage teacher2

Main Page Student: mainpage student1 mainpage student4

Main Page Visitor: mainpage visitante1

Sign in: sign in

Teacher concept view: concept teacher

Student concept view: concept s

Add question: generar

Development environment

To begin with we had to decide what environment we wanted to use. In our case it was INTELLIJ. The configuration of the environment was not very laborious, since it has a spring initializer, which creates the project with the dependencies that you mark (mustache, security ....). Once this was done we decided that the first step was to connect to the database, download MYSQL Workbench to put it to work and MYSQLServer to manage a server on localhost. The sentences introduced in our case can be found in the aplication.properties:

spring.jpa.hibernate.ddl-auto = create-drop spring.datasource.url = jdbc: mysql: // localhost: 3306 / daw_group9? useSSL = false & useLegacyDatetimeCode = false & serverTimezone = UTC spring.datasource.username = Group9 spring.datasource.password = URJCDAWGrupo9 server.port = 8443 server.ssl.key-store = classpath: keystore.jks server.ssl.key-store-password = password server.ssl.key-password = secret

spring.http.multipart.max-file-size = 10MB spring.http.multipart.max-request-size = 10MB

Once connected to the environment we had to familiarize ourselves with the tags @ Entity, @ ManyToOne .... And so we finally managed to create a DB according to our requirements.

Entity diagram

diagrama de clases bbdd

The database is composed of the following entities:Answer, Concept, Question, Item, User and Lesson. Each of the entities has a series of field, as we can see in the photo

Association relations:

  • Answer with Question

Composition relations:

  • Lesson with Concept
  • User with Answer
  • Concept with Question
  • Concept with Item

Class diagram and templates

Complete diagram, all classes and relationshp:

diagrama de clases y templates

Since there are so many classes and relationships, the diagram looks very bad, so we have summarized the diagram as follows:

diagrama de clases y templates1

We use the MVC architecture patter( Model-View-Controller).

MODEL:

  • @Service
  • Repository
  • @Entity
  • @Component
  • @Configuration

CONTROLLER

  • @Controller
  • @SpringBootApplication

VIEW

  • Templates
  • Error

All entities and all repositories have a composition relationship with DatabaseInitializer.

Diagrama model1

Diagrama model2

@Service

  • ItemService has an association relationship with Concept
  • AnswerService has an association relationship with: Question and User
  • ConceptService
  • LessonService
  • QuestionService

Repository (Interface)

  • LessonRepository
  • QuestionRepository has an association relationship with Concept
  • AnswerRepository has an association relationship with: Question and User
  • UserRepository
  • ConceptRepository
  • ItemRepository has an association relationship with Concept

@Entity: Concept, Question, Answer, Item, User and Lesson. The relationships between them are the same as the picture of the entity diagram

@Component

  • DatabaseInitializer
  • AuthenticationProviderUser has an association relationship with: UserComponent, UserRepository and User.
  • UserComponent

@Configuration: CSRFHandlerConfiguration and SecurityConfiguration

Diagrama view

Error

  • 403
  • 404
  • 500

Templates

  • StartedView_Visitor
  • header
  • StartedView_Teacher
  • footer
  • Items
  • TeacherConcept_View has an association relationship with: header and footer
  • MainPageStudent
  • MainPageTeacher
  • StudentConceptView has an association relationship with: header and footer
  • MainPage
  • ModalMainPage
  • Sign_in has an association relationship with: footer and header
  • Login has an association relationship with: footer and header
  • lesson
  • addnewQuestion

Diagrama controller

Controller y Model1

Model y Controller2

Model y Controller3

View y Controller

@Controller

  • QuestionController has an association relationship with: QuestionService, Concept, ConceptService, ItemService, Item, Question, StudentConceptView, TeacherConcept_View and addnewQuestions.
  • AnswerController has an association relationship with: Answer, AnswerService, Question, QUestionService, UserComponent and TeacherConcept_View
  • ConceptController has an association relationship with: Concept, ConceptRepository, ConceptService, ItemRepository, LessonService, QuestionRepository, AnswerRepository, UserRepository, Lesson and MainPage
  • IndexController has an association relationship with: UserRepository and login
  • ItemController has an association relationship with: Concept, ConceptService, Item, ItemRepository, ItemService, QuestionRepository, TeacherConcept_View and Items
  • LessonController has an association relationship with: Lesson, LessonService, UserComponent, MainPage and lesson
  • MainController has an association relationship with: AnswerRepository, Concept, ConceptRepository, ConceptService, ItemRepository, ItemSrvice, LessonService, Question, QuestionRepository, User, UserComponent, UserRepository, QuestionService, Answer, AnswerService, StudentConceptView, sign_in, login, TeacherConcept_View, addnewQuestion and MainPage

@SpringBootApplication

  • DawApplication

All classes and all views have a composition relationship with DawApplication.

Bibliography

PHASE 3

API REST Documentation

All URLs begin with: https://localhost:8443

ANSWER

The format of the answer URLs is: /api/answer

For each operation the format changes, words or parameters are added

Operations:

GET

  • Get Answer: /{id}
  • Get Answer by User: /user/{idUser}
  • Get Answer by Question: /concept/{idConcept}

POST

  • Create Answer: /{idQuestion}
  • Correct Answer 1: /sendAnswerTypeOne/{idQuestion}
  • Correct Answer 2: /sendAnswerTypeTwo/{idQuestion}/{ret}/{total}

Below we can see the format of the input and output information:

Captura de pantalla 2019-03-10 a las 18 53 58

Captura de pantalla 2019-03-10 a las 18 54 13

Captura de pantalla 2019-03-11 a las 00 25 34

CONCEPT

The format of the answer URLs is: /api/concept

For each operation the format changes, words or parameters are added

Operations:

GET

  • Get Concept: /{id}
  • Get Concepts by Id Lesson: /lesson/{idLesson}

POST

  • Create Concept: /lesson/{idLesson}. If we add to the URL: /?page=0&size=10, we get the pagination
  • Upload image: /image/{id} to accese to image uploaded is with https://loacalhost/uploads/{filename}

DELETE

  • Delete Concept: /{id}

Below we can see the format of the input and output information:

Captura de pantalla 2019-03-10 a las 14 53 08

Captura de pantalla 2019-03-10 a las 14 53 16

Captura de pantalla 2019-03-11 a las 00 29 18

EXAMPLE UPDATING AND SEEING IMAGE imageuploads

SeeImage

ITEMS

The format of the answer URLs is: /api/items

For each operation the format changes, words or parameters are added

Operations:

GET

  • Get item: /{id}
  • Get Items by Concept: /concept/{idConcept}

POST

  • Create Item: /concept/{idConcept}

DELETE

  • Delete item: /{id}

Below we can see the format of the input and output information:

Captura de pantalla 2019-03-10 a las 18 55 10

Captura de pantalla 2019-03-10 a las 18 55 29

LESSON

The format of the answer URLs is: /api/lesson

For each operation the format changes, words or parameters are added

Operations:

GET

  • Show lessons: /pag. If we add to the URL: /?page=1&size=10, we get the pagination
  • Show lesson: /{id}

POST

  • Create Lesson: /

DELETE

  • Delete lesson: /{id}

Below we can see the format of the input and output information:

Lesson-1

Lesson-2

QUESTION

The format of the answer URLs is: /api/question

For each operation the format changes, words or parameters are added

Operations:

GET

  • Get Question: /{id}

POST

  • Create Question: /concept/{idConcept}

DELETE

  • Delete Question: /{id}

Below we can see the format of the input and output information:

Question-1

USER

The format of the answer URLs is: /api/user

For each operation the format changes, words or parameters are added

Operations:

GET

  • Login: /login
  • Logout: /logout
  • Get User by name: /{name}

POST

  • Register: /register

Below we can see the format of the input and output information:

User-1

User-2

Class diagram updates

In the following image we can see the diagram of classes and templates summarized and updated:

Diagrama de clases y templates1

As we can see, the classes @RestController and @ControllerAdvice have been added. These classes are part of the Controller.

New classes:

Diagrama model1

Diagrama model2

MODEL: @Service

  • UploadFileServiceImpli

Repository (Interface)

  • IUploadFileService

@Configuration

  • MvcConfig
  • SecurityApiRest
  • JsonAdapterWithPageable

Diagrama controller

All classes and all views have a composition relationship with DawApplication.

Controller y Model1

Model y Controller2

Model y Controller3

CONTROLLER: @RestController

  • ConceptRest has an association relationship with: Concept, Question, Item, Lesson, UploadFileServiceImpli, LessonService and ConceptService
  • QuestionRest has an association relationship with: Concept, Question, Item, Answer, ConceptService and QuestionService
  • ItemRest has an association relationship with: Concept, Question, Item, ConceptService and ItemService
  • AnswerRest has an association relationship with: Question, Answer, User, UserComponent, ConceptService, QuestionService and AnswerService
  • LessonsRest has an association relationship with: Concept, Lesson and LessonService
  • UserRest has an association relationship with: User, UserService and UserComponent

Diagrama controller1

All @RestController inherit from class OperationsRest

  • OperationsRest

@ControllerAdvice

  • RestControllerExceptionHandler

Dockerized application execution instructions

First of all we're going to explain the configuration files and scripts we have. -Dockerfile: File for building the app image. -docker-compose.yml: Here we definied the two services that we have used, database(daw_grupo9) and app (daw). -syncWithDB.sh: The funcionality of this file is sync up the app with the database. -create_image.sh: This script is responsible for creating the app image, build and push to the DockerHub. The database image is the mysql official image we have in DockerHub.

Run the dockerized application - Terminal

  1. Execute the script: sh create_image.sh

  2. Start docker-compose: docker-compose up If we want execute it in background we need to use the command: docker-compose up -d (Deamon mode)

Preparation of development environment

We use IntelliJ IDEA Ultimate and Docker-Desktop. When we created the configuration files (Dockerfile and docker-compose.yml), IntelliJ detected it automatically, we didn't have to install any plugin.

Run the dockerized application - IntelliJ

  1. Edit Configuration: In Run / Debug we have a Docker section, here we can choose between docker, docker image and docker compose, last one is the option we choose for this project.
  2. Settings Server Docker: In this step, we have to edit some fields with the next information: Server: Docker Compose file: ./docker-compose.yml;
  3. Run: Now we can run the application as we normally do, but before check if we have selected docker-compose.yml as chosen application.

Thing to keep in mind: If we use some script in our configuration files we have to give the corresponding permissions to IntelliJ for executing it.

Bibliography

PHASE 4

Preparation of development environment

Before starting download Node.js (JavaScript runtime).

We start with an existing angular application, from the main menu we import the project and then we install the dependencies, for this, we write in the terminal 'npm install'.

Run: To execute our application we follow the following steps: Run - Edit configurations ... - + - npm. In package.json we look for where that file is and in Scripts we put 'start', we give Apply and OK and then run, we wait for it to compile and we can open our browser with http://localhost:4200/. In order to see all the data in our database, we have to execute the spring project and then the angular one, because each one was in a project.

Once we had the application ready, we added it to the spring project, so that it works we have to compile it in a different way. Let's go to the intellij IDEA terminal, write 'cd ng' and then 'npm install'. To execute our application we follow the following steps: Run - Edit configurations ... - + - npm. In package.json we look for where that file is and in Scripts we put 'build', we give Apply and OK and then run, we wait for it to compile.

After this a folder called dist is created inside ng and within dist the my-app folder, the files that are generated in this folder after the build must be moved to the project folder Daw/src/main/resources/static/new. Once we have this done we start spring, to see the angular application we open our browser and we put https://localhost:8443/new/.

Run with Docker: For the dockerized execution we have made a script with the following steps: 1.We build and start the docker container with nodejs, through its console, in it we execute the commands build and install. 2.Once we have the files of the build, we copy them in the folder src / resources / static / new /. 3.Then we made through a container with maven and alpine the construction of the jar of our application.

Finally we execute the command "docker-compose up" to execute the application linked to the database with its corresponding synchronization. Once the application has been started, we can access the traditional application through the URL https://localhost:8080/ and the angular application through the URL https://localhost:8080/new/.

Class diagram and templates

In the following image we can see the diagram of classes and templates:

Diagrama de clases y templates angular

We use the MVC architecture patter( Model-View-Controller).

MODEL:

Colour - Green

  • answer.model.ts
  • concept.model.ts
  • item.model.ts
  • lesson.model.ts
  • page.concept.ts
  • page.item.ts
  • page.lesson.ts
  • question.model.ts
  • user.model.ts

Colour - Yellow

  • answer-service.ts
  • concept-service.ts
  • item-service.ts
  • lesson-service.ts
  • question-service.ts
  • user-service.ts

Colour - Pink

  • error.interceptor.ts

CONTROLLER

Colour - Blue

  • mainpage.component.ts
  • student-concept-view.component.ts
  • teacher-concept-view.component.ts
  • app.component.ts
  • login.component.ts
  • app.routing.ts
  • app.module.ts

VIEW

Colour - Purple

  • mainpage.component.html
  • student-concept-view.component.html
  • teacher-concept-view.component.html
  • app.component.html
  • index.html
  • login.component.html

RELATIONS

  • answer.model.ts has an association relationship with: user.model.ts and question.model.ts
  • user.model.ts has an association relationship with: answer.model.ts
  • question.model.ts has an association relationship with: concept.model.ts and answer.model.ts
  • page.lesson.ts has an association relationship with: lesson.model.ts
  • lesson.model.ts has an association relationship with: concept.model.ts
  • concept.model.ts has an association relationship with: question.model.ts
  • page.concept.ts has an association relationship with: concept.model.ts
  • item.model.ts
  • page.item.ts has an association relationship with: item.model.ts
  • item-service.ts has an association relationship with: item.model.ts
  • answer-service.ts has an association relationship with: answer.model.ts
  • concept-service.ts has an association relationship with: concept.model.ts
  • lesson-service.ts has an association relationship with: lesson.model.ts
  • question-service.ts has an association relationship with: question.model.ts
  • login.service.ts has an association relationship with: user.model.ts
  • user-service.ts
  • config.service.ts
  • login.component.html
  • app.component.html
  • mainpage.component.html
  • teacher-concept-view.component.html
  • student-concept-view.component.html
  • login.component.ts has an association relationship with: login.service.ts and user.model.ts
  • app.component.ts
  • mainpage.component.ts has an association relationship with: concept.model.ts, concept-service.ts, page.concept.ts, item-service.ts, lesson.model.ts, question.model.ts, item.model.ts, page.item.ts, login.service.ts
  • teacher-concept-view.component.ts has an association relationship with: page.item.ts, item.model.ts, item-service.ts, login.service.ts, answer.model.ts, answer-service.ts and concept-service.ts
  • student-concept-view.component.ts has an association relationship with: login.service.ts, question-service.ts, question.model.ts, answer.model.ts, answer-service.ts, concept-service.ts, concept.model.ts and page.concept.ts
  • app.module.ts has an association relationship with: all component and service
  • app.routing.ts has an association relationship with: teacher-concept-view.component.ts, student-concept-view.component.ts, mainpage.component.ts, mainpage.component.html, teacher-concept-view.component.html and student-concept-view.component.html
  • error.interceptor has an association relationship with: login.service.ts

Bibliography

santatecla-listados-1's People

Contributors

ana11alvarez avatar nveobono avatar sandra1012 avatar aitanaceca avatar hectorm15 avatar micaelgallego avatar

Watchers

James Cloos avatar  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.