ColinOrr-Asidua / chitter

Chitter allows developers to share useful information quickly and informally using a social, micro-blogging approach.
0 stars 1 forks source link

Angular JS #11

Open ColinOrr-Asidua opened 10 years ago

ColinOrr-Asidua commented 10 years ago

Currently the front-end development is a mix of Knockout, RequireJS and Sammy.js.

We'd like to replace this with the AngularJS framework, but retaining the existing functionality and styling.

chrislaughlin commented 10 years ago

For the angular change, I think we should break the source into a client and server structure, the client should hold the angular and other JavaScript code e.g.

client/src/vendor

client/src/assets

client/src/app/

martinmicunda commented 10 years ago

Agree with Chris

AlanGibsonCivica commented 10 years ago

I think Google recommends the Angular Seed project (https://github.com/angular/angular-seed) as a good place to start - certainly they say that at the end of the official tutorial. Is there a reason to ignore that advice?

chrislaughlin commented 10 years ago

The seed project is a good tutorial but encourages bad practice by using single files for code that could run into the 100's or 1000's. An issue we noticed in our own project. On 30 Oct 2013 15:28, "Alan Gibson (Asidua)" notifications@github.com wrote:

I think Google recommends the Angular Seed project ( https://github.com/angular/angular-seed) as a good place to start - certainly they say that at the end of the official tutorial. Is there a reason to ignore that advice?

— Reply to this email directly or view it on GitHubhttps://github.com/ColinOrr-Asidua/chitter/issues/11#issuecomment-27399425 .

martinmicunda commented 10 years ago

These are the desgin patterns that we should follow https://github.com/mgechev/angularjs-style-guide and http://cliffmeyers.com/blog/2013/4/21/code-organization-angularjs-javascript

ColinOrr-Asidua commented 10 years ago

OK, this all sounds good to me.

The existing structure was based on the Express scaffolding, it's very similar to Ruby on Rails with the public folder for client side stuff. I think this is OK for MVC applications, however, separating client and server at the top level makes more sense for Single Page Apps. Ghost follows this kind of top-level structure too, and it's a serious node.js project :-).

I've added the Top-Level Directory Structure as a separate issue (see issue #16). I think you should start by getting this sorted out for the existing code, then you can start restructuring the client side as you see fit.

martinmicunda commented 10 years ago

I have posted suggestion how we could organize our code (see issue #16)

martinmicunda commented 10 years ago

During the weekend I was refactoring our code and I have realized that we need to have two view structures one on the server (jade) and another on the client (html). AngularJS has own routing and it's really powerful so it wouldn't make sense to call back-end to compile jade to html and at the moment there is nothing that could compile jade to html on the front-end (see this blog)