Everyone's help is needed! No matter how little you code, there's something to do. Please check the issues at GitHub and find something where you can contribute.
To make changes to the code:
- Read this readme
- Install the app locally using the instructions here
- Learn basic JavaScript syntax and learn about CoffeeScript
- Familiarize yourself with Meteor basics
- If you want to contribute to the front-end, learn about Semantic UI, Font Awesome and LESS
- If you want to contribute to the back-end, learn about Meteor collections and MongoDB
- Push commits!
This app is based on Meteor, a full-stack node.js web framework. Meteor is pure javascript, and most of the code works both in the front- as well as back-end. Meteor application can be tested on Windows using Vagrant to create a Linux virtual machine, that runs Meteor. This project contains a Vagrantfile and a provision.sh shell script that set up a virtual machine for this purpose (based loosely on a Gist by Gabriel Pugliese).
The app makes use of several Javascript libraries and technologies, some of which are built-in to Meteor, and some of which are added with Meteor's packaging system. The most important ones are:
- jQuery
- underscore.js
- MongoDB - the database used with Meteor
- Semantic UI - the front-end library used in this project
- Iron.Router - Used for Meteor URI routing
- Meteor Up - to deploy the app
- CoffeeScript - a JS dialect used in several files
- Font Awesome - a library of icons for web applications
- Meteor collection2 package - A popular package for defining database schemas and data model validations and automations
In order to develop this app, your computer needs to have Git, VirtualBox and Vagrant installed. On Windows, you also need to install the unix-like tools that come with Git or some other package to be able to run ssh from command line. Using a virtual machine guarantees that development can be done on any platform and minimizes "works on my machine" -type problems.
-
Clone this repository to your machine
-
Run
vagrant upin the main folder (the one with Vagrantfile). Vagrant's automated process will create a 64bit Ubuntu 14.01 virtual machine with all necessary sofware installed. -
Run
vagrant ssh. This will connect you to your virtual machine. -
Run the following commands:
# Still in the home folder (of the freshly created virtual machine) meteor create app cd app meteor run
-
Now you have created a dummy version of your app. Press Ctrl+C to stop the app. This meteor app in your virtual machine's home folder will only be used to store the database, as the VirtualBox synced folder does not support it.
-
Now you can change to the actual project folder and create symlinks to the dummy app too make the database work:
# Still in the same shell, within the virtual machine cd /vagrant/app rm -rf .meteor/local mkdir .meteor/local echo "sudo mount --bind /home/vagrant/app/.meteor/local /vagrant/app/.meteor/local" >> ~/.bashrc && source ~/.bashrc
-
Now your're all set. Run
meteor runto run the app and navigate your browser tohttp://localhost:3000to see it. To quit the app, press Ctrl+C, to exit the virtual machine connection, runexit, and to shut down the virtual machine, runvagrant halt.
- At this point, the categories need to be added manually. This can be done from the browser javascript console by running, for example,
Categories.insert({name: 'Viskit'});etc. - If the virtual machine or Meteor instance gets jammed, first try booting the virtual machine by running
vagrant reloadon the host machine terminal. - Whenever you save changes to the application files, Meteor loads them automatically and refreshes the page. This can sometimes take a little time though.
- Try stuff! The local environment is for playing around, you're not going to break anything.
- When using CoffeeScript, it's often helpful to have CoffeeScript home page open on one tab, and use the 'Try CoffeeScript' testing feature there to check if it compiles as you expect it to.
- Ask for help! All programmers suffer unnecessarily from inferiority complex, because it's so easy to find super-experts' answers to Stack Overflow questions etc. The fact is, you are not as bad as you think, so your question isn't as stupid as you think it is.
- Comments and commit messages in English.
- Write informative commit messages.
- Commit as often as possible.
- Indentation: 2 spaces.
- Meteor has lots of nice features. Try to use them.
- Most problems are better solved by someone else. Go to Atmospherejs to find packages for Meteor.
In Meteor framework the same code can run in the browser and server. This is a great and powerful feature. However many functions need to only work on the client or the server. Folders app/client/ and app/server/ house these respectively.
The basic idea is that as much of the logic as possible is run on the client. This makes for a better user experience and simpler code. The server's number one priority is security. The files app/server/publications.coffee and app/server/rules.js are most important for data security.
Meteor automatically includes all code in all files to the application, there is no need to import anything specifically. Thus you are free to place code wherever you think is best.
- Meteor docs
- Vagrant
- Atmospherejs - Meteor packages
- MDN - The best Javascript reference
- Stack Overflow - For everything