Skip to content

Commit

Permalink
major readme overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Benvie committed Jun 30, 2012
1 parent be6e153 commit c9b486f
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 94 deletions.
5 changes: 5 additions & 0 deletions CONTRIBUTORS
@@ -0,0 +1,5 @@
## Contributors

* Brandon Benvie: He helps me with CEF.
* Ali Farhadi: He helps me with AppJS.
* And all other AppJS contributors.
153 changes: 59 additions & 94 deletions README.md
@@ -1,133 +1,98 @@
# AppJS

AppJS is an SDK to develop desktop applications using node. Or at least
it is going to be!
AppJS is an SDK to develop desktop applications using Node.js melded with Chromium. With AppJS you can develop desktop tools and applications using the same libraries and knowledge used to build websites. You get all the following in one package:

The goal is to facilitate native app development using
tools every developer is familiar with nowadays: HTML/CSS/JS
* JS, HTML5, CSS, SVG, WebGL provided by Chromium
* mature http/https servers and client APIs - Node
* filesystem, dns, cryptography, subprocesses, OS APIs - Node
* sandboxed code execution environements virtual machines - Node
* tools for exposing native C++ bindings to JavaScript--APIs for authoring and the tools for compiling - Node

**Attention:** AppJS is under heavy development. API changes a lot until we bump version to v0.1.0
** Site: [appjs.org](http://appjs.org) **
** Community: [mailing list](https://groups.google.com/forum/#!forum/appjs-dev) **

![Hello World](https://github.com/milani/appjs/raw/master/examples/output.png "Hello World")

## Preinstall

You need to have node **v0.8.0** and node-gyp installed.
After [installing node](https://github.com/joyent/node/wiki/Installation), use the following command
to install node-gyp:

$ sudo npm install node-gyp -g

Please take a look at [node-gyp repository](https://github.com/TooTallNate/node-gyp/)
and make sure you have all required packages.
__AppJS is under heavy development. Expect many API changes and things to break.__

### Mac OS X users

AppJS only works with 32bit node. Please make sure by running:

$ node -e "console.log(process.arch)"
ia32
![Hello World](https://github.com/milani/appjs/raw/master/examples/output.png "Hello World")

## How to install
## Quick Start

There are ready to use appjs packages that do not need compilation.
They contain node binary file, a launcher and a simple appjs app to
help you get start.
Binary packages are available for Windows, Linux, and OS X (not for all architectures yet). These packages include everything needed to get started with AppJS, including a double clickable launcher. These packages include Node in them, they are zero dependency builds.

Download them from http://appjs.org/#download
AppJS 0.0.13 Complete Distributables:

You can also use npm to install these ready to use packages easily.
This way you only get appjs module, it doesn't include launcher.
* [Windows](http://dists.appjs.org/0.0.13/appjs-0.0.13-win32-ia32.zip) (32 bit) -> launch.exe
* [Linux](http://dists.appjs.org/0.0.13/appjs-0.0.13-linux-x64.tar.gz) (64 bit) -> launch.sh
* [Mac](http://dists.appjs.org/0.0.13/appjs-0.0.13-darwin-ia32.zip) (32 bit) -> launch.sh

$ npm install appjs

You can clone appjs repository and build it on your own. You need to have
the following dependencies installed:
## Node Install

### Linux users
__Due to the complex dependencies of AppJS installation via npm is more difficult than we'd like, be forewarned.__

$ sudo apt-get install libgtk2.0-dev
You need to have node **v0.8.0** and node-gyp installed. After [installing node](https://github.com/joyent/node/wiki/Installation), use the following command to install node-gyp:

### Windows users
$ sudo npm install node-gyp -g

You need Windows SDK and Visual Studio 2010. Take a look at node-gyp readme
to get more information.
Please take a look at [node-gyp repository](https://github.com/TooTallNate/node-gyp/) and make sure you have all required packages.

## How to use

There is a complete example in the `examples/` folder.
## Platform build requirements:

Here is a simple one:
* __Mac OS X__: Currently 32bit node only, `$ node -e "console.log(process.arch)"` -> __ia32__
* __Linux__: `$ sudo apt-get install libgtk2.0-dev`
* __Windows__: Windows SDK, DirectX SDK, and Visual C++ 2010

var appjs = require('appjs');
## Usage Overview
There is a complete example in the `examples` folder.

var window;
```javascript
var appjs = require('appjs');

// Initialize appjs.
var app = appjs.init();
var window;

// Called when page load finishes.
app.on("ready",function(){
console.log("Event Ready called");
// Initialize appjs.
var app = appjs.init();

// Runs a script in browser context.
window.runInBrowser(function(){
var body = document.body;
body.style.color="#f60";
});
// Called when page load finishes.
app.on("ready",function(){
console.log("Event Ready called");

// Show created window ( see below )
window.show();
// Runs a script in browser context.
window.runInBrowser(function(){
var body = document.body;
body.style.color="#f60";
});

// Routing:
// Show created window ( see below )
window.show();
});

// you can use a static router:
// app.use(app.staticRouter('./public'));

// or you can handle requests manually:
app.get("/",function(req,res,next){
res.send("\
<html>\
<head><title>Hello World</title></head>\
<body>Hello World</body>\
</html>\
")
});
// Routing:

// Creates a new window. Its invisible until window.show() get called.
// http://appjs/ is a special url. It is home for your application!
window = app.createWindow("http://appjs/",{autoResize:false});
// you can use a static router:
// app.use(app.staticRouter('./public'));

If you are using appjs tarballs, you can run the boilerplate application simply
by clicking launch.sh or launch.exe.
// or you can handle requests manually:
app.get("/",function(req,res,next){
res.send("\
<html>\
<head><title>Hello World</title></head>\
<body>Hello World</body>\
</html>\
")
});

## Thanks to
// Creates a new window. Its invisible until window.show() get called.
// http://appjs/ is a special url. It is home for your application!
window = app.createWindow("http://appjs/",{autoResize:false});
```

* Brandon Benvie: He helps me with CEF.
* Ali Farhadi: He helps me with AppJS.
* And all other AppJS contributors.

## License
( The MIT License )

Copyright (c) 2012 Morteza Milani and other AppJS contributors

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.
See the LICENSE file for details.

0 comments on commit c9b486f

Please sign in to comment.