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.pm2
is used to monitor and manage the Strapi's node.js process.pm2
uses configuration found atecosystem.config.js
. This file is.gitignore
d by default but anecosystem.config.js.example
is 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
nginx
server is used to provide reverse proxy for the backend application, as well as to performantly serve the frontend assets. certbot
is used to generate SSL certificates and refirect allhttp
requests tohttps
OAuth
is used to authenticate visitors with their IDEO G-Suite credentials and allow them access to employees-only information. ForOAuth
andStrapi
configuration 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 branch
and make sure you're on theproduction
branchgit pull
- If you have introduced new dependencies,
cd
into the appropriate directory (backend
orfrontend
and runyarn
(preferred) ornpm install
(also cool). - Any changes to the backend code will automatically trigger a restart by
pm2
which is monitoringbackend
files for changes. After pulling in the changes, runpm2 ls
to monitor the status of the backend Strapi application, andpm2 logs
to view the logs. - If you have introduced changes to the frontend code,
cd
intofrontend
directory, install new dependencies if any (see above), runyarn build
and thencp -r build/* /var/www/ny-visitors.ideo.com/html/
to copy over the built assets to the proper directory wherenginx
serves these files to clients. - The
nginx
configuration 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