Computation and Science Modeling through Making
Cloud-based programming interface
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.
The project is divided into three conceptual environments.
The development environment is composed of five servers. The first one is run with the Create React App dev server. The later four are containerized with docker and run with docker 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 script will run and seed the database with an environment specific dump. Read about Postgres initialization scripts here. To see how to create this dump, look here.
casmm-compile_queue-dev
casmm-client-dev
yarn start
from /client
casmm-server-dev
, casmm-compile-dev
, casmm-db-dev
, and casmm-compile_queue-dev
Install docker
Run docker compose up
from /
Grant permission to the scripts and server directories if you are prompted
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
server
compile
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.
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
server
compile
casmm
is automatically built from the latest commits to master
. Heroku runs the container orchestration from there.
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.
This is by far the largest and most important dependency we have. Staying up to date with its releases is important for bug/security fixes and new features. When it comes to actually upgrading Strapi make sure to follow the migration guides!
All of the deployments and releases are handled automatically with GitHub Actions. The workflows implement custom Actions that live in the auto repo.
We will follow this git flow for the most part — instead of individual release branches, we will have one to streamline staging deployment
Locked for direct commits — all commits must be made from a non-protected branch and submitted via a pull request with one approving review
Commits can be made directly to the branch
scaffold
>-<feature-name
> - Based off of develop
scaffold
>-<fix-name
> - Based off of master
Before submitting a pull request, rebase the feature branch into the target branch to resolve any merge conflicts.
This project entailed the introduction of badges and a student profile to the CASMM system.
Search profile (student view)
View created badges (teacher view)
Teachers can view the badges they have created to keep track of used images or assigned badges. This allows them to assign a past badge to more students or ensure that a badge is not created twice.
Wireframe:
Implementation:
View badge details (teacher & student)
Students and teachers are able to view a badge's name, criteria, description, and percentage of students who have earned it. Teachers can use this information to determine who to assign a badge to while students can use this as motivation to work towards earning a new badge.
Wireframe:
Implementation:
Upload custom badge via URL (teacher view)
Teachers can upload an image via URL to represent a badge. This allows teachers to import artwork from other sites as well as find custom images that cater to their specific class.
Wireframe:
Implementation:
Create custom badge via default template (teacher view)
Assign badges to students (teacher view)
Teachers have a simple checkbox system to assign badges to students.
Wireframe:
Implementation:
View earned badges (student view)
Students have a tab on their page to view the badges they have earned. This is displayed gallery style.
Wireframe:
Implementation:
Edit visibility of badges (student view)
Students have the ability to hide or show badges on their public profile so that those who search them up only see the badges they are proud of.
Wireframe:
Implementation:
Same setup as the development instructions above.
It is necessary to have permissions in Strapi Roles match the permissions in the routes.json files. These changes to not seem to save to git, so here are the changes that will need to be made: Allow the student role to access badge/countearners, classroom/countstudents, student/granthidebadgearr, stuednt/hidebadge, student/showbadge Allow the teacher role to access badge/countearners, badge/create, badge/delete, badge/find, badge/findone, badge/update, classroom/countstudents
New server/client/database connections can be added by creating a new route to the respecctive server/api/ component, followed by creating a controller for that route request, and lastly adding a request method to the client/utils/requests.js file.
pg_dumpall -U postgres strapi -f dumpall.dump
Automatic Badge Assignment
Our idea for this feature is to allow for certain badges to be automatically assigned, without the teacher doing anything. Automatic assignment would definitely be used for time-based badges (eg. Member for 5 months, New Member, etc.), but can also be used for work-based badges (such as having the highest score on an assignment).
Profile banner
Banner is somewhat redundant so we deprioritized this feature after Sprint 1. This feature would involve a badge or banner being chosen to display on or around the profile picture or profile page.
Canvas for custom badges
Opted for inputting an image link address or choosing a preset image for ease of use. This would involve implementing a browser-based canvas (similar to GIMP or a pixel art application) for creating a badge image from scratch.
Admin access
Requires the admin role to exist (other than the Strapi admin). Admins would be school administrators, school board officials, etc. We wanted the admin to be able to see all badges made by teachers in their school organization. The view would be similar to the teacher view, but with all of the badges shown.