Giter Site home page Giter Site logo

jgrenon / angular-desktop-app Goto Github PK

View Code? Open in Web Editor NEW
237.0 237.0 57.0 1.05 MB

This is a simple application skeleton to create desktop application using AngularJS. This application is using node-webkit as our desktop host, bower to install client-side libraries as well as normal npm modules as supported by node-webkit.

License: MIT License

CSS 92.23% JavaScript 7.77%

angular-desktop-app's People

Contributors

adiq avatar bitdeli-chef avatar jgrenon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-desktop-app's Issues

securityService injected in home controller, but missing.

The title says it all really.

Rather than remove the dependency on securityService, I think it would make sense to provide a skeleton securityService instance. One that simply returns authorised and "Guest" as username.

It seems to me that securityService is a useful design pattern to keep as a template.

I'm using this code currently:

define(['./module'], function (services) {
    'use strict';

    services.service('securityService', ['$q', function($q)  {

        this.hasValidToken = function() {

           return $q.when(true);
        };

        this.getUserInfos = function() {
            return $q.when({name: "Guest"});
        };

    }]);
});

Cross-platform build

Can i build application for all OS in a single build command?

Now i used to change this line of Gruntfile.js

nodewebkit: {
            options: {
                version: nwVer,
                build_dir: './',
                mac: false,
                win: false,
                linux32: false,
                linux64: true,
                keep_nw: false,
                zip: false,
                mac_icns:'./src/images/angular-desktop-app.icns'
            },
            src: ['./src/**/*']
        },

I'll switch the value of OS that i want to build

Cross-platform build targets via VM

Currently, the grunt-node-webkit-builder module can download and install all flavours of node-webkit (linux64/32,win,mac), but there seems to be a big problem with npm modules which use node-gyp or similar compilation steps in the install process. node-gyp can only compile (without big mods) for the current platform, which makes creating a production package pointless for any target other than your host system.

