- Install dependencies
npm install
-
Create a config.js file with Github token to link to Atlier API. If you do not have access, reference the server code to create the backened to supply the data.
-
Start the server
npm start
- Bundle with Webpack
npm run dev
Test only the changes from last commit
npm run test
Test all the files
npm run test:all
Generate coverage to change from last commit
npm run coverage
Generate coverage to all files
npm run coverage:all
To see coverage report, go to: http://localhost:52330/coverage/lcov-report/
To see coverage of the main branch on gitHub go to: https://sensational-sycamore.github.io/sycamore/coverage/lcov-report
-
Create a EC2 instance running Ubuntu(linux).
-
Set EC2 security groups rules(add inboud rule for HTTP).
-
Save the pem key somewhere secure in your computer and give it read permition.
chmod 400 aws-keypair.pem
- Connect to your EC2 via SSH.
ssh -i "aws-keypair.pem" [email protected]
- Install EC2 dependencies.
sudo apt-get update && sudo apt-get upgrade -y
# download node make sure your version on your local matches the version you get
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
# install node
sudo apt-get install -y nodejs
# set up port fowarding You might need to make a change
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000
sudo apt-get install gcc g++ make
sudo apt-get install git
- Setup environment variables
export GITHUB_TOKEN=xxxxxxxxxxxx
You can check if the variable was set with:
printenv
- Clone code base into EC2.
git clone https://github.com/sensational-sycamore/sycamore.git
- Install project dependencies.
cd sycamore
npm install
- Build frontend
npm run dev
Stop the watch with crtl + c
- Test if project runs
npm run start
Stop the server with ctrl + c
- PM2 PM2 cheatsheet
sudo npm install pm2 -g
pm2 start server/index.js