This blog will help you in building and structuring an application with ember as front-end using ember-cli and integrate ember application with Catalyst MVC framework as its backend.
I am replicating this blog with the series created by DockYard for building ember application with Ruby as backend. Since I am huge fan of PERL I have setup up same ember fornt-end with Catalyst as its backend.
##Dev tools reqired for this setup
- PERL
- Catalyst
- Node 0.10.26
- npm 1.4.7
For setting up PERL and catalyst you can refer here
Next we will install ember-cli
npm install -g ember-cli
Confirm that you have ember-cli installed:
ember --version
You should see:
version: 0.0.27
or a greated version
Setting up our project
For this project we will keep our catalyst and ember front-end in seperate directories inside top-level directory.
Create a new top-level directory
mkdir emberspeakers
cd emberspeakers
Now create catalyst project
catalyst.pl EmberSpeakers
perl script/emberspeakers_create.pl View JSON JSON
mv EmberSpeakers catalyst
First create catalyst project named “emberspeakers” and create a View with JSON type.
Let’s confirm that our catalyst server runs
perl script/emberspeakers_server.pl
In your browser visit http://localhost:3000 and you should see “EmberSpeakers on Catalyst 5.90053”
Now the ember project
ember new emberspeakers
mv emberspeakers ember
Now you should have a structure like this
emberspeakers
|- ember
|- catalyst
Let’s confirm that our ember app runs:
cd ember
ember server
In your browser visit http://localhost:4200 and you should see “Welcome to Ember.js”
At this point you can put everything in your top level directory under version control:
git init
git add .
gc -m "Initial commit"
git remote add origin git@github.com:sheeju/emberspeakers.git
Here we end Part 1. In Part 2 we will focus on Ember and creating some functionality in our app.