This repository will no longer to be maintained after the 2022-2023 academic year. Please check out PeterPortal moving forward.
Before going through this section, please install the most current release of Node.js v18 that is compatible with npm v9. It is recommended to follow the tutorial here.
- Enter the
client
folder in the command line and runnpm i
to install the packages - Execute
npm start
to see the front end application
- Enter the
server
folder in the command line and runnpm i
to install the packages - Execute
npm run dev
to start the back end service- If there is an error about ts-node, run
npm i -g ts-node
- If there is an error about ts-node, run
For more information on the back end service, please see here.
- Ant Design Charts
- Emotion
- Lodash
- PatternFly
- React
- React Router
- React Select
- Redux Toolkit
- Express.js
- apicache
- Express Rate Limit
- express-validator
- Helmet
- node-cache
- Fuse.js
- Jest
- ts-jest
- Node.js
- Nodemon
- Sequelize
- sqlite3
- SuperTest
- TypeScript
- ts-node
- winston
AntCatalog also uses Locust for load testing, which itself is written in Python.
You can use AWS EC2 or Azure App Service to deploy the application. If there is a problem with the instructions, please feel free to create an issue.
The instruction below is written for an AWS EC2 instance with Ubuntu v20.04 or v22.04 installed. Please ensure your operating system is able to initiate a SSH/SCP session.
- Create an instance on EC2 like this
- Restrict SSH access to your IP address only and allow HTTP/HTTPS connections from everywhere with the security group feature
- Connect to the AWS instance you just created with
ssh -i "PEM_FILE_HERE" ubuntu@AWS_INSTANCE_PUBLIC_IPV4_DNS
- Follow this tutorial to install nvm and the most current release of Node.js v18
- Clone the project to the instance and run
npm ci
for bothclient
andserver
- Execute
npm run build
onclient
- If there is a memory error, you can execute
npm run build
locally and move thebuild
folder toclient
on the instance
- If there is a memory error, you can execute
- Run
sudo apt install nginx
to install NGINX- Run
sudo service nginx stop
,sudo rm /etc/nginx/sites-available/default
, andsudo touch /etc/nginx/sites-available/default
- Paste the code snippet below into the file you just created and make necessary adjustments
server { listen 80; server_name your_domain.com www.your_domain.com; location / { proxy_pass http://127.0.0.1:26997; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_cache_bypass $http_upgrade; proxy_redirect off; } }
- Run
- Run
npm install pm2 -g
andpm2 startup
- Copy and paste the generated command to ensure pm2 is started automatically when the system is booted
- Install Certbot to enable HTTPS by
sudo snap install --classic certbot
- Inject HTTPS settings into current NGINX setting with
sudo certbot --nginx
and answer the questions based on your circumstances- Renew the SSL certificate by
sudo certbot renew
- You can also automate the renewal by replacing the content in
/etc/cron.d/certbot
SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 0 */12 * * * root certbot -q renew --nginx
- Renew the SSL certificate by
- Execute
npm run build
,npm run start:aws
, andsudo service nginx start
onserver
You should see the website deployed when you entered the public IPv4 address of the instance.
The instruction below is written for a Linux free tier instance. You can create one by following this video.
- Go to the configuration page of the instance
- Under
Application settings
, addWEBSITE_WEBDEPLOY_USE_SCM
and set it to true - Under
General settings
, set the startup command tonpm run start:azure
, disable FTP state, set HTTP version to 2.0 with TLS version 1.2, turn off ARR affinity, and enable HTTPS only
- Under
- Create a publish profile as a GitHub secret by following the sections "Generate deployment credentials" and "Configure the GitHub secret" in this link
- Change the value of
AZURE_WEBAPP_NAME
ingithub/workflows/deploy.yml
to the name of your instance - The application should be deployed whenever a new commit is pushed to the main branch
- You can run the deployment workflow manually by following this link
You should see the website on https://<app-name>.azurewebsites.net
. Note that it will take about a minute to load the website again after 20 minutes of inactivity. However, a workaround is implemented with the cron job in github/workflows/poll.yml
.
This project has inspirations from ZotCurve and the grade distribution data is from UC Irvine's Public Records Office (PRO).