MEAN.JS Cannot connect MongoDB - javascript

I am newbie here, starting to learn MEAN.JS, As I installed everything and tried to run
grunt --force
on the command line, it returns an error like the image below.
Im using windows here and also I already installed MongoDB on the C:/Program Files path. Thanks in advance! :)

Getting started with the MEAN stack might seem very daunting at first. You might think that there is too much new technology to learn. The truth is that you really only need to know “Javascript.” That’s right, MEAN is simply a javascript web development stack.
So, how do you actually get started developing on the MEAN stack?
The first step is to set up a project structure. I’ve found the following structure to make the most sense:
controllers/ db/ package.json server.js public/
This structure lets you keep the entire stack in a single project. Your AngularJS front end can go into the public folder while all your Express API logic goes into controller and your MongoDB collections and logic go into the db folder.
Now that you’ve set up a general project structure, you need to initialize your public folder as an Angular project. It is best to do this using a tool called Yeoman.
Yeoman is a toolkit that makes it easy for you to get started with a variety of Javascript frameworks and other web frameworks like Bootstrap and foundation. You can learn more about Yeoman at Yeoman.io.
Installing Yeoman is pretty straightforward.
You can read more here: http://www.citizentekk.com/mean-stack-tutorial-how-to-build-loosely-coupled-scalable-web-apps-nodejs-angularjs-applications/

Related

NPM build confusion

I am new to working with NPM/Webpack build flow for frontend development. I've read through some tutorials and have helped some, but I have a few questions if someone can help explain them better.
When I start a new project, I think of it a singular component to my bigger project (website in this case). When I setup npm within my project folder it installs 80MB of packages. When I build my little hello, world example - I get a 172KB dist.js file.
Seems like everything is getting packed in there.
So my question is how to not include the kitchen sink and just my requirements for this project?
And also, if I build a similar project with the same requirements, how do I make sure I don't have 2 of the same libraries loaded within a webpage for example, I would want 'lodash' loaded only once.
Thanks
Rich

Add NodeJS backend code to an Angular-seed based project

I recently abandoned the awesome LAMP solution for Node/AngularJS and I have some serious (and noob) difficulties to begin.
I took an existing AngularJS project based on Angular Seed and I didn't figure out how can I add some backend javascript code.
In online tutorials, I always find an app.js file, in which there is some "requires" and where I can add an extra server code. To launch this kind of project I have to node app.js
In my Angular-seed based project, there is only a package.json that contains script commands.
Also, I noticed that to launch it, I have to npm start.
Where can I put my NodeJS code in this project ?
Thanks in advance !
Usually you will have two differents projects. The backend (Nodejs) and the frontend (Angular). You can expose your backend logic using a public API that your frontend will use. For example you can expose a REST API using nodejs with help of express. I recommend you to take a look at swagger that can help you to define your api.
After that using your angular app you can send different requests to that API and consume the info that receive from it.
To sum up you will have two different projects. Hope this helps

workflow and tools for meteor

I'm about to start digging into Meteor for real (instead of just reading about it). I'm a near-complete noob but I've at least determined I'm going to use Sublime Text as my editor vs webstorm. I know I need a git account (going Bitbucket there). What else?
Are yeoman, grunt, and bower, (and lineman?) which seem like the workflow tools of the day, also necessary for writing a non-trivial app? It seems like Meteor already does a lot of the main functionality of these tools.
Do I need a testing suite like Jasmine (at least to get started?)
Anything else I'm missing? I just want to get everything I need (yes, including a couple good Javascript books) before I start.
You'll need the basic elements you already have (node, npm, git and ruby). You seem to know a little bit about web apps so I'll try analogies.
Yeoman essential purpose is to scaffold, meteor will do a really basic scaffolding for you. If you want to have a more advanced scaffold tool I encourage you to try em : https://github.com/EventedMind/em by Chris matter.
Grunt basic tasks equivalents are handled by the meteor commands (server, livereload, build, deploy...)
Bower is a package manager, I highly encourage you to use meteorite and its repo atmosphere (https://atmospherejs.com/) as your package manager. Actually, meteorite commands (mrt) are going to replace meteor commands in your projects. Eventually, atmosphere and meteorite are going to be fold into the core of meteor. (see meteor roadmap : https://trello.com/b/hjBDflxp/meteor-roadmap)
(note that you can use npm packages to)
All the essential functionalities of Lineman are handled by meteor.
However, some tasks are NOT handled by meteor.
I run the classic compass watch on my sass folder.
A good testing framework for meteor is Laika : http://arunoda.github.io/laika/
To start, you can go to discover meteor : https://www.discovermeteor.com/. For more advanced learning; go to evented mind : https://www.eventedmind.com/
The first thing you want to learn is how to handle iron-router
EDIT
There is now two major resources to start :
https://guide.meteor.com/
https://themeteorchef.com/
Iron router has been replaced by flow router ; there is a guide to use it :
https://kadira.io/academy/meteor-routing-guide
To manage scss :
https://atmospherejs.com/fourseven/scss
The view layer :
React replaced Blaze

Yeoman setup for client + server project

I'm developing a framework based on "Scalable Javascript Application Architecture" with modules that should be able to run both on the server (node) as well as the client.
I'm looking for a good project set-up/bootstrap where client and server-side could be developed/build/tested separately while still making use of some shared resources such as the mentioned modules.
I like Yeoman for a clientside setup, and it seems that yeoman is extending it's reach to include scaffolds for server-side stuff although this is still somewhat experimental.
However, to this day I 've yet to find a project setup that combines server + client setup as described above.
Any pointers, github test project, etc. highly appreciated.
You might want to take a look at this experimental branch the Yeoman team are working on:
http://github.com/yeoman/yeoman/tree/express-stack

Is there a "standard" way to publish open source javascript files

Coming from the java/maven world where everything goes under a "src/main" folder I looked around to see if a similar approach is followed in javascript. However all the main repo's seem to be following their own. Is there a standard folder structure with which I can publish my javascript files? Is the community at least "leaning" towards some such structure or template?
JQuery
Backbone
TJ Holowaychuk started "Component" as a structured way of sharing/deploying UI components with traced dependencies. Similar to the way NPM is for NodeJS modules.
https://github.com/component
Now it seems that Bower is taking over and is the new the way to go.

Categories

Resources