Integrating Angular.js with Node.js (Express+Tower.js) - node.js

I am new to node. I very much like approach of AngularJS. I like what I see in towerjs.
Has Anyone wired the two together? I have in mind tower primarily for backend api/rest and angular for clientside.

I'm especially not familiar with tower.js, but from the docs it looks like it might not be practical to use the two together. There is quite a bit of overlap in the things AngularJS provides and the things tower.js provides (especially models, views, and controllers on the client).
I've written on how to use AngularJS with a RESTful API provided by Express on my blog. Maybe that can help you get started.
Good luck! :)

Tower is for the server-side while angular is on the client right?
So what you could try what is mentioned here. Just replace railway with tower.
You could check this brunch.io skelleton that uses angularjs.
Hope this comes in handy mate!

As things are evolving very fast, there are some major update.
For example, a framework named Total.js has made much work to make Angular.js work in hand with Node.js.
Please have a look at their web site http://www.totaljs.com/totalstack/ and at the 6 (!) example they provide on how to use it : https://github.com/totaljs/examples.
Pretty amazing! Hope that helps!
Note: I have no affiliation with Total.js at all.

Related

Best way to make use of Server side rendering

I would like to learn Server side rendering and while searching in google,i've seen many topics about a framwork called nextjs,and after trying it,i found it pretty good.SO now i would take a serious course on SSR,but after a search on Udemy I've found a course which is rated 4.7/5 of Stephen Grider,but in the course content i've not seen next.js.Here is the course link : Server Side Rendering with React and Redux.
I don't have much experience with SSR,but it seems that there are two ways to make it:With React,redux,node/express or Next.js.
When i've tried next.js,i've not used react-router but in the description of the courses of udemy,the instructor talks about using react router.
I really need your advices before i learn it seriously,and i need to know the best solution between the 2 approches.
I guess you have done a very good research, the two options you have stated in your post are mainly the best available ones out there.
To me, if I am starting a new project, I would love to do it with React, Redux and Express.js instead of using Next.js
It will remove the complixity of learning a new thing, which is the first plus of picking that up.
I had to migrate a living 2y'o project to Next.js, the structure was a little bit not-expected for me, the routing system kinda sucked at the beginning of it, persisting layouts around the app was tiresome, forgetting about react-router was painful too.
In the course, I guess Stephen is welling to do client-side routing via react-router and implement something like express at the server-side to do SSR, I don't believe that will make it any easier.
While am saying that, it was very a interesting experience that I have gained doing the Next.js migration, I've learned a lot about SEO and SSR because of the troubles I had to run through.
I learnt to be careful about what should I use building my components and where should I use them, what packages can harm my app and what buggy bugs can prevent it from doing a correct SSR.
The smartest pick you can choose is sticking with React, Redux and Node/Express stack, instead of shifting -away- to Next.js
I have seen the contributors there doing a very great work, but, maybe am not yet sure how long they can survive!
Sorry for not being obvious on anything, just wanted to share what I thought.

MVC approach in Node.js

Currently I am working on Node.js using the MVC type of model, as it is easier to segregate the code into modules.
What I am looking for is a better approach apart from MVC, so that the code can be easily debugged and understandable.
Please advise.
I've used quite a few different frameworks but I've always found Sails.js to be the best MVC Framework for Node, easy to learn and offers a lot, its basically express with a lot of middleware but they make creating Controllers, Models and what not very easy with their CLI, you can check our more here:
http://sailsjs.org/

Start Web design with combination of html css javascript jquery and php

I know the basics of: html, css, javascript, jquery, and php. Now I want to start making interactive websites. Is there any book or tutorial that starts with all of them being used?
You could start with a common framework, start altering things and build up to developing that framework from scratch. For some php examples, Wordpress is a good option, codeigniter and cake are also good.
If you have a project in mind, you could just start from scratch and as you come along problems that you do not understand how to get around, just google the issue. It will probably bring you back here though.
You could start doing some of the tutorials at codeschool.com or teamtreehouse.com. I am sure there are tons more too!
My recomendation is to you begin to study ways to build an API with PHP beside a mysql or mongo, of course using an framework like laravel or cake. After that you need to integrate this API with a view and i recommend that you study a framework like angular or react. However, see the google search below that may helps you a lot.
https://www.google.com.br/search?sourceid=chrome-psyapi2&ion=1&espv=2&ie=UTF-8&q=angular%20laravel&oq=angular%20laravel&aqs=chrome..69i57j0l5.6098j0j7

Combining SailsJS and EmberJS (routing)

I've been using SailsJS for a while now and find it a perfect REST API solution. I'm currently building an app for both Web & Mobile (native) so I need the REST part of SailsJS. I want to build a frontend for my API right now, and I found EmberJS which looks like a promising framework. I've a question about combining those two, they both have their own Routing system, and SailsJS seems to overrule Ember's one.
My guesses would be:
The most easy approach looks like building Sails in a subdirectory
eg. /api/ but I think that's not the nicest way to get this fixed.
I could choose one framework for routing and let the other delegating it's routes. For example passing parameters from SailsJS through EmberJS
How can I use those together correctly?
Think of your backand as something you can't control, like a 3rd party API. The reason is that the optimal routing for a user may differ greatly from what's considered to be good API semantics. It's also not easy to share the route declarations, but it's not a good practice anyway.
My advice:
Use ember-cli to build the frontend. It's a great tool, you'll enjoy it a lot.
Build your Sails-based API in a different repository, using the /api namespace for your API endpoints.
Try to follow the JSON API standard as closely as possible. That'll make easier to connect your backend & frontend, as most data libraries (Ember Data for eg.) tries to adhere those standards as well.
Watch Luke Melia's excellent guide on lighning fast deployment. It'll be the same concept for you but in Sails intead of Ruby/Rails.
All in all, I think if you'll have a great dev experience if you do roughly what I've outlined above. Happy coding!

Can I use node.js with Objective-J?

I would like to write a web application using node.js and Cappuccino. I want to write the back-end in Objective-J, just like the front-end.
Can I use node.js with Objective-J? What is needed to do this?
beeing a professional Objective-J coder I can say it is definitely possible since Objective-J is fully based on JavaScript. But I also have to say that I never tried it.
I think it would be a good idea to directly start a discussion in the official Objective-J Google Group:
http://groups.google.com/group/objectivej
Check out https://bitbucket.org/clbruno/objj-node/overview

Resources