Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 18 additions & 132 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,142 +1,28 @@
# CaSMM
# CaSMM - Project 4 - Group 4c

> Computation and Science Modeling through Making
> Grading features

Cloud-based programming interface
# AutoGrade (Still on AutoGrade branch)
-Run by running "yarn start" in client, then "docker compose up" in the main file.

![Deploy Staging](https://github.com/STEM-C/CaSMM/workflows/Deploy%20Staging/badge.svg)
![Deploy Production](https://github.com/STEM-C/CaSMM/workflows/Deploy%20Production/badge.svg)
-Features include
- A new Grade Template for teachers to write their solutions.
- ![Screen Shot 2023-12-05 at 12 29 59 PM](https://github.com/CEN3031-F23-Group4c/sapphire-project04-4c/assets/92874037/7e9d5108-8fb4-4873-bd09-f4493836d329)

<br/>

## Application
- AutoGrade Enabling and disabling.
- ![Screen Shot 2023-12-05 at 12 32 45 PM](https://github.com/CEN3031-F23-Group4c/sapphire-project04-4c/assets/92874037/7b23c177-7bef-4501-80c3-feb9665d70b0)

### `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).
- AutoGrade submission on student canvas.
- ![Screen Shot 2023-12-05 at 12 31 44 PM](https://github.com/CEN3031-F23-Group4c/sapphire-project04-4c/assets/92874037/a1b8687e-e93d-4ad0-b914-c36921feb347)

### `server`
- Feedback messages to student.
- ![Screen Shot 2023-12-05 at 12 32 06 PM](https://github.com/CEN3031-F23-Group4c/sapphire-project04-4c/assets/92874037/0dd12f52-f0e6-4512-ba50-b906d680521f)

- A new grade_in_class feature for students thats updated with the students' submission.
- ![Screen Shot 2023-12-05 at 12 34 12 PM](https://github.com/CEN3031-F23-Group4c/sapphire-project04-4c/assets/92874037/e1d8c72f-fd3d-4ed0-bd9d-fd34c7c65f6f)

[server](/server#server) is the web server and application server. It is powered by [Node](https://nodejs.org/en/) and [Strapi](https://docs-v3.strapi.io/developer-docs/latest/getting-started/introduction.html).
-Outstanding Work
- Integration with the main branch along with the feedback feature.

### `compile`

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

<br/>

## Environments

> The project is divided into three conceptual environments.

### Development
#### Structure

The development environment is composed of five servers. The first one is run with the [Create React App](https://create-react-app.dev/docs/getting-started/) dev server. The later four are containerized with docker and run with [docker compose](https://docs.docker.com/compose/).

* `casmm-client-dev` - localhost:3000

* `casmm-server-dev` - localhost:1337/admin

* `casmm-compile-dev`

* `casmm-db-dev` - localhost:5432

> The first time the db is started, the [init_db.sh](/scripts/init_db.sh) script will run and seed the database with an environment specific dump. Read about Postgres initialization scripts [here](https://github.com/docker-library/docs/blob/master/postgres/README.md#initialization-scripts). To see how to create this dump, look [here](https://github.com/DavidMagda/CaSMM_fork_2023/blob/develop/scripts/readme.md).

* `casmm-compile_queue-dev`

#### Running

`casmm-client-dev`

1. Follow the [client](/client#setup) setup
2. Run `yarn start` from `/client`

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

1. Install [docker](https://docs.docker.com/get-docker/)

2. Run `docker compose up` from `/`

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


### Staging

#### Structure

The staging environment is a Heroku app. It is composed of a web dyno, compile dyno, Heroku Postgres add-on, and Heroku Redis add-on.

* `casmm-staging` - [casmm-staging.herokuapp.com](https://casmm-staging.herokuapp.com/)
* The web dyno runs `server`
* The compile dyno runs `compile`

#### Running

`casmm-staging` is automatically built from the latest commits to branches matching `release/v[0-9].[0-9]`. Heroku runs the container orchestration from there.

### Production

#### Structure

The production environment is a Heroku app. It is composed of a web dyno, compile dyno, Heroku Postgres add-on, and Heroku Redis add-on.

* `casmm` - [www.casmm.org](https://www.casmm.org/)
* The web dyno runs `server`
* The compile dyno runs `compile`

#### Running

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

<br/>

## Maintenance

All three components of the application have their own dependencies managed in their respective `package.json` files. Run `npm outdated` in each folder to see what packages have new releases. Before updating a package (especially new major versions), ensure that there are no breaking changes. Avoid updating all of the packages at once by running `npm update` because it could lead to breaking changes.

### Strapi

This is by far the largest and most important dependency we have. Staying up to date with its [releases](https://github.com/strapi/strapi/releases) is important for bug/security fixes and new features. When it comes to actually upgrading Strapi make sure to follow the [migration guides](https://docs-v3.strapi.io/developer-docs/latest/update-migration-guides/migration-guides.html#v3-guides)!

<br/>

## CI/CD

All of the deployments and releases are handled automatically with [GitHub Actions](https://docs.github.com/en/actions). The workflows implement custom [Actions](https://github.com/STEM-C/CaSMM/actions) that live in the [auto](https://github.com/STEM-C/auto) repo.

<br/>

## 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](https://nvie.com/img/git-model@2x.png)

### 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, rebase the feature branch into the target branch to resolve any merge conflicts.

- PRs to **master** should squash and merge
- PRs to all other branches should create a merge commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Modal, Button, Table } from "antd"
import React, { useState } from "react"
import { message } from "antd"

export default function DisplayFeedbackModal({ feedback, isVisible, setIsVisible }) {
const handleCancel = () => {
setIsVisible(false)
}

const handleOk = () => {
setIsVisible(false)
message.destroy(); // Only remove toast message if the user clicks OK
}

const columns = [
{
title: 'Date/Time',
dataIndex: 'timestamp',
key: 'timestamp',
},
{
title: 'Comment',
dataIndex: 'comment',
key: 'comment',
},
];

return (
<Modal
title="Feedback From Your Teacher"
visible={isVisible}
onCancel={handleCancel}
onOk={handleOk}
width="80%"
footer={[
<Button key="submit" type="primary" onClick={handleOk}>
OK
</Button>,
]}
>
<Table dataSource={feedback} columns={columns} pagination={false} />
</Modal>
);
}
Loading