Code for IDEO NY's visitors website deployed here.
This repository houses two separate Javascript / Node.js codebases in one:
./frontend: A PWA created using Create React App./backend: A Strapi application using a Postgres database.pm2is used to monitor and manage the Strapi's node.js process.pm2uses configuration found atecosystem.config.js. This file is.gitignored by default but anecosystem.config.js.exampleis checked-in. Copy this file and fill it with the appropriate values. For questions, contact the maintainer. (Refer to the bottom of this document)- An
nginxserver is used to provide reverse proxy for the backend application, as well as to performantly serve the frontend assets. certbotis used to generate SSL certificates and refirect allhttprequests tohttpsOAuthis used to authenticate visitors with their IDEO G-Suite credentials and allow them access to employees-only information. ForOAuthandStrapiconfiguration please see this document.
This website is hosted on an AWS EC2 instance. The postgres database is also hosted on AWS RDS. Credentials for this AWS account exist in IDEO NY's 1Password account. For access, please file a ticket to support@ideo.com
This website does NOT use CI/CD. For deployments follow these steps:
- ssh into the ec2 instance (refer to above paragraph for access credentials)
- Once connected,
cd ~/NY-Visitors-Website git branchand make sure you're on theproductionbranchgit pull- If you have introduced new dependencies,
cdinto the appropriate directory (backendorfrontendand runyarn(preferred) ornpm install(also cool). - Any changes to the backend code will automatically trigger a restart by
pm2which is monitoringbackendfiles for changes. After pulling in the changes, runpm2 lsto monitor the status of the backend Strapi application, andpm2 logsto view the logs. - If you have introduced changes to the frontend code,
cdintofrontenddirectory, install new dependencies if any (see above), runyarn buildand thencp -r build/* /var/www/ny-visitors.ideo.com/html/to copy over the built assets to the proper directory wherenginxserves these files to clients. - The
nginxconfiguration file used in this deployment exists at the root of this repo, calleddefault. It should give you a pretty good idea of this setup.
For bug reports and feature requests please contact the maintainer of this project at mnilchiani@ideo.com