This application was created using Node, Express, and React by Connor Bernard at the University of California, Berkeley for the sake of displaying student grade information for the classes CS10 "The Beauty and Joy of Computing" and CS61C "Great Ideas in Computer Architecture (Machine Structures)."
- The first column should be the student's name
- The second column should be the student's email. Emails are stored trimmed and lowercased (students sign in with any capitalization). Two rows with the same email, ignoring case and spaces, get no grades at all.
- The first row should be the titles of the homework assignments for that column
- The second row should be the type of assignment
- The third row should be the maximum amount of points the assignment is out of
- The bin page should have two columns and be ascending with the leftmost column being points and the rightmost being letter grade as shown below
- Open the /api/config/default.json config file
- Fill out the server section with the port of the API
- Fill in the spreadsheet section with:
- The spreadsheet ID (found in the sheet URL)
- The scopes (only change this if the API needs more than readonly access)
- Fill out the pages subsection of spreadsheet with:
- The gradepage (the page with the grade data on it) and:
pagename: The name of the sheet with the grade dataassignmentMetaRow: The row that the assignment metadata starts onstartrow: The row where student information startsstartcol: The column where student information starts
- The binpage (the page with the bins on it) and:
pagename: the name of the page with the bins on itstartcell: the top left cell of the bins (point value for F)endcell: the bottom right cell of the bins (letter value for A+)
- The gradepage (the page with the grade data on it) and:
- Add all necessary admin emails to the admin whitelist
NOTE: If your API server's origin is different from your live website's origin, you will have to set the REACT_APP_PROXY_SERVER environment variable equal to the respective URL in /.env.
On a laptop, use one of these from the root directory (copy .env.example to .env first):
make mock-up: Redis in Docker with fake students and grades, and the API and website on your machine. No project secrets needed. See docs/LOCAL_DEV_MOCK.md.make dev-up: the whole stack in Docker over plain HTTP (docker-compose.dev.yml, ports bound to 127.0.0.1);make dev-downstops it. Build the website first withmake init(the web container serveswebsite/server/buildand answers 404 without it;make dev-upstops with a message until it exists). It needsREDIS_DB_SECRETin.env, and Redis only gets data ifdbcron/.envhas the grade sheet settings and a Google service account (SERVICE_ACCOUNT_CREDENTIALS, see docs/DEPLOY.md section 3), so for fake data usemake mock-up. It also publishes 127.0.0.1:80, :6379 and :8080, so those ports must be free.
Do not run a plain docker compose build / docker compose up (or make docker) on a laptop:
docker-compose.yml is the production stack. It serves HTTPS only and needs the server's
Let's Encrypt certificate and a real REDIS_DB_SECRET.
Follow docs/DEPLOY.md (server, firewall, configuration files, certificates, make docker
and updates).
make mock-up(above) runs the API and the website with Node on your machine, with fake data.make dev-localruns Redis and dbcron in Docker and the API and the website on your machine (it needs the samedbcron/.envasmake dev-up).make initinstalls every package (without rewriting the tracked lockfiles) and builds the website.
- To access the cli when the container is running:
docker exec -it gradeview-redis-1 redis-cli - First command is to enter the password. The password is stored in the root .env file as REDIS_DB_SECRET
AUTH {value of REDIS_DB_SECRET}
- Select which data to use - since we only have the data from the Google Sheet, it is populated to the 0 index, so type:
SELECT 0 - To list out all of the keys in this database:
KEYS * - To access the data for the assignment:concept mapping:
GET Categories
This returns a JSON in the following format:
“{\“Quest 1\“:
{\“Abstraction\“: \“2\“, \“Number Representation\“: \“4\“, \“Iteration\“: \“6\“, \“Domain and Range\“: \“6“, \“Booleans\“: \“6\“, \“Functions\“: \“4\“, \“HOFs I\“: \“12\“}
}”
- To access a students data, use their email in lowercase. For example:
GET dahluwalia@berkeley.edu
This returns a JSON in the following format:
“{\“Legal Name\“: \“Ahluwalia, Dev\“,
\“Assignments\“:
{\“Quest 1\“:
{\“Abstraction\“: 2, \“Number Representation\“: 4, \“Iteration\“: 6, \“Domain and Range\“: 6, \“Booleans\“: 6, \“Functions\“: 4, \“HOFs I\“: 12}
}
}”
