boonya / backendless-apollo-client

How to do a Frontend Ahead of Backend demo project

Home Page:https://main--6419a8385ed98e10f7c94189.chromatic.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to do a FrontEnd ahead of BackEnd

Problematic

Everybody would like to make the code clear, nice and stable, without being under pressure and not to hurry. But in the real world, business wants us to deliver features as soon as possible.

Because of this we have to figure out how to speed up the development process. One of the most obvious ways would be to start development of FrontEnd in parallel with BackEnd. Or even earlier. But how to do that especially if you need to implement a complex page which is going to interact with the API in many different ways?

So, here I would try to show you the receipt I used for more than a year and I am still happy about it.

Ingredients

  • React - as the root of everything with it's awesome context API. You may love it or hate it, but you know what it is for sure.
  • @apollo/client - which is a GraphQL client and state management library.
  • or @tanstack/react-query as an alternative.
  • Storybook - A thing that gives us a power to build UIs in isolation.
  • Mock Service Worker - The library helps us to mock an API by intercepting requests on the network level.
  • Jest - Just a Testing Framework of choice.
  • React Testing Library - Helps us to test UI components in a user-centric way.
  • @testing-library/jest-dom - a set of custom DOM element matchers for Jest just to make your life a bit easier.

The Plan

We are going to create a Single Page Application.

  • On the main page of it some github repo brief information are going to be shown.
  • As well here will be a button to show list of issues from the same github repo.
  • Each issue data are going to be presented by a separate route.
  • We will be able to react on each issue or undo our reaction.

The goal

I want to show every component of application to be working without being connected to real backend. And then we will connect it smoothly.

Funny picture "When frontend is ready before backend"


Misc

If you want to play with this application on your machine, you have to create your local .env file and fill it out with actual secrets. Also do not forget to run nvm use command to apply appropriate node and npm versions and then install dependencies by npm i.

cp .env.sample .env

GitHub GraphQL API

About

How to do a Frontend Ahead of Backend demo project

https://main--6419a8385ed98e10f7c94189.chromatic.com/

License:MIT License


Languages

Language:JavaScript 96.5%Language:CSS 2.6%Language:HTML 0.9%