This repository has been archived by the owner on Aug 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Intro to Development
deltasquare4 edited this page May 29, 2012
·
5 revisions
The application consists currently of the following stack:
- Node.js (server side javascript server)
- Express (middleware)
- Socket.io (advanced sockets connectivity/streaming)
- MongoDB (Mongoose ODM) (nosql database)
- Jade (templating language, similar to HAML)
- redis / connect-redis (real-time in memory database for session management)
- log4js (logging library)
- LESS (css superset - adds features such as mixins and variables etc)
- http-proxy (used here to reroute calls to localhost/forum to localhost:9000 which is where the OSQA forum software is running on apache)
- http://nodeguide.com/beginner.html (A technical introduction to Node.js)
- http://www.nodebeginner.org/ (Another Node.js introduction, slightly more descriptive)
- http://howtonode.org/ (Collection of articles for understanding of specific topics)
- MongoDB
- Redis
- Apache
- OSQA Discussion forum software
- Javascript
- HTML 5
- CSS 3 Plans are being made to put a MVC framework in place, either Backbone.js, Railway.js, Flatiron.js etc) to give one page ajax like functionality
Note: Google Chrome is considered the first browser. If something works on lastest Chrome, but doesn't work on another browser, log a browser compatibility issue.
Bootstrap code resides in /server.js, which initializes the application, loads all the required modules and starts the server(s).
The main files that you will interact with during development are:
- /**
- server.js (main server file)
- configLocal.js (configuration file)
- app/ (application code)
- routes/ (URL Routes)
- models/ (Mongoose Models)
- middleware/ (Express middleware)
- views/ (Jade views)
- public/ ( client side code)
- img/ (client side images)
- javascripts/ (third party javascript)
- ace/ (ace editor)
- jplayer/ (video player)
- stylesheets/ (compiled from twitter bootstrap less files and third party stylesheets)
- views/ (jade templates rendered by the node.js server into html which are sent to the client) (partial view fragments start with an "_" and will be loaded in by ajax etc as needed in future, currently used to keep the views of a manageable size)
- test/ (Unit tests written using Mocha)
- All the routes are consolidated in routes/index.js. Routes are categorized according to their access object (e.g. course, admin, chapter etc.) and are stored in a separate file in app/routes directory. Each operation is described using a function in its specific route file.
- Models are initialized using Mongoose and are stored into their own file in app/models directory. They are initialized in server.js database section (e.g. load.init_model() calls)
- There is a global load object, which can be used to access models, controllers, helpers, middleware etc. from anywhere in the application.
- Initialize Model - load.init_model('<filename>')
- Load Model - load.model('<modelName>')
- Load Controller/Routes Object - load.controller('<filename>')
- Load Helper - load.helper('<filename>')
- Load Middleware - load.middleware('<filename>')