Skip to content

Latest commit

 

History

History
120 lines (76 loc) · 4.12 KB

README.md

File metadata and controls

120 lines (76 loc) · 4.12 KB

STEM+C


Scaffolds

/

cms/

Cms is the REST API and admin portal that powers the backend. 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 and should be used in place of npm everywhere except sc-compile-dev. The following are the available scripts we can use with the client and server:

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.

  • stem-c-client-dev - localhost:3000
  • stem-c-cms-dev - localhost:1337
  • stem-c-compile-dev - localhost:8080
  • stem-c-db-dev - localhost:5432

Running

stem-c-cms-dev, stem-c-compile-dev, and stem-c-db-dev

  1. Install docker
  2. Run docker-compose up

stem-c-client-dev

  1. Run the following commands sequentially
cd client
yarn install
yarn start

Staging

Structure

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

  • stem-c-staging - stem-c-staging.herokuapp.com
    • The web container attached to this Heroku app runs cms and serves static client build files
    • The Heroku Postgres instance is attached as an add-on

Running

stem-c-staging is automatically built from the latest commits to develop. 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.

  • stem-c - stem-c.herokuapp.com
    • The web container attached to this Heroku app runs cms and serves static client build files
    • The Heroku Postgres instance is attached as an add-on
  • stem-c-compile - stem-c-compile.herokuapp.com
    • The web container attached to this Heroku app runs compile

Running

stem-c is automatically built from the latest commits to master. Heroku runs the container orchestration from there.

stem-c-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

Git Flow

Ideally, we want our flow to resemble this. Master and develop are locked for direct commits. All commits must be made to a non-protected branch and submitted via a pull request with one approving review.

Branches

  • master - Production application
  • release/<version> - Staged version
  • 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.