Giter Site home page Giter Site logo

code-challenge's Introduction

Code Challenge

Dependencias

  1. Jest para las pruebas de unidad.
    • npm install jest --save-dev
  2. ESLint para buscar y reparar problemas en el codigo.
    • npm install eslint --save-dev
    • npm init @eslint/config
  3. Express crea e inicia un servidor.
    • npm install express --save

Diseño

classDiagram
    Reader --* StudentController
    Student --* StudentController
    class Reader{
        +readJsonFile(filePath)
    }
    class Student{
        +getAllAboutAllStudents(students)
        +getAllEmailsWithCertification(students)
        +getAllStudentsWithCreditsGreaterThan(students, credit)
    }
    class StudentController{
        +getAllAboutAllStudents()
        +getAllEmailsWithCertification()
        +getAllStudentsWithCreditsGreaterThan500()
    }
Loading

Class Reader

Es la encargada de leer un archivo json, esta compuesta por un método estatico que recibe la ruta al archivo, para ser devuelto como un objeto de JavaScript.

Class Student

Representa a los estudiantes, se comporne de varios metodos estáticos que filtran y obtienen información sobre los estudiantes, esta información se recibe como parametro en forma de objeto de JavaScript, para este ejemplo se usa un archivo JSON pero se podria usar una base de datos.

Class StudentController

Actúa como intermediario entre la información que se tiene y la que se quiere mostrar, gestionando el flujo de información y las transformaciones para adaptar los datos a las necesidades de cada requerimiento.

API

Endpoint Request Response
localhost:3000/v1/students/ localhost:3000/v1/students/ Deberás obtener la lista de los estudiantes con todos sus campos.
localhost:3000/v1/students/emails localhost:3000/v1/students/emails Deberás obtener los emails de todos los estudiantes que tengan certificación haveCertification=true.
localhost:3000/v1/students/credits localhost:3000/v1/students/credits Deberás obtener la lista de los estudiantes que tengan credits mayor a 500

code-challenge's People

Contributors

louisemillan 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.