Jam3 NextJS Generator
Boilerplate for React, Static and Server Side Rendered projects with NextJS
Icon made by Pixel perfect from www.flaticon.com
Table of Contents
Installation
Check your Node and NPM versions.
Make sure you are using Node 16.x.x and NPM 8.x.x on your development environment. Using NVM is highly encouraged.
$ nvm use 16
$ npm install --global npm@8
TIP: If you use ZSH, you can configure automatic Node switching: https://kinduff.com/2016/09/14/automatic-version-switch-for-nvm/
Clone the GitHub repository
Or Fork it, and start working right away with it.
$ git clone https://github.com/Jam3/nyg-nextjs.git
Set up CI/CD
Deploying a static site is fairly simple, we are going to the set up for CircleCI.
To find out more, go to CircleCI Readme
Usage
1. local Front End server
# http://localhost:3000
$ npm run dev
2. storybook
# http://localhost:9001
$ npm run storybook
3. template scripts
We are using seng-generator to generate templates
# cli
$ npm run generate
# create page(s)
$ npm run generate page [page-name]
# create api routes
$ npm run generate api [api-name]
# create component
$ npm run generate component [component-name]
Default location can be edited here:
Release
To releasing new versions we are using standard-version.
Steps:
- When PRs/commits land to your master branch, select the Squash and Merge option.
- Add a title and body that follows the Conventional Commits Specification.
- Run
$ git checkout main; git pull origin main
- Run
$ npm run release
- Run
$ git push --follow-tags origin main
Set up Git LFS
If you would like to track files with Git LFS follow the below steps. These steps assume docker is used to deploy, and might change based on your deployment infrastructure as it was tested in Jam3 infrastructures.
-
Generate SSH key + save it in a encrypted env variable You can use the Codeship Pro guide. The encrypted environment will be a different file name, like
.env.codeship.ssh.local
-
Upload public SSH key to GitHub
-
Enable Git LFS ini the artifact.sh script, uncommenting the line
bash ./.codeship/set-lfs.sh
-
Enable ssh config
encrypted_env_file: .env.codeship.ssh.encrypted
incodeship-services.yml
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.