Giter Site home page Giter Site logo

zoanlogia / p9-front-end-dashboard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openclassrooms-student-center/p9-front-end-dashboard

0.0 0.0 0.0 48 KB

Code for project 9 of the front-end path: a sports analytics dashboard.

JavaScript 99.13% Dockerfile 0.87%

p9-front-end-dashboard's Introduction

Project 9 - Front-end Dashboard

This repo contains all the source code to run the micro API for the sports analytics dashboard SportSee.

1. General information

To start this project, you are free to use Docker or not. In this documentation, we will see several methods to launch the project easily.

2. Project (without Docker)

2.1 Prerequisites

If you are working with several versions of NodeJS, we recommend you install nvm. This tool will allow you to easily manage your NodeJS versions.

2.2 Launching the project

  • Fork the repository
  • Clone it on your computer.
  • The yarn command will allow you to install the dependencies.
  • The yarn dev command will allow you to run the micro API.

3. Project (with Docker)

2.1 Prerequisites

2.2 Starting the project

  • The docker image build --no-cache -t micro-api . command will allow you to build your image.
  • The docker container run --name micro-api -p 3000:3000 -dt micro-api yarn command will allow you to create your Docker container and run your image on port 3000.
  • The docker container stop micro-api command will allow you to stop your micro-api.
  • The docker container rm micro-api command will allow you to delete your micro-api container.

2.3 Vscode and container remotes

Finally, if you have VsCode, you can easily launch your project in a docker environment.

You will need the Remote Development extension. Once you have this extension installed, just click on the Reopen in Container button.

Once in the container, run the yarn dev command.

4. Endpoints

4.1 Possible endpoints

This project includes four endpoints that you will be able to use:

  • http://localhost:3000/user/${userId} - retrieves information from a user. This first endpoint includes the user id, user information (first name, last name and age), the current day's score (todayScore) and key data (calorie, macronutrient, etc.).
  • http://localhost:3000/user/${userId}/activity - retrieves a user's activity day by day with kilograms and calories.
  • http://localhost:3000/user/${userId}/average-sessions - retrieves the average sessions of a user per day. The week starts on Monday.
  • http://localhost:3000/user/${userId}/performance - retrieves a user's performance (energy, endurance, etc.).

Warning, currently only two users have been mocked. They have userId 12 and 18 respectively.

4.2 Examples of queries

  • http://localhost:3000/user/12/performance - Retrieves the performance of the user with id 12
  • http://localhost:3000/user/18 - Retrieves user 18's main information.

p9-front-end-dashboard's People

Contributors

tdimnet avatar nicolaspatschkowski avatar ccorazza-opc 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.