This is a simple web app for viewing grade statistics of courses at Chalmers University of Technology.
The data is provided by Chalmers via a Excel document obtained by email which lists all the results of all courses.
This app also provides a public REST API.
Note that these instructions are specific for ftek.se.
To install run these commands:
cd /srv/stats
git clone https://github.com/Fysikteknologsektionen/chalmers-course-stats/ .
npm install
npm run build
To have the app always running you will now create two systemd services:
mongod.service
- databasenode-course-statistics.service
- node.js
This can be done by using this configuration for mongod and following this guide for node. Some tweaks might be neccesary to get it working for this specific app. For example the node service should start node server.js
in our case.
NOTE The data is currently obtained by manual email as Chalmers does not publish it as a online document anymore.
Updates are handled automatically on ftek.se by a PHP script that runs upon a push event via GitHub Webhooks.
However if you want to manually update run these commands:
cd /srv/stats
git fetch
git reset --hard FETCH_HEAD
chown www-data:www-data -R *
npm install
npm run build
sudo /bin/systemctl restart node-course-statistics
A webhook script has been setup so deployment should happen upon a GitHub push event.
The database is updated manually by running the following commands after placing the relevant excel document of results in the statistics/documents
folder and editing statistics/result_files.json
to match:
npm run db
Optionally you can clear the database of old content first by running
npm run db -- --drop
npm run db
Below are the old way of importing things. You should not need to use them.
cd /srv/stats/statistics/
mongo --eval "db.dropDatabase();"
node addFields.js
If you would like to contribute or send feedback, please create an issue first.
Run these commands:
cd /path/to/development/directory
git clone https://github.com/Fysikteknologsektionen/chalmers-course-stats/
npm install
To start the server run (in separate terminals)
mongod
(usemongod --dbpath
to run the database from the same folder instead of on root level)npm start
node server.js
If you find yourself with some error after running node server.js
running npm run build
before might fix it.
and then point your browser to localhost:3000/stats/. Any updates to any file will automatically refresh the browser.
This app was created by Jan Liu who was inspired by Johan Bowald's exam statistics page. With the help of Johan Winther the app was ported over to Fysikteknologsektionen's website (ftek.se/stats).
This project was bootstrapped with Create React App. You can find a guide on how to setup and use React here.