saas rad with django, django rest framework
TRANSCRIPT
![Page 1: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/1.jpg)
RAD on SaaS platforms: Django, Django Rest Framework and…
… a catch
Marco Montanari @ingmmo,
Modal Nodes @mnorchestra
![Page 2: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/2.jpg)
Who am I?
Marco Montanari@ingmmo, [email protected], http://www.ingmmo.com/
• Python architect, Django fanatic, Tastypie appreciator, Django Rest Framework conoisseur, pandas cuddler, GIS lifestyler
![Page 3: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/3.jpg)
Who are we?
Modal Nodes – The Software Orchestra• Lorenzo Gigli, Android + web front end dev
• Leonardo Montecchiari, iOS + IoT dev
• Jacopo Carletti, Full stack Web dev (the wrong stack starting with P...)
• Riccardo Biavati, Designer (the one that really does the heavy lifting)
• Me (Marco), Full stack dev (the right stack)
![Page 4: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/4.jpg)
The Issue
• As coders• We love to code NEW STUFF
• We hate routine
![Page 5: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/5.jpg)
The Issue
• As coders• We love to code NEW STUFF
• We hate routine
• (We would love to write our code once and have the designers changing the UI settings N+1 times)
![Page 6: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/6.jpg)
Backend Frontend
![Page 7: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/7.jpg)
A wise man's question contains half the answer.Solomon Ibn Gabirol
![Page 8: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/8.jpg)
What does the Issue express?
• We don’t want to explain the APIs we write. • We would love them to be self documenting
![Page 9: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/9.jpg)
![Page 10: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/10.jpg)
What does the Issue express?
• We don’t want to explain the APIs we write• We would love them to be self documenting
• We would love to have simple standard rules• Standard rules mean standard APIs
• Standard APIs mean standard libraries• Standard libraries mean more time
• More time means possibility to create the tool for the designer
• The time to create the tool means more time!!!
• Win!!
• It’s a matter of describing the world
![Page 11: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/11.jpg)
Backend API Frontend
![Page 12: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/12.jpg)
How do we describe our API driven world?
• Django Class based views?
• Swagger?
• Django Rest Framework?
• WSDL 2.0?
• RAML?
• WhateverML?
• WhateverON?
• UML?
• XDI?
![Page 13: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/13.jpg)
Cool! Uhm…
![Page 14: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/14.jpg)
How do we describe our API driven world?
• Django Class based views?
• Swagger?
• Django Rest Framework?
• WSDL 2.0?
• RAML?
• WhateverML?
• WhateverON?
• UML?
• XDI?
![Page 15: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/15.jpg)
Let’s go back to the basics
• Django• Class based views for APIs?
• Very loose
• Cool, but it means defining an adapter from Django to the outside world and that bringsus back to the standards slide.
• Django Rest Framework • Quite strict
• Descriptive on the actions and not as much as it could be on the data structures
• <3 OPTIONS method… what’s not to love there??
![Page 16: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/16.jpg)
Backend API FrontendDesigner
Frontend
![Page 17: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/17.jpg)
Ok cool, but…
We added 2 layers between our app and our front end…• Not cool
• Not maintainable…
UNLESS…
![Page 18: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/18.jpg)
…unless we can find a nice tool or library
• Angular4 could be a nice tool to provide a structured and meta-levelapproach to the code we are describing• Does not work well with Angular-driven editors, as of now… (we have a library
for non-drag-drop editors)
![Page 19: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/19.jpg)
…unless we can find a nice tool or library
• Angular4 could be a nice tool to provide a structured and meta-levelapproach to the code we are describing• Does not work well with Angular-driven editors
• GrapesJS
![Page 20: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/20.jpg)
GrapesJS
Pros
• Extensible
• Flexible
• Beautiful
• Easy to use for the designer
• Fun to work with for the dev
Cons
![Page 21: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/21.jpg)
GrapesJS
Pros
• Extensible
• Flexible
• Beautiful
• Easy to use for the designer
• Fun to work with for the dev
Cons
• Pure JS…
• The drag-drop elements are pure html+css (no js)
![Page 22: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/22.jpg)
GrapesJS
Pros
• Extensible
• Flexible
• Beautiful
• Easy to use for the designer
• Fun to work with for the dev
Cons
• Pure JS…
• The drag-drop elements are pure html+css (no js)
Some magic required
![Page 23: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/23.jpg)
DRF Metadata… what if…
• What if we could generate GrapesJS components from ourstandardized metadata?• A list component
• A list item component
• A detail view component
• A create/edit component
![Page 24: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/24.jpg)
Backend API FrontendDesigner
Frontend
![Page 25: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/25.jpg)
Contributions!
• Django Rest Framework Metadata Transformer
• GrapesJS data-attribute animator• (which is not bound to GrapesJS, just aptly structured to be useful with…)
• http://cdn.modal-nodes.com/libs/js/mn-grapesjs-animator.js
• Angular2+ mn-bms (Backend Management Service)• Not discussed, but it relies on the metadata to provide a set of RESTful APIs
directly to the UI
![Page 26: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/26.jpg)
FrontendBackend API FrontendDesigner
![Page 27: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/27.jpg)
DEMOIf we have time. Else, you can find a usable version on our post on Medium
![Page 28: Saas rad with django, django rest framework](https://reader033.vdocuments.net/reader033/viewer/2022050800/5a6e29747f8b9ad4678b536d/html5/thumbnails/28.jpg)
Thanks!
• Questions?
Follow us on Medium: https://medium.com/modal-nodes
Follow us on twitter: https://twitter.com/mnorchestra
Follow us on github: https://github.com/modal-nodes
Follow me on Medium: https://medium.com/sirmmo
Follow me on twitter: https://twitter.com/ingmmo
Follow me on github: https://github.com/sirmmo