These steps need to be performed only once after creating the repository from the template
- Run
npm run create-encryption-keys. This will generate the.production.key,.staging.key, and.development.keyencryption keys - Save all the
*.keyfiles in a secure location - Add
NEXT_PUBLIC_ENVfor all envs with values used insrc/common/utils/getPageTitle.tsi.e.staging,production, and,dev
- Create an environment variable
ENV. This can have only one of these value:stagingorprod - Create an environment variable
DECRYPTION_KEY_PRODwith the same value as the prod decryption key - Create
DECRYPTION_KEY_STAGINGfrom the staging decryption key
- Update project name in
README.md,package.json, and insrc/app/layout.tsx - Update this Readme with information relevant to the project. Example of a good readme
- Remove the
First time setup and deploymentsection from the Readme - Add token in env file for usage in
apollo.config.js
nvm useto set the correct node versionnpm run installto install the dependencies- Get access to the decryption key file from your team members. Paste these files in the root of the repository
nvm useto set the correct node versionnpm run dev:stagingornpm run dev:prod
Example to update staging env:
- Run
npm run decrypt-staging-env - Edit
.env.local - Run
npm run encrypt-staging-env
- Use
npm run auto-generate-graphql-typesto automatically generate types for queries and mutations used in project - The generate types are located in
src/generated/graphql.ts