Next.js (12) Custom Server + React 17 + Redux + Redux Saga
This project helps you learn server side-side reactjs quickly, does not apply to people who have just learned Reactjs.
See more: https://nextjs.org/docs/getting-started
02/03/2022
28/12/2021
Just make sure that you reboot the server when updating .env file You can access your .env variables by deconstructing 'process.env' object, both on client and server Because when Next builded config will public and then dont write secret key in this file. you can use process.env.SECRET_KEY
Can use process.env.ENV_KEY
Please pass data for title, meta before UI rendered.
Example /src/pages/users/index.js
Install Dependencies
npm i
Start with Development Mode
npm run dev ( developepment )
Start with Production Mode
npm run build
npm start ( production )
Docker build take faster for deploy production
docker build -t nextjs_image .
docker run -d -v /home/path_to_project:/home/source -p 4000:4000 --name nextjs_container nextjs_image
You should configure things like eslint, tsconfig, prettier etc. with things that suit you and your project. Configuration in this project is not perfect - it's just my own preference, but I'm open to suggestions :)
The Project support offline-mode (Service Worker) when server dont response. Please check next.config.js and uncomment it (line 27) When you use the offline mode server function will build longer than usual, consider this.
The project uses a proxy mechanism for APIs to avoid CORS errors in browsers. If you do not use, you can change the domain name in the config file and call it directly
The Projects using Formik and Yup help you quickly set up forms and validator.