A website about clubs and events at Yale.
We LOVE feedback! Please give us your thoughts here
- If you don't have it already, install
nvm - Install the VSCode extensions Prettier and ESLint
- Create a
.env.devand a.env.prodfile in the root directory based off of.env.example - Run
npm installto install dependencies
npm run devto run locally with live updatesnpm run devprodto run locally with the prod database, with live updatesnpm run buildto build for prodnpm run startto run a built project (after npm run build)
Make sure to run npm run build && npm run start before submitting a pull request, as sometimes errors will only show up in prod!
This project is made with NextJS, Typescript, TailwindCSS, and MongoDB
Infrastructure consists of the following three services, all within DigitalOcean (DO):
- Droplet: a DO server running nginx that serves the backend and runs the API. Uses pm2 to keep yaleclubs always running. Access with
ssh [email protected]and then enter the env file'sDO_BACKEND_PASSWORD. ~$6/month - Database Cluster: a DO database running MongoDB that stores all non-image information. ~$15/month
- Spaces: A DO Object Store that stores uploaded images. ~$5/month
Currently, all infrastructure is under the account [email protected] because of the free $200 in student credits. Eventually it will be transfered to an account under [email protected]
The server should rebuild automatically and download new packages, but if you need to do something like update an environment variable (which it cannot pull from github), you must login and manually rebuild:
- Go to DigitalOcean and login to the account
- Go to the server, click on the console button, and a terminal should open up
- The YaleClubs repo is in
/var/www/YaleClubs, go there - Manually update it however you'd like
- Rebuild with
npm run build - The
pm2command should automatically detect the new build and serve the program. Check its status withpm2 list