- Make sure you are using node version 10
- Install the packages:
$ npm install
- Create a .env file:
$ cp .env.example .env
- Start coding! and the webpack dev server with live reload, for windows, mac, linux or Gitpod:
$ npm run start
This boilerplate comes with a centralized general Context API. The file ./src/js/store/flux.js
has a base structure for the store.
React Context docs
The Provider
is already set. You can consume from any component using the useContext hook to get the store
and actions
from the Context.
import { Context } from "../store/appContext";
const MyComponentSuper = () => {
//here you use useContext to get store and actions
const { store, actions } = useContext(Context);
return <div>{/* you can use your actions or store inside the html */}</div>
}
- Vercel: The FREE recomended hosting provider is vercel.com, you can deploy in 1 minutes by typing the following 2 commands:
Login (you need to have an account):
$ npm i vercel -g && vercel login
Deploy:
$ vercel --prod
✎ Note: If you don't have an account just go to vercel.com, create a account and come back here.
- Github Pages: This boilerplate is 100% compatible with the free github pages hosting. To publish your website you need to push your code to your github repository and run the following command after:
$ npm run deploy
Note: You will need to configure github pages for the branch gh-pages