Setup after Cloning this repo:
- Run
npm install
; - Run
npm run dev
to initiate localhost; - Run
npm run build
before deployment;
This project was deployed to Zeit, using the Now CLI.
Deployment
- After setting up Now Cli, and running
npm run build
andnow
commands, a new deployment version is going to be generated on Zeit’s dashboard. - There are two ways to assign deployment versions to domains.
— The first is to manually go in the dashboard, click on the elipsis located in the right side of the deployment version and selecting ‘Assign Domain’ manually typing/pasting the domain there.
— If the production domain is already setup, and a developer wants to push the latest commit straight to prod environment, that can be done by runningnow --prod
Project Structure
Components
- This folder includes all React Component files as well as their styles.
- Each component has its own style file to keep the code modular and easy to target.
Helpers
- Functions that don’t return jsx, but help access/treat data.
- These functions are re-used throughout the project.
Pages
- Hold all page layout files. Through this files we get access to the method ‘getInitialProps’. This is the method that makes data available through SSR. Refer to Zeit Docs.
- Files labeled with brackets around them work as wildcards.
- The folder structure maps to the App routing. Any page that doesn’t have a matching file name will default to the wildcard in the same place in the tree.
- i.e: All case studies are mapping to
pages/investment-approach/case-studies/[cs].js
, which has a file path that is the same as the URL generated by the CMS.
Static
- Next.js method to add a favicon and/or other images that need to be statically generated.
Styles
- This folder houses all scss structure.
- index.scss is calling all includes + global styles.
config.js
- Exposes an object with the project’s api url.
- This is to make it easier to make global changes, in case a developer needs to ping different enviroments/apis.
Secrets:
- This project uses env variables for password protected pages.
- Docs on env vars for Zeit: https://zeit.co/docs/v2/build-step#using-environment-variables-and-secrets