Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MEAN stack template #175

Open
paulvi opened this issue Oct 21, 2014 · 6 comments
Open

MEAN stack template #175

paulvi opened this issue Oct 21, 2014 · 6 comments

Comments

@paulvi
Copy link
Member

paulvi commented Oct 21, 2014

@nodeleaf Patrick

I want to add template to quickly create MEAN app (inside New Node.js Project Wizard)

Please guide me quick. I need simple minimun set of files, like I did for Angular
see https://github.com/Nodeclipse/nodeclipse-1/tree/master/org.nodeclipse.ui/templates/hello-angularjs

@paulvi paulvi added this to the 0.18 milestone Oct 21, 2014
@ghost
Copy link

ghost commented Oct 21, 2014

There is two very different options here. What's common in both cases is a node/express app with mongodb (mongoose recommanded) data storage. It could use a jade like template engine with some levels of interactive angularjs components. Or provide a REST API to be used from a plain angularjs application. My own practice is using both actually: a public site using first case and a private admin using the latter. My point here is: I am not sure my own practice could be reduced to a simple template files set without compromising the flexibility that's inherent to the MEAN stack but we could try...

@paulvi
Copy link
Member Author

paulvi commented Oct 21, 2014

Personally, I think mixing client-side and server side processing is not good.
And especially for an example.

Do you think hello-angularjs could be good base for MEAN template?

@ghost
Copy link

ghost commented Oct 21, 2014

Do you think hello-angularjs could be good base for MEAN tamplate?

Depends on where this "base" will lead you.

You could also start from existing hello-express 4 project template, adding mongodb data storage (step 1: a node/mongodb template) then adding angularjs front end (step 2: a MEAN stack template) but it won't make much sense if it doesn't use mongodb for real - does it?

Something simple enough it could do is to extend the data dynamic binding shown here: http://nodeleaf.net/angularjs-eclipse-plugin/ - running on a node/express app (instead of apache2) and storing the user inputs as new documents into a mongodb collection on localhost? And if the template script could handle this the target collection would be capped so it won't grow infinitely...

@paulvi
Copy link
Member Author

paulvi commented Nov 28, 2014

I though maybe just package.json with all dependencies could be enough

@ghost
Copy link

ghost commented Nov 28, 2014

A package.json file will do for the back-end side of the MEAN stack: the front end being an angularjs app connecting to the back end calling a restfull API - it will not be "visible" in package.json .

A typical one below - assuming we first create an express project in Nodeclipse:

{
  "name": "meanstack",
  "version": "0.0.0",
  "private": true,
  "description": "Boilerplate mean stack project",
  "main": "app.js",
  "scripts": {
    "start": "node ./bin/www",
    "test": "echo \"Error: no test specified! Configure in package.json\" && exit 1",
  },
  "author": "",
  "license": "",
  "dependencies": {
    "express": "latest",
    "express-session": "latest",
    "body-parser": "latest",
    "cookie-parser": "latest",
    "serve-favicon": "latest",
    "morgan": "latest",
    "mongoose": "latest",
    "jade": "latest"
  }
}

I set all dependencies version above to "latest" as we don't know when it will be used but it's always possible to retrieve a given package current version like this:

$ npm show PACKAGE_NAME version

@paulvi
Copy link
Member Author

paulvi commented Nov 28, 2014

Using latest will make project vulnerable if some API changes in future.

Usually package.json has specific version,
that can be updated with npm install --save

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant