ZotPlan is a system designed to help UCI students plan their long-term course selections and checking their plans against course offerings and major requirements.
-
Download node.js:
Debian:
sudo apt-get install nodejs
or Mac, Windows: https://nodejs.org/en/
or using NVM for easy version switching: https://github.com/creationix/nvm
App tested with node.js v4.8 and npm 2.15.11, should work for any versions.
-
Download mongodb:
Debian:
sudo apt-get install mongodb
or Mac, Windows:
- https://www.mongodb.com/download-center?jmp=homepage#community
mkdir /data/db
(default mongodb data directory) if it does not exist- Run
monogd
-
Configure database:
- Open the mongodb CLI:
mongo
- Create databases:
use zotplan_development;
. The development database is needed at minimum for local development, a production database should also be created for running in prod. - Create collections:
db.createCollection("courses")
,db.createCollection("departments")
,db.createCollection("plans")
,db.createCollection("users")
. Collections are analogous to tables in SQL databases.
- Open the mongodb CLI:
-
Install dependencies: Run
npm install
in the project root. -
Populate the database with some data:
- Add a sample user for testing:
mongoimport -d zotplan_development -c users api/tests/datasets/dev-user.json
. The user's name isdev@zotplan.com
, password ispassword
, and has a simple plan built already. - Populate courses and departments data using the webcrawler. The latest legit results of the crawler are stored under source control under
crawler/datasets/DATE/
. You can generate these results yourself withnpm run crawler
. Runmongoimport -d zotplan_development -c courses crawler/datasets/*/courses.json
to add courses to the db, andmongoimport -d zotplan_development -c departments crawler/datasets/*/departments.json
to add departments.
- Add a sample user for testing:
Run npm run start:prod
to start the server. The app is served at localhost:8000
. The server needs to be stopped and rebuilt every time any changes are made.
The default user account is dev@zotplan.com
, with password password
.
To avoid refreshing the server every time a change is made in the UI, you can also run a webpack dev server using npm run start:dev
, which will run alongside the localhost:8000 server above. Visit the app at localhost:8080 instead, and UI changes will be reflected without having to restart the server. Any API changes will always require a restart of the prod server.
Run the api tests using npm test
.