diff --git a/.babelrc b/.babelrc
new file mode 100644
index 0000000..0b4f7b4
--- /dev/null
+++ b/.babelrc
@@ -0,0 +1,7 @@
+{
+ "env": {
+ "production": {
+ "plugins": ["transform-remove-console"]
+ }
+ }
+}
\ No newline at end of file
diff --git a/.eslintrc b/.eslintrc
new file mode 100644
index 0000000..4bed466
--- /dev/null
+++ b/.eslintrc
@@ -0,0 +1,3 @@
+{
+ "extends": "react-app"
+}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..a173bd5
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,5 @@
+# Changelog
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+## 0.1.0 (2021-06-11)
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..949fcc2
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 Lam Pham
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/README.md b/README.md
index 89b278a..00360da 100644
--- a/README.md
+++ b/README.md
@@ -1,68 +1,35 @@
-This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
+[](https://app.netlify.com/sites/react-app-template/deploys) [](https://opensource.org/licenses/MIT)
-## Available Scripts
+# react-app-template
-In the project directory, you can run:
+A template for react app using create-react-app and some customizations.
-### `yarn start`
+## Installation
-Runs the app in the development mode.
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
+```bash
+git clone https://github.com/completejavascript/react-app-template.git YourProjectName # Clone the project
+cd YourProjectname
+rm -rf .git # So you can have your own changes stored in VCS.
+yarn # Install dependencies
+yarn start # Start development
+```
-The page will reload if you make edits.
-You will also see any lint errors in the console.
+Navigate to localhost:3000.
-### `yarn test`
+## Features
-Launches the test runner in the interactive watch mode.
-See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
+- Style React component with [SASS](https://sass-lang.com/)
+- Use [customize-cra](https://github.com/arackaf/customize-cra) to customize CRA without **eject**.
+- Use [hookrouter](https://github.com/Paratron/hookrouter) - the flexible, and fast router for react that is entirely based on hooks - for using router faster.
+- Use [react-intl](https://github.com/formatjs/react-intl) to internationalize React apps.
+- Use [react-redux](https://react-redux.js.org/) to manage App state.
+- Use [js-cookie](https://github.com/js-cookie/js-cookie) for handling browser cookies.
+- Use [axios](https://github.com/axios/axios) for HTTP requests.
-### `yarn build`
+## Author
-Builds the app for production to the `build` folder.
-It correctly bundles React in production mode and optimizes the build for the best performance.
+- [Lam Pham](http://about.phamvanlam.com)
-The build is minified and the filenames include the hashes.
-Your app is ready to be deployed!
+## License
-See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
-
-### `yarn eject`
-
-**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
-
-If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
-
-Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
-
-You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
-
-## Learn More
-
-You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
-
-To learn React, check out the [React documentation](https://reactjs.org/).
-
-### Code Splitting
-
-This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
-
-### Analyzing the Bundle Size
-
-This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
-
-### Making a Progressive Web App
-
-This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
-
-### Advanced Configuration
-
-This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
-
-### Deployment
-
-This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
-
-### `yarn build` fails to minify
-
-This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
+This project is open source and available under the [MIT License](https://github.com/completejavascript/react-app-template/blob/master/LICENSE).
diff --git a/config-overrides.js b/config-overrides.js
new file mode 100644
index 0000000..3d7f5df
--- /dev/null
+++ b/config-overrides.js
@@ -0,0 +1,3 @@
+const { useBabelRc, useEslintRc, override } = require('customize-cra');
+
+module.exports = override(useBabelRc(), useEslintRc());
diff --git a/netlify.toml b/netlify.toml
new file mode 100644
index 0000000..2eb2e04
--- /dev/null
+++ b/netlify.toml
@@ -0,0 +1,11 @@
+[build]
+ publish = "build"
+ command = "yarn run build"
+
+[[redirects]]
+ from = "/*"
+ to = "/index.html"
+ status = 200
+
+[build.environment]
+ YARN_VERSION = "1.21.0"
diff --git a/package.json b/package.json
index dd40257..b4743c8 100644
--- a/package.json
+++ b/package.json
@@ -1,21 +1,48 @@
{
"name": "react-app-template",
+ "description": "Template for react app using create-react-app and some customizations.",
"version": "0.1.0",
- "private": true,
+ "author": "Lam Pham ",
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
- "node-sass": "^4.13.0",
+ "axios": "^0.21.1",
+ "babel-plugin-transform-remove-console": "^6.9.4",
+ "customize-cra": "^0.9.1",
+ "hookrouter": "^1.2.3",
+ "js-cookie": "^2.2.1",
+ "node-sass": "^4.13.1",
"react": "^16.12.0",
+ "react-app-rewired": "^2.1.5",
"react-dom": "^16.12.0",
- "react-scripts": "3.3.0"
+ "react-intl": "^3.11.0",
+ "react-redux": "^7.1.3",
+ "react-scripts": "3.3.0",
+ "redux": "^4.0.5",
+ "redux-thunk": "^2.3.0"
},
+ "keywords": [
+ "react",
+ "react-js",
+ "customize-cra",
+ "react app template",
+ "sass",
+ "hookrouter",
+ "react intl",
+ "react redux",
+ "js-cookie",
+ "axios"
+ ],
+ "license": "MIT",
+ "main": "n/a",
"scripts": {
- "start": "react-scripts start",
- "build": "react-scripts build",
- "test": "react-scripts test",
- "eject": "react-scripts eject"
+ "start": "react-app-rewired start",
+ "build": "react-app-rewired build",
+ "test": "react-app-rewired test",
+ "eject": "react-scripts eject",
+ "first-release": "standard-version --first-release",
+ "prerelease": "standard-version"
},
"eslintConfig": {
"extends": "react-app"
@@ -31,5 +58,9 @@
"last 1 firefox version",
"last 1 safari version"
]
+ },
+ "devDependencies": {
+ "redux-devtools-extension": "^2.13.8",
+ "standard-version": "^9.3.0"
}
}
diff --git a/public/index.html b/public/index.html
index aa069f2..5a896f4 100644
--- a/public/index.html
+++ b/public/index.html
@@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
- React App
+ React App Template
diff --git a/src/App.js b/src/App.js
index 596f78f..0b77566 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,26 +1,30 @@
import React from 'react';
-import logo from './logo.svg';
+import { connect } from 'react-redux';
+import { useRoutes } from 'hookrouter';
+import { IntlProvider } from 'react-intl';
+import en from './translations/en.json';
+import vi from './translations/vi.json';
+import routes from './router';
+import NoPageFound from './pages/NoPageFound/NoPageFound';
import './App.scss';
-function App() {
+const messages = { en, vi };
+
+const App = props => {
+ console.log('This console will be remove in Production mode');
+ const routeResult = useRoutes(routes);
+ const language = props.languageTrans;
+
return (
-