E commerce app
Front-end application based on React + NextJS + TypeScript + Apollo Server + Material UI
Installation guide
1. Install dependencies
Run this command in order to install the dependencies
$ yarn
or alternatively...
$ npm install
.env
file
2. Create an Env variable | Description | Example |
---|---|---|
GRAPHQL_URL |
This is the endpoint to the GraphQL server. | GRAPHQL_URL=http://localhost:4000/ |
3. Run the application
This next command will start a server by default on port 3000
$ npm run dev
Rendering order. Understanding the resolution order of the Next.js application
These are the running orders, depending who is rendering the application.
On the server:
- app.getInitialProps
- page.getInitialProps
- document.getInitialProps
- app.render
- page.render
- document.render
On the server with error:
- document.getInitialProps
- app.render
- page.render
- document.render
On the client
- app.getInitialProps
- page.getInitialProps
- app.render
- page.render