- Overview
- Installing Meteor
- Installing Vagrant
- Running the app
- Accessing the development database
- Running test cases
- Setting up your Coding Environment
- Footnotes
There are 2 ways for you to set up your development environment.
- Install Meteor
- Set up a virtual environment using Vagrant
We recommend the first option to install Meteor as it is the primary source of new updates and any changes will be reflected in the Meteor environment first.
Meteor is the full-stack web application platform that NUS Oracle is built on. Learn more about Meteor at their official website here.
- Download Meteor on to your machine by going to the official Meteor website here
- For Unix / OSX users, run
curl https://install.meteor.com/ | sh
in the terminal - For Windows users, you should download the installer provided on the above website
- For Unix / OSX users, run
- Clone our repository
- Enter the root directory of the cloned repository using
cd
. Ensure that it is running on Meteor version 1.4.x by typingmeteor --version
Vagrant is a tool for developers to easily create a virtual environment on your local computer that mimics NUS Oracle's own development environment. If you're familiar with handling virtual environments or want to ensure your own local environment is consistent with ours, please try this method out.
Instructions for both Mac and Windows users:
- Install Vagrant and Virtual Box, the one that states "Virtual Box 5.1.18 platform packages"
- Download the nus-oracle vagrant box from this link
- Add the vagrant box into your list of vagrant boxes with
vagrant box add nus_oracle nus_oracle.box
- Run
vagrant up
to initialize the nus_oracle box- Make sure you have our Vagrantfile in the same directory as where
vagrant up
was ran
- Make sure you have our Vagrantfile in the same directory as where
- Enter the Virtual box VM with
vagrant ssh
- Run
sudo mount --bind /home/vagrant/nus_oracle/.meteor/local /vagrant/.meteor/local
- check the footnotes for why this must be done
- Run
cd/vagrant
to move to the directory - Run
meteor
in that directory to run the code on your local machine! - Exit the VM with the command
exit
- Release the resources used by the VM using
vagrant destroy
- Check out the following links for additional help in setting up your Vagrant environment
- Run the command
meteor npm install
to install all npm package dependencies - Run the app with the command
meteor
- Go to
localhost:3000
on your browser and the front page of our website should be displayed on your browser!
Sidenote:
Please take note that NO verification email for new accounts will be sent to your actual NUS email on localhost
. This is because you're not connected to the Simple Mail Transfer Protocol (SMTP) as authorization to SMTP key is not provided in our repository for security reasons. Thus, when signing up on your localhost
, the email with signup instructions will instead be printed on your console. Follow the instructions in the console to sign up for NUS Oracle on your local computer.
If you wish to develop on a local machine with full access to the database or SMTP, please contact us at nusoracle@gmail.com
.
Running meteor
on the database would only give you access to mockup data fixtures (i.e. fake data). If you wish to develop on a local machine with full access to a database, please contact us at nusoracle@gmail.com
where we would provide you with the relevant files and details on how to run the application locally with full database access.
- Set your environment variable
TEST_CLIENT=0
(important!) - Run the app with the command
meteor npm run ci-test
. This command may be customized in thepackage.json
file. - If you want to keep the test cases running in watch mode, set your environment variable like this:
TEST_WATCH=1
. - Run the command
meteor test --driver-package dispatch:mocha
Please note that Windows users need to run yourcmd
console with administrator privileges.
This is the coding environment setup that the developer team of NUS Oracle uses. Here's a collection of all the helpful tools that we found throughout the course of our project.
These tools are optional for developing on NUS Oracle. However, if you're just starting out as a developer and you're not sure what kinds of tools you should use to help you code, here are some for you to try out!
Atom is a fairly lightweight text editor which has many useful packages that can be found easily inside its in-built package manager browser.
- To install Atom, head over to the atom.io website and follow the installation instructions.
- You can also find a use list of Atom shortcut buttons on this github page.
Once you've installed Atom, you are now ready to download some useful packages that'll help you to write better code and making it much more enjoyable too! All these packages may be downloaded by clicking on Atom
and selecting the Preference
tab on the top navigation bar.
- Emmet
- Press Tab for syntax shortcuts for HTML, CSS less. Cheatsheet can be found here
- Language-javascript-jsx
- Syntax coloring for React jsx syntax
- Minimap
- See your entire code structure on the side
- Project manager
- Easy switch between different projects/folders within Atom
- Javascript-snippets
- syntax shortcuts
- Atom-beautify
- Auto-indent HTML, CSS, Javascript by simply right clicking and selecting beautify
- Sublime-Style-Column-Selection
- Hold 'ALT' while typing to block select stuff
- Color-picker
- Opens up a color picker so you can insert its corresponding HEX code
- Pigments
- Displays color in your code to immediately see what color a HEX is
The 2 commands that you have to run here is to change the default location where meteor stores the temporary database when running the code on a local machine. The information should be stored in the VM partition rather than the main computer (the partition that your current computer is running on) so this command enables that change