Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Gina I/O - NodeJs MVC framework
JavaScript Other

README.md

Gina

Gina I/O - Node.js MVC and Event Driven framework

Node.js(100%)

Philosophy behind

Gina was designed to be accessible, flexible, scalable and maintainable. Our main purpose was to allow developpers to create easier and faster web applications.

Gina comes with essential features at this moment, but most of the things we don't have yet can be replaced by some alternatives written in other languages like: Ruby, PHP, .net, Python or C++. You are free to use such alternatives until we implement similar features.

Getting started with Gina I/O

Initializing a project

Let's create our first project and install gina.

$ mkdir myproject
$ cd myproject

You can now install the framework using npm:

$ npm install gina

Then you need to initialize your project

On Mac Os X or on Linux

$ ./gina -i myproject

on Windows from the Windows CLI - NEED TO BE ADMIN !!

$ gina -i myproject

NB: All gina commands are launched from the project root.

Creating a bundle (application)

A project is a set of bundles. Gina lets you create all kind of bundles :

  • api & webservices
  • frontend & backend applications
  • command lines

Note that the default bundle type is api.

Ok ! Let's do it !

$ gina -a frontend

We have just created a frontend application that will host our homepage. You will find all bundle sources under myproject/src.

You can start the bundle with the following command:

$ gina -s frontend dev

Now, visite http://127.0.0.1:3100/ to check your homepage. Isn't it sexy !?

If you need to stop it, just hit ctrl+c.

Adding views

The default bundle renders a json representation of a "Hello World" message.

Let's add views on our frontend

$ gina -av frontend

Now edit the init action in src/frontend/controllers/controller.js so that you can have self.render(...) instead of self.renderJSON(...)

Once it's done, you just need to refresh your browser.

Gina is shipped with Swig as the default template engine. If you are more confortable with another template engine, you can use your own.

Troubleshooting

I can't start my bundle

Are you starting for the first time ?

  • If you are a Windows user, make sure you are running your command line with sufficient permission; like "launching your terminal as administrator".

  • If you have just cloned Gina from github, don't forget to run from the project root :

$ node node_modules/gina/script/post_install.js
  • Have you noticed the environment argument ( dev ) ?
$ gina -s frontend dev

Without the dev argument, Gina is going to understand that you want to use the production environment. If it's really what you want to achieve, just build :

$ gina -b frontend prod

NB.: prod is optional here; if you don't add it, it will build for prod by default.

Are you trying to restart after a crash ?

Gina uses 2 processes today: one master, one slave (it will change very soon). Once an excepion is thrown and the program crashes, one of the 2 process can remain in the tasks/processes list. This has been mostly observed for Windows users.

  • If you are on a POSIX OS, you should look for gina, then kill it !

  • If you are on a Windows, look for node.exe or Event I/O Handler, then kill it !

After this, try again to start, it should run better.

More documentation and tutorials are coming !

License (MIT)

Copyright (c) 2009-2015 Rhinostone

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.