Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nionata committed May 13, 2020
1 parent 0f463d5 commit d69c982
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 28 deletions.
88 changes: 68 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,88 @@

### `/`

- #### `client/`
[Client](/client/#client) is the frontend of the applcation. It is powered by [React](https://reactjs.org/) and [Blockly](https://developers.google.com/blockly).
#### `client/`
[Client](/client/#client) is the frontend of the application. It is powered by [React](https://reactjs.org/) and [Blockly](https://developers.google.com/blockly).

- #### `cms/`
#### `cms/`

[Cms](/cms#cms) is the REST API and admin portal that powers the backend. It is powered by [Node](https://nodejs.org/en/) and [Strapi]().
[Cms](/cms#cms) is the REST API and admin portal that powers the backend. It is powered by [Node](https://nodejs.org/en/) and [Strapi]().

- #### `compile/`
#### `compile/`

[Compile](/compile/#compile) is an arduino compilier service. It is an unofficial fork of [Chromeduino](https://github.com/spaceneedle/Chromeduino).
[Compile](/compile/#compile) is an arduino compiler service. It is an unofficial fork of [Chromeduino](https://github.com/spaceneedle/Chromeduino).

<br/>
<br/>

## Setup
## Environments

The project is divided into three conceptual environments.
### Development
This project's dependencies are managed through [yarn](https://classic.yarnpkg.com/en/docs/install/#mac-stable)
The following are the available scripts we can use with the client and server:

The development environment is comprised of four servers managed by docker compose.
#### Structure

The development environment is comprised of four servers managed by [docker compose](https://docs.docker.com/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

* `sc-client-dev` => localhost:3000
* `sc-cms-dev` => localhost:1337
* `sc-compile-dev` => localhost:8080
* `sc-db-dev` => localhost:3306
#### Running

To get started, simply
`stem-c-cms-dev`, `stem-c-compile-dev`, and `stem-c-db-dev`

1. Install [docker](https://docs.docker.com/get-docker/)
2. Add strapi.sql to cms/
3. Run `docker-compose up`

### Deployment
`stem-c-client-dev`

1. Run `cd client`
2. Run `yarn install`
3. Run `yarn start`

### Staging

#### Structure

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

* `stem-c-staging` - [stem-c-staging.herokuapp.com](https://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 comprised 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](https://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](https://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 Heroku CLI.

1. Download [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli)
2. Run the following commands sequentially

TODO
```bash
heroku login
heroku git:remote -a stem-c-compile
heroku container:login
heroku container:push web
heroku container:release web
```

<br/>

Expand All @@ -54,7 +101,8 @@ Ideally, we want our flow to resemble this. Master and develop are locked for di

### Branches

- `master` - Deployed version of the application
- `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`
Expand Down
13 changes: 6 additions & 7 deletions cms/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
# Cms

REST API and admin portal that powers the backend. It is powered by [Node](https://nodejs.org/en/) and [Strapi](https://strapi.io/documentation/3.0.0-beta.x/getting-started/introduction.html). The file structure is defined by Strapi and is documented [here](https://strapi.io/documentation/3.0.0-beta.x/concepts/file-structure.html#files-structure).
REST API and admin portal that comprise the backend. It is powered by [Node](https://nodejs.org/en/), [Strapi](https://strapi.io/documentation/3.0.0-beta.x/getting-started/introduction.html), and [PostgreSQL](https://www.postgresql.org/). The file structure is defined by Strapi and is documented [here](https://strapi.io/documentation/3.0.0-beta.x/concepts/file-structure.html#files-structure).

<br/>

## Setup

To run Cms with the rest of the application, see the project [development](../README.md#development) setup.
**RECOMMENDED:** To run Cms with the rest of the application, see the project [development](../README.md#development) setup.

### Development

1. Install [docker](https://docs.docker.com/get-docker/)
2. Add strapi.sql to `/`
3. Start a new db container from MySQL `yarn run make-db`
3. Start a new docker container running postgres `yarn run make-db`
4. Install dependencies `yarn install`
5. Start the development server `yarn develop`

Additional scripts:

* Start an existing db container `yarn db`
* Connect to the MySQL bash `yarn db-bash`
* Start an existing db container `yarn db-start`
* Connect to the postgres bash `yarn db-bash`

<br/>

## API `/`

Built with [Node](https://nodejs.org/en/), [Koa](https://github.com/koajs/koa#readme), and [Bookshelf](https://bookshelfjs.org/), the REST API enables CRUD functionality with the application's content. Authentication is enabled via JWTs. The current database is sqlite3 running locally.
Built with [Node](https://nodejs.org/en/), [Koa](https://github.com/koajs/koa#readme), and [Bookshelf](https://bookshelfjs.org/), the REST API enables CRUD functionality with the application's content. Authentication is enabled via JWTs. The dbms is [PostgreSQL](https://www.postgresql.org/).

### Entity Relationships

Expand Down
2 changes: 1 addition & 1 deletion compile/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Compile

Arduino compilier service
Arduino compilier server.

<br/>

Expand Down

0 comments on commit d69c982

Please sign in to comment.