I’m a programming beginner
I’ve built a simple blog with those. For the sake of learning I would like to use a front-end framework… I was trying to learn and use backbone at first, but our relationship wasn’t that smooth. So after struggling with it for couple of month - I’ve decided to take a look at smtn else. So it brings me here…
My question/favor is… I have an idea on how to built a simple app with express, even though I’m not sure and I didn’t try, yet - I’d like to see how ember cli would work with express.js.
I am using Sails, which sits on top of Express. It provides basic blueprints which you can modify or you can define your own custom actions through routes and controller actions. It is quite easy to set up basic Sails+Ember project, but this basic setting may be hard to develop in. I had to develop front end and back-end separately which is a pain.
Now there are some cool projects which let you run both front end and back end servers at the same time.
It comes with a slightly different approach and folder structure then sails-generate-ember and sees ember more as a 3rd Party App, similar to an iPhone or Android App, that you then can simply deploy with the server (but could also deploy separately if you choose). It now also has a generator for creating models on the backend as well as the frontend.
Anyway, it might help you out, or might also just give you an idea about how to structure the app.
Edit: I am also planning to do a youtube video on how the stack/cli exactly work.
I have recently written up a small blogging engine with an Ember front-end, using MongoDB and Express on the backend. I have yet to write a tutorial for it unfortunately, but the code is available on GitHub, in two separate projects; the frontend and backend. This may be useful to you as a reference.
The basic meat and potatoes of it is that you want to build a service that conforms to Ember-Data. You want to build an Express server that serves as an API for your data persistence solution (in this case Mongo), that will respond to the requests ember-data will make, and with responses following the right JSON conventions. The ember.js guides specify the URLs and JSON conventions ember-data requires.
EDIT: An ember-cli app automatically includes the ember-data lib, FYI
This demo project contains a basic user management and a article CRUD module. User authentication is done with ember-simple-auth on the client side. The server uses passportjs for authentication and a jws token to secure the api endpoints.
Server and client are on the same project but each starts it’s own http-server instance, that’s not ideal and I will change that. Also there is no deployment strategy for now.
I will continue to work on this project adding deployment steps and code generation for server routes, model and controllers, like ember-cli does.