Coder Social home page Coder Social logo

wallacesat / starwars-front-api Goto Github PK

View Code? Open in Web Editor NEW
5.0 0.0 1.0 17.33 MB

A ReactJS application that consumes a dummy data API in the development environment and a real API in the production environment

JavaScript 7.56% HTML 92.42% CSS 0.02%
front-end reactjs api-rest jest coverage-report continuous-integration axios redux expressjs react-router-v4

starwars-front-api's Introduction

Starwars front-end API

A simple web application that makes use of a fictional Star Wars data api and displays them on screen, sorting them into a table according to the selected category, these categories being people, spaceships, planets and vehicles.

Getting started

In your prefer local path:
  • git clone https://github.com/wallacesat/Starwars-front-api
  • cd Starwars-front-api
  • yarn install
  • yarn start

If you prefer, use npm instead of yarn

After the server starts successfully, you can make requests to the end points of this api.

NOTE

You will need internet access, because even if the API is running locally, the data collection is stored in an online database.

Getting tested

In your local path project:
  • yarn test
  • then press 'a' key to test all components

If you prefer, use npm instead of yarn

The test result will be printed on the terminal as the example below:

Coverage

When running the test a code coverage report will be generated.

To view this report, simply go to the root of the project and open the file 'jest_html_reporters.html' in your browser.

The detailed coverage report will be displayed as the example below:

Continuous integration

The continuous integration of this application was accomplished through the bitbucket pipeline. Where a battery of automated unit tests runs, and if all tests pass, the application deploy is approved and done automatically.

You can see below a part of the pipeline history generated by bitbucket right after the automated tests run:

''

And to make sure everything went as expected, below you can view the log of the hosting Firebase, the successful deployment was automatically:

''

Frameworks

To handle HTTP browser requests.

In this application this module was used for the implementation of the tables.

For managing internal navigation, between the pages of this application.

For centralization and management of application state.

For management of routing system, routes, HTTP requests and responses.

For multiplatform environment variable definition.

To enable the execution of multiple scripts. This allows two applications to be started in parallel.

Fake API and Database

For simulating an API with fake data. Enables front-end development without prior access to a real API.

To generate the random data that will compose the api fake database.

To color the words printed on the terminal output.

Test tools

To perform unit testing of application components.

For the simulation of the states and returns of attributes and properties of components, thus enabling the unit test on each component separately, detaching them from the dependencies of other isolated components.

To perform the tests on the components linked to the application store, which in this case is managed by Redux.

To simulate the return of HTTP requests, manipulating the data and status, thus enabling the test alone in the components that perform this type of request.

Languages

License

MIT © wallacesat

starwars-front-api's People

Contributors

dependabot[bot] avatar wallacesat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Forkers

jamescellsct

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.