I use Vagrant (the vm manager - http://www.vagrantup.com/) a lot in day to day web development. The great thing is that the Vagrantfile (which describes the VM and provides some great chef / puppet automation) is tiny and is easily included in the skeleton. It should allow us to build for true foreign platforms (ie. 32 bit on 64 bit host, mac on windows etc).

There's probably a whole load of unit-testing coolness to be had also.

Here's what I propose:

  • Vagrantfiles for each target host in subdirectories
  • vagrant up called in each sub-directory by Grunt will provision a new VM and bring it up
  • chef will install node, npm, and will mount our releases/ folder, and make a copy of src/ excluding node_modules to the VM disk.
  • Grunt connects to the VM over SSH / winRM and executes grunt build inside the VM - the output being our mounted releases/ which will be shared with the host platform
  • Grunt then frees the VM with vagrant suspend

The build will appear in the releases/ directory, but will have been built on a different platform, so any node-gyp stuff will work.

Provisioning closed-source OS's

It'll take a bit of messing around to build for OS X or Windows as foreign targets as you'll likely need an OEM install CD to create the VM. Possibly even need VM reconfiguration (running OSX on our ESXi server took a lot of effort).

Here's some notes for future reference:

read and write files

Could you implements a service to read and write file?
You can do it with the module of nodejs named "fs", for example.

Node-webkit crashes on startup (Windows 7 x64)

Hi,

I haven't had chance to look at this issue in detail, but grunt build is failing to run on Windows 7 after pulling a fresh copy of 1.1.0(?)

I get the following terminal output:

OS: win
Running "less:./src/css/app.css" (less) task
File ./src/css/app.css created.

Running "shell:run" (shell) task
[25460:0212/215826:FATAL:render_process_host_impl.cc(420)] Check failed: !g_exit
ed_main_message_loop.

Done, without errors.

Node-webkit fires up to the point at which it renders the page, then exits, resulting in the output above.

In addition, running grunt build, and then running the executable in releases/, takes ages to start (comparatively), then causes the process to become unresponsive.

I've narrowed the issue down to mongoose (3.8.7). I guess the next step would be to see if anything similar has been reported with them.

Commenting out line 7 in src/js/services/db.js. allows node-webkit to boot.

Eg.

        // var mongoose = require('mongoose');

I'm pretty busy at the moment, but will try to have a look further into this later in the week.

Tom.

Error: [$rootScope:infdig] 10 $digest() iterations reached (after clicking on Desktop App link)

when I execute the main app using ./node-webkit ../../../../../../src (note that the path is different than the one in grunt), the first page loads ok

image

but when I click on the 'Desktop App' button, I get this error:

image

Here is the full log

[4169:1129/022447:INFO:CONSOLE(20)] ""Admin role was successfully created"", source: file:///Users/diniscruz/_Dev_Tests/node-webkit/angular-desktop-app/src/js/controllers/app.js (20)
[4169:1129/022448:INFO:CONSOLE(10103)] ""Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: [[\"fn: $locationWatch; newVal: 8; oldVal: 7\"],[\"fn: $locationWatch; newVal: 9; oldVal: 8\"],[\"fn: $locationWatch; newVal: 10; oldVal: 9\"],[\"fn: $locationWatch; newVal: 11; oldVal: 10\"],[\"fn: $locationWatch; newVal: 12; oldVal: 11\"]]\nhttp://errors.angularjs.org/1.2.27/$rootScope/infdig?p0=10&p1=%5B%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%208%3B%20oldVal%3A%207%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%209%3B%20oldVal%3A%208%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%2010%3B%20oldVal%3A%209%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%2011%3B%20oldVal%3A%2010%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%2012%3B%20oldVal%3A%2011%22%5D%5D\n    at eval (file:///Users/diniscruz/_Dev_Tests/node-webkit/angular-desktop-app/src/lib/angular/angular.js:78:12)\n    at Scope.$digest (file:///Users/diniscruz/_Dev_Tests/node-webkit/angular-desktop-app/src/lib/angular/angular.js:12666:19)\n    at Scope.$apply (file:///Users/diniscruz/_Dev_Tests/node-webkit/angular-desktop-app/src/lib/angular/angular.js:12892:24)\n    at HTMLDocument.eval (file:///Users/diniscruz/_Dev_Tests/node-webkit/angular-desktop-app/src/lib/angular/angular.js:9890:24)\n    at HTMLDocument.jQuery.event.dispatch (file:///Users/diniscruz/_Dev_Tests/node-webkit/angular-desktop-app/src/lib/jquery/dist/jquery.js:4409:9)\n    at HTMLDocument.elemData.handle (file:///Users/diniscruz/_Dev_Tests/node-webkit/angular-desktop-app/src/lib/jquery/dist/jquery.js:4095:28)"", source: file:///Users/diniscruz/_Dev_Tests/node-webkit/angular-desktop-app/src/lib/angular/angular.js (10103)
[4169:1129/022448:INFO:CONSOLE(12895)] "Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [["fn: $locationWatch; newVal: 8; oldVal: 7"],["fn: $locationWatch; newVal: 9; oldVal: 8"],["fn: $locationWatch; newVal: 10; oldVal: 9"],["fn: $locationWatch; newVal: 11; oldVal: 10"],["fn: $locationWatch; newVal: 12; oldVal: 11"]]
http://errors.angularjs.org/1.2.27/$rootScope/infdig?p0=10&p1=%5B%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%208%3B%20oldVal%3A%207%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%209%3B%20oldVal%3A%208%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%2010%3B%20oldVal%3A%209%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%2011%3B%20oldVal%3A%2010%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%2012%3B%20oldVal%3A%2011%22%5D%5D", source: file:///Users/diniscruz/_Dev_Tests/node-webkit/angular-desktop-app/src/lib/angular/angular.js (12895)

Integrate User/Role model with security service

We have a security service and new User/Role data models that aren't working together. We need to make sure the signup & login states are creating user/roles models and that we have access to the current user through the app or $root controllers.

navigation fails on file Open Cancel

When we hit the cancel button on the FileOpen dialog, we aren't notified and at the moment, there's no way to properly navigate back to a safe place (like home). Need to find a way to handle this properly. maybe use the FileSystem API instead of a hidden file input control.

[Feature request] Testing framework integration

I've been trying to add unit, midway and e2e testing by configuring karma with the mocha.js extension. However, I'm in a dead end, configuring karma with requirejs is proving to be quite confusing to me, specially with the existing codebase.

I've managed to extract the requirejs configuration object to a separate file in order to avoid repetition for the test setup.

Has anyone setup a test framework with this seed? I would greatly appreciate the help.

License?

Do you have a license in mind for this project?

NodeWebkit v0.11.6

I tried to use a newest version of node-webkit changing Gruntfile.js file line "var nwVer = '0.11.6'; //0.9.2" but application wont start.
I'm on linux x64 OS and i resolved this issue with a workaround, copy the file icudtl.dat from "/cache/linux64/0.11.6" to "/releases/MyAppName/linux64/MyAppName".

Maybe all files will not copy during grunt task.

Gruntfile + grunt-node-webkit build script

I've created a branch @ https://github.com/talss89/angular-desktop-app/tree/grunt

It's quite a major refactor in terms of the directory structure, but I think it's beneficial when managing release builds.

Here are the changes:

  • Moved application code to src/
  • Created a gruntfile
  • Integrated with grunt-node-webkit-builder
  • Removed client side LESS parser
  • Added grunt-contrib-less support on run and build. src/css/app.less -> src/css/app.css
  • Running grunt clean will delete contents of release dir
  • Bumped node-webkit to 0.8.4
  • Modified readme to include new setup / build instructions

node-webkit is now automatically downloaded and installed for your specific system when grunt install is run.

I have only tested this on a Windows (7) machine, but the logic is in the gruntfile for Mac + Linux. I've only run this through in my head. Please test if you can.

Quickstart

  1. Clone https://github.com/talss89/angular-desktop-app/tree/grunt
  2. Execute in project root npm install && grunt install
  3. grunt run to fire it up

grunt build will create a production ready package in releases/ (or at least that's the idea)

Let me know what you think!

Tom.

Jade Templating

When using extends/include in Jade, the parser silently fails because it can't handle relative paths without passing the filename in options, resulting in a white screen.

I fixed this by modifying views.js and adding a path to each template, passed to the compile method:

            templates[f.substring(0, f.length - 5)] = {
                tmplfile:fs.readFileSync(path.resolve('./views', f)),
                tmplpath: path.resolve('./views', f),
                compiled:false
            };
...
                    tmpl.tmpl = jade.compile(tmpl.tmplfile, {'filename': tmpl.tmplpath});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.