Check other documentations here:
- React: To component-based web application
- React Helmet: To change the title when we change the page in Router
- React Hot Reload: To reload the changes in development without full page reload
- React Router: To manage multiple pages/routes of the application
- Redux: To managing global state in store
- Redux Devtools extension: To inspect all Redux behavior
- Redux Logger: To log our actions in the console
- Redux Thunk: To asynchronous operations in reducer
- CSS in JS: To style the components without CSS file
- Emotion: To style the components flexibly with
styled
or other ways styled-components
: To style the components withstyled
- Emotion: To style the components flexibly with
- Axios: To request/fetch data to/from the backend API server
bson-objectid
: To mock an ObjectID as dummy data purposedayjs
: To convert from any date to better formatted date- Draft.js: To make the
textarea
with WYSIWYG editor - Filestack: To upload and retrieve images
- JWT Decoder: To decode JWT that is saved in the browserStorage
Run the create-env.sh
script first, to copy .env.schema
into .env
.
./create-env.sh
Then you fill the env variables. To get the Filestack API Key, go to https://www.filestack.com then Sign Up Free for an account. After logged in, you can get your API Key.
After which, change your variable values.
REACT_APP_BACKEND_API_URL=http://localhost:0000
REACT_APP_FILESTACK_API_KEY=your_api_key_from_filestack_here
yarn start
Then open http://localhost:3000
.
This repo is configured to use react-app-rewired
, not a regular react-scripts
. The benefit is to hot reload the changes in the components quickly, without a full page reload.
yarn build
npm install -g serve
serve -s build
Then open http://localhost:5000
.
In deployment server such as Netlify, this build process should run automatically and the port is assigned by them (not 5000
).
You can use Netlify to deploy. After which, you have to configure the environment variables as well.
REACT_APP_BACKEND_API_URL=https://ideabyte.herokuapp.com
REACT_APP_FILESTACK_API_KEY=your_api_key_from_filestack_here
mkdir projectname-frontend
cd projectname-frontend
npm install -g create-react-app
create-react-app .
- Make sure the React app setup is done.
- Change the
title
inindex.html
- Delete all unnecessary contents and components
- Start your React server
- Commit and push your changes as necessary
- Deploy on Netlify
- Change the site name in site settings
- Example: ideabyte
- Make sure the web app deployed successfully
- Example: https://ideabyte.netlify.com
- Setup custom domain if needed
- Setup deploy contexts so it can check all branch deploys
- So in pull request, it automatically check the changes
- Setup prerendering
- Put all assets into
public
folder - Structure the
src
to be like:pages
: contains page namelayouts
: contains layout name, to be used withpages
components
: contains variety of components
- Install and use React Router
- Install and use styling package such as
styled-components
or@emotion/styled
- Implement all pages and components
- Make sure all pages are still accessible
- Install and use Redux and React Redux
MIT License