Skip to content

Latest commit

 

History

History
135 lines (80 loc) · 4.73 KB

README.md

File metadata and controls

135 lines (80 loc) · 4.73 KB

CaSMM

Cloud-based programming interface


Scaffolds

/

client/

client is the frontend of the application. It is powered by React and Blockly.

server/

server is the web server and application server. It is powered by Node and Strapi.

compile/

compile is an arduino compiler service. It is an unofficial fork of Chromeduino.


Environments

The project is divided into three conceptual environments.

Development

This project's dependencies are managed through yarn. This effectively replaces npm.

Structure

The development environment is composed of four servers. The first one is run with the Create React App dev server. The later three are containerized with docker and run with docker compose.

  • casmm-client-dev - localhost:3000
  • casmm-server-dev - localhost:1337
  • casmm-compile-dev - localhost:8080
  • casmm-db-dev - localhost:5432

Running

casmm-client-dev

  1. Follow the client setup
  2. Run yarn start from /client

casmm-server-dev, casmm-compile-dev, and casmm-db-dev

  1. Install docker

    If you do not meet these requirements docker desktop will not initialize properly. There are some unofficial modifications, however, we recommend installing the docker toolbox

  2. Run docker-compose up from /

    Grant permission to the scripts and server directories if you are prompted

Staging

Structure

The staging environment is deployed on Heroku. It is composed of one app running a Heroku Postgres instance and a web container.

  • casmm-staging - casmm-staging.herokuapp.com
    • The web container attached to this Heroku app runs server, which will serve all static files and the api
    • The Heroku Postgres instance is attached as an add-on

Running

casmm-staging is automatically built from the latest commits to release. Heroku runs the container orchestration from there.

Production

Structure

The production environment is deployed on Heroku. It is composed of two apps. One is running a Heroku Postgres instance and a web container and the other is running just a web container.

  • casmm - casmm.herokuapp.com
    • The web container attached to this Heroku app runs server, which will serve all static files and the api
    • The Heroku Postgres instance is attached as an add-on
  • casmm-compile - casmm.herokuapp.com
    • The web container attached to this Heroku app runs compile

Running

casmm is automatically built from the latest commits to master. Heroku runs the container orchestration from there.

casmm-compile is manually deployed through the Container Registry and Heroku CLI.

  1. Install Heroku CLI
  2. Run the following commands sequentially
heroku login
heroku git:remote -a stem-c-compile
heroku container:login
heroku container:push web
heroku container:release web

Contributing

Git Flow

We will follow this git flow for the most part — instead of individual release branches, we will have one to streamline staging deployment

Git Flow

Branches

Protected

Locked for direct commits — all commits must be made from a non-protected branch and submitted via a pull request with one approving review

  • master - Production application

Non-protected

Commits can be made directly to the branch

  • release - Staging application
  • develop - Working version of the application
  • feature/<scaffold>-<feature-name> - Based off of develop
    • ex. feature/cms-strapi
  • hotfix/<scaffold>-<fix-name> - Based off of master
    • ex. hotfix/client-cors

Pull Requests

Before submitting a pull request, merge the target branch into the working branch to resolve any merge conflicts. Include a description of the changes made.

  • PRs to master should squash and merge
  • PRs to all other branches should create a merge commit