Skip to content

Glavin001/Course-Calendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Course-Calendar

Service that serves iCal files from user's selected courses.


Easy-Setup (and for updating)

Copy and paste the below to install the app, load the database, and start the app:

# Install dependencies
npm install
bower install
# Convert data
node utils/coursesCSV2JSON.js -i data/courses.csv -o data/output.json
# Drop 'smu' and import
mongo smu --eval "db.dropDatabase()"
mongoimport --db smu -c courses --jsonArray < data/output.json
# Start app
node index.js

See below for explaination.


Installation

After cloning this repository, install the package dependencies:

npm install
bower install

Setting up the database

Convert the CSV data to JSON format using utils/coursesCSV2JSON.js

node utils/coursesCSV2JSON.js -i data/courses.csv -o data/output.json

Import newly formated data to MongoDB.
WARNING: this will drop any existing smu database!

# Drop 'smu'
mongo smu --eval "db.dropDatabase()"
# Import data to 'courses' collection in 'smu' database
mongoimport --db smu --collection courses --jsonArray < data/output.json

If successful, the console will display:

imported 2537 objects

Usage

Start the app

node index.js

Browse to http://localhost:8080/

Utilities

Course CSV to JSON

node utils/coursesCSV2JSON.js -i data/courses.csv -o data/output.json

Importing from JSON output file

mongoimport --db smu --collection courses --jsonArray < data/output.json --pretty

Adding --pretty produces human readable JSON.
Be sure to clear your collection courses in database smu before importing, as this will insert duplicates.

About

Service that serves iCal files from user's selected courses.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published