Hacker News new | ask | show | jobs
Ask HN: I need your professional opinion about Angular,Node,TypeScript project
3 points by cihanduruer 4262 days ago
I am trying to create a comfortable but strong architecture for one of my Angular, Node, Typescript project. So my bootstrap project is currently working fine, but lack of my JS only app architecture knowledge, I can not feel comfortable with my implementation. Feeling something is not right but i can't find it. So my question is, please check my project and drop your general or specific comments about it. My main concern is, this architecture approach strong/flexible/enough to go further development for mid size web application.

Little bit background information, I am a senior software engineer/architect which actively working for 10+ years, mainly focused on .Net, Java, Android development stack.

Here is the project repository : https://github.com/cihanduruer/WeeMS

Test deployment to Azure : http://weems.azurewebsites.net/

Thanks for all the fish !

Cihan

3 comments

I know that you only have one controller, but I don't think it's wise to reference each and every controller in one single angular.module(...).controller() declaration... Perhaps read this: https://github.com/gocardless/angularjs-style-guide

Also, it might be worth looking at ng-annotate so you don't have to specify the array of dependencies. It's not necessary but it does help speed up development a little bit, not having to type that out all the time - it can get quite unruly sometimes. :P

Further than that, you need to implement unit testing, as well as end-to-end testing with Angular Protractor. I've been on a large scale Angular project without any testing in place, and boy did I give the lead my two cents about how much trouble that caused us. The project was delivered 2 weeks late because of buggy, untested code. Prevent this as soon as you can.

You catch a good spot, thanks ! In future i will create multiple controllers, sure depends with the logical concern.

I will read read style guide and ng-annotate.

Unit testing is crucial you are right. I need to add to seed project.

By the way what do you think about this article ? http://www.wintellect.com/blogs/jlane/five-reasons-asp.net-d...

If you're looking for a more opinionated and structured way of doing controllers then take a look at my project. It also means that you don't need to use build tools like ng-annotate.

http://davej.github.io/angular-classy/

We need to know what you're trying to build to give you a good answer.

Like CmonDev, I'm wondering why you chose this stack. If time is an issue, I'd suggest using a stack you've already mastered, even if it isn't fashionable. As long as it's not something weird, you'll be able to find other people who can work on it with you (and Java isn't weird).

Node is commonly used in hybrid stacks where the backend is initially written in something like Python, and then the REST API is written in Node to speed up requests. That takes advantage of Python's strengths and Node's strengths.

Also, the question of "how strong/versatile/useful is this foundation" is a really hard one to answer without real-world trials, and those take lots of time. I'd suggest finding someone who has written a framework using the stack of your choice and piggyback on their work. No sense reinventing the wheel.

First of all, thanks for your time.

I would like to build a single page application for one of my customer. Application is not very complex (nothing like a financial or manufacturing applications). It will be public application and possible traffic/load is completely unknown.

I choose that stack because of fashion. I would like to learn another way to develop. I am quite happy with my existing stack. If i use my stack, project can be also scale-able and asynchronous enough to create modern app.

My plan is also continue with the hybrid stack, so back-end is going to be a REST Api with ASP.Net Web Api secured with OWIN/Katana. I am planning to use new stack only for presentation layer so far.

I slightly disagree your find an existing framework and continue approach. Because in my opinion if i code everything i will learn more(i know with pain). Choosing framework/package will also take tremendous time for beginner of the stack.

Do you think learning a new stack because of a fashion is valid reason ?

> Do you think learning a new stack because of a fashion is valid reason ?

Yes!

> so back-end is going to be a REST Api with ASP.Net Web Api secured with OWIN/Katana

REST APIs are what Node is best at! You should definitely at least try to write your API in Node.

> I slightly disagree your find an existing framework and continue approach. Because in my opinion if i code everything i will learn more

You will learn more if you code everything, but you're also not learning from the wisdom of the community. Node is used in a very different way from ASP.NET, Python, PHP, etc. You should learn "the Node way". It's always better to learn how each language does things rather than trying to recreate another environment that you're already used to.

Since this is just for the presentation layer, your Node code would be absolutely tiny -- you're not going to learn very much anyway.

I'd suggest using Express. Most Node servers, especially small ones, are based on Express anyway.

Did you choose Node.js because you expect it to address the problem it is meant to address or for other reasons (fashion, learning, reduce hiring costs)?

Sorry, cannot comment on code too much as I don't have TS experience. Probably not enough code to spot any obvious problems.

We can say fashion and learning. Code doesn't contain any logic.

TS is only way of writing JavaScript. Which doesn't affect on architecture.

So I would like to hear your comment about, can i use this project as a seed project for my future projects ?

Only a small comment: where are you going to put your views? Are you going to use separate folders for views and template views (similar to WPF data templates)?
Uh Oh, my bad. I pushed the remaining files. So if you look to repository you'll see the views. Yes i have a views folder.

Sorry for inconvenience.