1. The document discusses migrating a Django application to use Ember.js for the frontend instead of Django templates. It describes some limitations of using Django templates, including code being tied to the backend.
2. It provides an overview of Ember.js and what it offers, such as two-way data binding, Handlebars templates, and Ember Data for managing models.
3. The implementation section covers migrating the site page by page, including moving data and endpoints, as well as handling security with JSON web tokens and hosting on AWS.
2. Summary
1. Why Django Is Not Ideal
2. What is Ember?
3. Implementation
4. Future
5. References
3. 1/ Why Django is not
ideal for us
• Code is tied to the backend!
‣ Bypass to easily public API Endpoint
‣ AJAX endpoints are not in the Public API
• Hard to maintain while scaling our app
• Not optimized for front-end testing
4. 2.1 We chose Ember
• Powerful framework
• It is not a beta project!
‣ “Stability without Stagnation”
• Ember community is growing
‣ More tutorials / Issues resolved
• Optimized for front-end testing
5. 2.2 What is Ember.js ?
• Ember.js is a MVC (Model-View-Controller)
javascript framework
• Designed for Single Page Applications!
• Open source
6. 2.3 What Ember offers
• Two-way data binding
‣ Customers never see inaccurate data!
• Web template (Handlebars)
‣ Easy to learn and read
• Library to manage model data (Ember-Data)
‣ Structured for ease of use
‣ No need to reinvent the wheel ( AJAX handle)
8. 3.1 Migration
• Move page per page
• Steps:
1. List needed data; mock them up with http-mock!
2. Move the page to Ember & create the API endpoint
3. Switch from mock-server to a real endpoint
• Redirection between two websites:
‣ goshippo.com/user/connect/
‣ app.goshippo.com/#/connect/
9. 3.2 Security
• Authentication handled by Django
• Transform session id into JSON Web Token (JWT)
‣ Fast authentication (no Db call)
‣ Expires every 12h
• HTTPS
10. 3.3 Hosting
• Use AWS solution: s3 + Cloudfront (CDN)
• Redis as key/value store
• Cloudflare has a DNS server
• ember-cli deploy
‣ Fast deployment
‣ Rollback
‣ Preview on production of the release
11. 4/ Future
• Public endpoints
‣ Content regulation with privileges
‣ Mobile app
• 100% test coverage!
• Extreme Programming Method