https://github.com/vivify-ideas/nextjs-boilerplate
Boilerplate for NextJS
https://github.com/vivify-ideas/nextjs-boilerplate
Last synced: 3 months ago
JSON representation
Boilerplate for NextJS
- Host: GitHub
- URL: https://github.com/vivify-ideas/nextjs-boilerplate
- Owner: Vivify-Ideas
- Created: 2020-04-14T08:04:37.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T01:43:32.000Z (over 2 years ago)
- Last Synced: 2025-01-04T06:28:47.769Z (4 months ago)
- Language: JavaScript
- Size: 2.62 MB
- Stars: 1
- Watchers: 8
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **_VivifyIdeas NextJS boilerplate_**
If you are using our NextJS boilerplate we recommend you use it with our [laravel](https://github.com/Vivify-Ideas/laravel-boilerplate) boilerplate.
## **Start**
### Locally
```
yarn run dev
```### Docker
Build and run your container locally```
docker-compose up --build
```## **Built in functions**
- HTTPS mode in dev
- Redux & Saga
- Formik & Yup
- Immerjs
- Sign in
- Sign up
- Facebook sign in
- Google sign in
- Forgot & reset password
- Internationalization
- Edit profile## **TBD**
- Change password
## **Code structure and technologies**
For our forms we use [Formik](https://github.com/jaredpalmer/formik), and for validation we use [Yup](https://github.com/jquense/yup).
In components folder there are some examples of our forms, they all use custom text inputs which are located in `components/shared/formFields`, and in `validation` folder you will find some `Yup` validation examples.
├── components
├──── auth
├──── shared
├─────── formFields
├────────── PasswordInputWithLabel.js
├────────── TextInputWithLabel.js
└── validation### State Management
For state management we use [React Redux](https://github.com/reduxjs/react-redux) with [Redux Saga](https://github.com/redux-saga/redux-saga) and [Reselect](https://github.com/reduxjs/reselect).
├── store
├──── actions
├──── index.js
├──── reducer
├──── selectors
└──── sagas### Localization
For more details check out [next-i18next](https://github.com/isaachinman/next-i18next).
### Route Guards
There are HOC made for this (`withAuth`, `withGuest`).
You can find examples in `utils/hoc`.Logged in user is beeing `server side rendered` you can find the code in `pages/_app.js` in `getInitialProps` method.
## **HTTPS Mode**
To run this application in HTTPS mode you will need to generate certificates localy and put them in `certs` folder in root of your project. The required certificate files are `server.key` and `server.ctr`. After that you can run `yarn dev-https` command to run it in HTTPS.