Skip to content

NUS Timetable Builder and Knowledge Platform (Unofficial)

License

Notifications You must be signed in to change notification settings

davisdevs/nusmods

 
 

Repository files navigation

ghit.me

Talk to us!

Setup with Vagrant

Prerequisites

Setup

On Unix/Mac:

$ pip install ansible==2.1.0.0
$ vagrant up

On Windows:

PS> vagrant up

Once it's up, do a vagrant ssh to enter the development environment.

Setup without Vagrant

Prerequisites

Setup

Install the necessary packages.

$ npm install -g npm@3.6.0
$ npm install -g bower@1.7.9 gulp-cli@1.2.2
$ npm install
$ bower install

If you are working on news.php, make a copy of /app/config/secrets.json.example in the same directory and call it secrets.json. Add your Facebook App credentials into the file secrets.json.

Building for Development

First, SSH into the vagrant box (this command has to be run in the directory that Vagrantfile is in):

$ vagrant ssh

Run the development environment:

$ npm start

Visit localhost:9000 to see your local instance of NUSMods.

Building for Production

To get a complete, minified, production build under dist/ (ignores jshint warnings):

$ npm run build

Deploying to Production

Change the host in the production inventory file provisioning/production and execute the Ansible playbook against it:

$ ansible-playbook provisioning/production.yml -i provisioning/production

Working with the NUSMods API

NUSMods is set up to work with the remote API at http://nusmods.com/api/ by default. To work with a local copy of the API:

$ git submodule update --init
$ cd api
$ npm install
$ grunt # starts the crawling process in nusmods-api

The development server serves the files generated in api/app/api under /api/, so change baseUrl under app/config/application.json to point to /api/.

Optional Dependencies

  • PHP for export, URL shortening, redirect and Facebook API proxy scripts.
  • YOURLS for URL shortening.
  • wkhtmltopdf and wkhtmltoimage for pdf and image export. Using the static binaries is suggested, as compiling with all the features of the static build needs a custom patched version of QT, which takes a long time to build.
  • Facebook PHP SDK for Facebook API proxy.
  • To install the PHP dependencies, simply do:
$ composer install

License

Copyright (c) 2016 NUSModifications. Licensed under the MIT license.

About

NUS Timetable Builder and Knowledge Platform (Unofficial)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 52.0%
  • HTML 25.0%
  • CSS 13.3%
  • ApacheConf 7.8%
  • PHP 1.3%
  • Shell 0.6%