SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Downloaden Sie, um offline zu lesen
how does go about performing

rapid web dev,
the right way.
$ whoami




Steven Goh
ctrleff
what makes it rapid?
what is the right way?
1. super easy to prototype
  aka, does not get in your way.
python

print(“hello world”)
java
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}
2. scalable
2. scalable
  collaborators will not be cursing (that much) at your shitty code base
2. scalable
  collaborators will not be cursing (that much) at your shitty code base
  proven technology that is actually used by huge infrastructures. (no rewriting needed)
3. fun!!!!!!!!
   nuff said.
android dev hackathon
android dev hackathon
solo dev vs groups of 5
wouldn't mind a new android tablet
so... cheat!
radar = phonegap = webapp
web app = client-side + backend
web app = client-side + backend
web app = client-side + backend
          html
          css
          javascript
HTML
is !@$#ing ugly and boring. i also think it is verbose.
<body>
        <div id="wrap">
            <div class="bodycontainer" id="main">
                <div class="left">
                    <img src="/static/images/menu_less_shadow.png"
class="appimg" />
                </div>
                <div class="right">
                    <div class="intro">
                        Hello You,
                    </div>
                    <div class="content">
                        <div class="graybox">
                            <span class="first">
                                Remember that dingy burger place around the
remote corner that was surprisingly cheap and good ?
                            </span>
                            <span class="meneither">
                                Me Neither.
                            </span>
                            <span class="bestfriend">
                                Nor your best friend.
                            </span>
                            <span class="last">
                                Soon you can. We are <text>launching
soon</text>.
                            </span>
                        </div>
                    </div>
Disgusting eh?
i wish...
i have a pythonic html. indentation for nesting.
something that's nice to work with css.
Hello SHPAML.
360 line python library.
body
        div#wrap
            div.bodycontainer#main
                div.left
                    > img.appimg src="/static/images/menu_less_shadow.png"
                div.right
                    div.intro
                        Hello You,
                    div.content
                        div.graybox
                            span.first
                                Remember that dingy burger place around the
remote corner that was surprisingly cheap and good ?
                            span.meneither
                                Me Neither.
                            span.bestfriend
                                Nor your best friend.
                            span.last
                                Soon you can. We are <text>launching
soon</text>.
CSS
body {
  background-color: #d2d2d2; }
  body .bodycontainer {
    width: 1200px; }
    body .bodycontainer .left {
      width: 430px;
      float: left; }
      body .bodycontainer .left .appimg {
        width: 430px; }
    body .bodycontainer .right {
      width: 770px;
      float: left; }
Not DRY.
i wish...
for variables. for functions. mixins.
Hello SASS.
its a gem.
body
   background-color: #d2d2d2

  .bodycontainer
     width: 1200px

     .left
        width: 430px
        float: left

        .appimg
           width: 430px

     .right
        width: 770px
        float: left
//mixins for typography

=subheader-font
  font-family: "Trebuchet MS"

=content-font
  font-family: "Verdana"
Javascript
just use JQuery, and you are all good.
shpaml + sass + javascript
  != html + css + javascript
Hello             transcompiler-watcher
https://github.com/nubela/transcompiler-watcher
(v_env)nubela@nubela-envy:~/Workspace/ctrleff-landing-page/scripts$ ./watcher
Trasnscompiling: /home/nubela/Workspace/ctrleff-landing-
page/src/templates/influence.shpaml
Trasnscompiling: /home/nubela/Workspace/ctrleff-landing-
page/src/templates/home.shpaml
Trasnscompiling: /home/nubela/Workspace/ctrleff-landing-
page/src/static/css/colors.sass
Trasnscompiling: /home/nubela/Workspace/ctrleff-landing-
page/src/static/css/typography.sass
Trasnscompiling: /home/nubela/Workspace/ctrleff-landing-
page/src/static/css/main.sass
web app = client-side + backend
                       ReST
                       database
Backend
easy to implement ReSTFUL interface
ORM
unit-testing
templating
super small overhead.
Hello Flask.
python microframework.
declare the schema
class Ad(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    location_id = db.Column(db.Integer, db.ForeignKey('location.id'))
    location = db.relationship("Location")
    created_timestamp = db.Column(db.DateTime)
    contact_email = db.Column(db.String(255))

   #meta below
   description = db.Column(db.String(255))
   title = db.Column(db.String(255))
   price = db.Column(db.Float(asdecimal=True))
   image = db.Column(db.String(255))
   category_id = db.Column(db.Integer, db.ForeignKey('category.id'))
   category = db.relationship("Category")
make em serializable
 @property
 def serialize(self):
     return {
             "id": self.id,
             "location": self.location.serialize,
             "created_timestamp": self.created_timestamp.isoformat() ,
             "contact_email": self.contact_email,
             "description": self.description,
             "title": self.title,
             "price": str(int(self.price)),
             "image": self.image,
             "category": self.category.serialize ,
             }
make it ReSTFUL
@app.route('/ad/get', methods=['POST'])
def get_ad():
    """
    Retrieves all the information about an ad.
    """
    from db import Ad
    ad = Ad.query.get(request.form.get("id"))
    if ad:
        return jsonify({"res": ad.serialize })
    else:
        return jsonify({
                        "res": False,
                        "error": "We are unable to find any classifieds near
you!",
                        })
create the tables
def init_db():
    from db import db
    db.create_all()
write the unit-tests
def test_ad_creation(self):
        """
        Tests the API to create ads. Conveniently, also tests get ad api call.
        """
        data = {
                "long": randint(-360000000,360000000),
                "lat": randint(-360000000,360000000),
                "category": 5,
                "email": "test@test.com",
                "title": "Test Item " + random_string(),
                "price": str(randint(0,1000)),
                "image": open_file("sample_upload_pic.jpg"),
                "description": " ".join([random_string() for i in range(10)]),
                }

       #create it
       create_response = self.app.post("/ad/create", data=data)
       response_dict = json.loads(create_response.data)
       ad_id = response_dict["res"]

       #retrieve it
       res = self.app.post("/ad/get", data={"id": ad_id})
       assert "id" in res.data
web app = client-side + backend
software stack:
software stack:
1. SHPAML
software stack:
1. SHPAML
2. SASS
software stack:
1. SHPAML
2. SASS
3. transcompiler-watcher
software stack:
1. SHPAML
2. SASS
3. transcompiler-watcher
4. Flask + its derivatives
software stack:
1. SHPAML
2. SASS
3. transcompiler-watcher
4. Flask + its derivatives
?. virtualenv
?. git
how does go about performing

rapid web dev,                 Questions?
the right way.
+       +

    +
looking for a developers , and a marketing person.
        nubela@ctrleff.com / @nubela / @ctrleff

Weitere ähnliche Inhalte

Was ist angesagt?

Memcached Presentation @757rb
Memcached Presentation @757rbMemcached Presentation @757rb
Memcached Presentation @757rb
Ken Collins
 
Perlmagickを使った画像処理
Perlmagickを使った画像処理Perlmagickを使った画像処理
Perlmagickを使った画像処理
Toshimitsu YAMAGUCHI
 
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB
jhchabran
 
High Performance Django
High Performance DjangoHigh Performance Django
High Performance Django
DjangoCon2008
 
Dart : one language to rule them all - MixIT 2013
Dart : one language to rule them all - MixIT 2013Dart : one language to rule them all - MixIT 2013
Dart : one language to rule them all - MixIT 2013
Sébastien Deleuze
 

Was ist angesagt? (20)

Jquery examples
Jquery examplesJquery examples
Jquery examples
 
Temporary Cache Assistance (Transients API): WordCamp Birmingham 2014
Temporary Cache Assistance (Transients API): WordCamp Birmingham 2014Temporary Cache Assistance (Transients API): WordCamp Birmingham 2014
Temporary Cache Assistance (Transients API): WordCamp Birmingham 2014
 
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
 
Kickin' Ass with Cache-Fu (with notes)
Kickin' Ass with Cache-Fu (with notes)Kickin' Ass with Cache-Fu (with notes)
Kickin' Ass with Cache-Fu (with notes)
 
Memcached Presentation @757rb
Memcached Presentation @757rbMemcached Presentation @757rb
Memcached Presentation @757rb
 
Perlmagickを使った画像処理
Perlmagickを使った画像処理Perlmagickを使った画像処理
Perlmagickを使った画像処理
 
Модерни езици за програмиране за JVM (2011)
Модерни езици за програмиране за JVM (2011)Модерни езици за програмиране за JVM (2011)
Модерни езици за програмиране за JVM (2011)
 
Nodejs mongoose
Nodejs mongooseNodejs mongoose
Nodejs mongoose
 
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB
 
High Performance Django
High Performance DjangoHigh Performance Django
High Performance Django
 
날로 먹는 Django admin 활용
날로 먹는 Django admin 활용날로 먹는 Django admin 활용
날로 먹는 Django admin 활용
 
Perl object ?
Perl object ?Perl object ?
Perl object ?
 
Make your own wp cli command in 10min
Make your own wp cli command in 10minMake your own wp cli command in 10min
Make your own wp cli command in 10min
 
Wynn Netherland: Accelerating Titanium Development with CoffeeScript, Compass...
Wynn Netherland: Accelerating Titanium Development with CoffeeScript, Compass...Wynn Netherland: Accelerating Titanium Development with CoffeeScript, Compass...
Wynn Netherland: Accelerating Titanium Development with CoffeeScript, Compass...
 
Node.js in action
Node.js in actionNode.js in action
Node.js in action
 
Dart : one language to rule them all - MixIT 2013
Dart : one language to rule them all - MixIT 2013Dart : one language to rule them all - MixIT 2013
Dart : one language to rule them all - MixIT 2013
 
WordPress Capabilities Magic
WordPress Capabilities MagicWordPress Capabilities Magic
WordPress Capabilities Magic
 
HTML5 - Pedro Rosa
HTML5 - Pedro RosaHTML5 - Pedro Rosa
HTML5 - Pedro Rosa
 
Puppet modules for Fun and Profit
Puppet modules for Fun and ProfitPuppet modules for Fun and Profit
Puppet modules for Fun and Profit
 
Coffeescript: No really, it's just Javascript
Coffeescript: No really, it's just JavascriptCoffeescript: No really, it's just Javascript
Coffeescript: No really, it's just Javascript
 

Andere mochten auch

SUCCESS = ATTITUDE + EMOTION !
SUCCESS = ATTITUDE + EMOTION !SUCCESS = ATTITUDE + EMOTION !
SUCCESS = ATTITUDE + EMOTION !
Luis Valente
 
никуда я не хочу идти
никуда я не хочу идти  никуда я не хочу идти
никуда я не хочу идти
ko63ar
 
Aprendiendo uml en_24_horas
Aprendiendo uml en_24_horasAprendiendo uml en_24_horas
Aprendiendo uml en_24_horas
cesaraugusta
 
Capabilities short
Capabilities shortCapabilities short
Capabilities short
Taps
 
Indonesia friendly memory championship i mengasah daya ingat lewat kompetisi
Indonesia friendly memory championship i  mengasah daya ingat lewat kompetisiIndonesia friendly memory championship i  mengasah daya ingat lewat kompetisi
Indonesia friendly memory championship i mengasah daya ingat lewat kompetisi
Yudi Lesmana
 
2011 How to Prepare for the First Avenue Career & Grad School Fair
2011 How to Prepare for the First Avenue Career & Grad School Fair 2011 How to Prepare for the First Avenue Career & Grad School Fair
2011 How to Prepare for the First Avenue Career & Grad School Fair
Mary Beth Snell
 

Andere mochten auch (20)

ctrl-EFF Pitch
ctrl-EFF Pitchctrl-EFF Pitch
ctrl-EFF Pitch
 
SUCCESS = ATTITUDE + EMOTION !
SUCCESS = ATTITUDE + EMOTION !SUCCESS = ATTITUDE + EMOTION !
SUCCESS = ATTITUDE + EMOTION !
 
никуда я не хочу идти
никуда я не хочу идти  никуда я не хочу идти
никуда я не хочу идти
 
Start Smart in Russia
Start Smart in RussiaStart Smart in Russia
Start Smart in Russia
 
Aprendiendo uml en_24_horas
Aprendiendo uml en_24_horasAprendiendo uml en_24_horas
Aprendiendo uml en_24_horas
 
Louise Cohen | PROJECTS
Louise Cohen | PROJECTSLouise Cohen | PROJECTS
Louise Cohen | PROJECTS
 
Capabilities short
Capabilities shortCapabilities short
Capabilities short
 
Mary Moser: LOLcats, Celebrities, and (Red Panda) Bears -- Oh, My!!
Mary Moser: LOLcats, Celebrities, and (Red Panda) Bears -- Oh, My!!Mary Moser: LOLcats, Celebrities, and (Red Panda) Bears -- Oh, My!!
Mary Moser: LOLcats, Celebrities, and (Red Panda) Bears -- Oh, My!!
 
"Be the Thunder" Tampa Bay Lightning Case Study
"Be the Thunder" Tampa Bay Lightning Case Study"Be the Thunder" Tampa Bay Lightning Case Study
"Be the Thunder" Tampa Bay Lightning Case Study
 
Primary maker for sd36
Primary maker for sd36Primary maker for sd36
Primary maker for sd36
 
Conclusions
ConclusionsConclusions
Conclusions
 
Lorena restrepo
Lorena restrepoLorena restrepo
Lorena restrepo
 
Jayb
JaybJayb
Jayb
 
Indonesia friendly memory championship i mengasah daya ingat lewat kompetisi
Indonesia friendly memory championship i  mengasah daya ingat lewat kompetisiIndonesia friendly memory championship i  mengasah daya ingat lewat kompetisi
Indonesia friendly memory championship i mengasah daya ingat lewat kompetisi
 
Manifesto Assistenza Sessuale
Manifesto Assistenza SessualeManifesto Assistenza Sessuale
Manifesto Assistenza Sessuale
 
Economy katalog
Economy katalogEconomy katalog
Economy katalog
 
Toi theo-dao-chua, lm. doan quang, cmc
Toi theo-dao-chua, lm. doan quang, cmcToi theo-dao-chua, lm. doan quang, cmc
Toi theo-dao-chua, lm. doan quang, cmc
 
Семинар Модели автоматизации и оптимизации бизнеса
Семинар Модели автоматизации и оптимизации бизнесаСеминар Модели автоматизации и оптимизации бизнеса
Семинар Модели автоматизации и оптимизации бизнеса
 
2011 How to Prepare for the First Avenue Career & Grad School Fair
2011 How to Prepare for the First Avenue Career & Grad School Fair 2011 How to Prepare for the First Avenue Career & Grad School Fair
2011 How to Prepare for the First Avenue Career & Grad School Fair
 
Aliens in Our Uplands: Managing Past Mistakes, Preventing New Recruits
Aliens in Our Uplands: Managing Past Mistakes, Preventing New RecruitsAliens in Our Uplands: Managing Past Mistakes, Preventing New Recruits
Aliens in Our Uplands: Managing Past Mistakes, Preventing New Recruits
 

Ähnlich wie Rapid web development, the right way.

Advanced Technology for Web Application Design
Advanced Technology for Web Application DesignAdvanced Technology for Web Application Design
Advanced Technology for Web Application Design
Bryce Kerley
 
The Best (and Worst) of Django
The Best (and Worst) of DjangoThe Best (and Worst) of Django
The Best (and Worst) of Django
Jacob Kaplan-Moss
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Paulo Ragonha
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
Andy Peterson
 

Ähnlich wie Rapid web development, the right way. (20)

Advanced Technology for Web Application Design
Advanced Technology for Web Application DesignAdvanced Technology for Web Application Design
Advanced Technology for Web Application Design
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
The Best (and Worst) of Django
The Best (and Worst) of DjangoThe Best (and Worst) of Django
The Best (and Worst) of Django
 
Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7
 
Real life-coffeescript
Real life-coffeescriptReal life-coffeescript
Real life-coffeescript
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 Workshop
 
Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated Stylesheets
 
Good practices for PrestaShop code security and optimization
Good practices for PrestaShop code security and optimizationGood practices for PrestaShop code security and optimization
Good practices for PrestaShop code security and optimization
 
Jquery
JqueryJquery
Jquery
 
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programingRuby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introduction
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end Framework
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
 
Nanoformats
NanoformatsNanoformats
Nanoformats
 
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Optimising Your Front End Workflow With Symfony, Twig, Bower and GulpOptimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
 
PostgreSQL Open SV 2018
PostgreSQL Open SV 2018PostgreSQL Open SV 2018
PostgreSQL Open SV 2018
 
JavaScript for Flex Devs
JavaScript for Flex DevsJavaScript for Flex Devs
JavaScript for Flex Devs
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Rapid web development, the right way.

  • 1. how does go about performing rapid web dev, the right way.
  • 3. what makes it rapid? what is the right way?
  • 4. 1. super easy to prototype aka, does not get in your way.
  • 6. java class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); } }
  • 8. 2. scalable collaborators will not be cursing (that much) at your shitty code base
  • 9. 2. scalable collaborators will not be cursing (that much) at your shitty code base proven technology that is actually used by huge infrastructures. (no rewriting needed)
  • 10. 3. fun!!!!!!!! nuff said.
  • 12. android dev hackathon solo dev vs groups of 5 wouldn't mind a new android tablet so... cheat!
  • 13. radar = phonegap = webapp
  • 14. web app = client-side + backend
  • 15. web app = client-side + backend
  • 16. web app = client-side + backend html css javascript
  • 17. HTML is !@$#ing ugly and boring. i also think it is verbose.
  • 18. <body> <div id="wrap"> <div class="bodycontainer" id="main"> <div class="left"> <img src="/static/images/menu_less_shadow.png" class="appimg" /> </div> <div class="right"> <div class="intro"> Hello You, </div> <div class="content"> <div class="graybox"> <span class="first"> Remember that dingy burger place around the remote corner that was surprisingly cheap and good ? </span> <span class="meneither"> Me Neither. </span> <span class="bestfriend"> Nor your best friend. </span> <span class="last"> Soon you can. We are <text>launching soon</text>. </span> </div> </div>
  • 19. Disgusting eh? i wish... i have a pythonic html. indentation for nesting. something that's nice to work with css.
  • 20. Hello SHPAML. 360 line python library.
  • 21. body div#wrap div.bodycontainer#main div.left > img.appimg src="/static/images/menu_less_shadow.png" div.right div.intro Hello You, div.content div.graybox span.first Remember that dingy burger place around the remote corner that was surprisingly cheap and good ? span.meneither Me Neither. span.bestfriend Nor your best friend. span.last Soon you can. We are <text>launching soon</text>.
  • 22. CSS
  • 23. body { background-color: #d2d2d2; } body .bodycontainer { width: 1200px; } body .bodycontainer .left { width: 430px; float: left; } body .bodycontainer .left .appimg { width: 430px; } body .bodycontainer .right { width: 770px; float: left; }
  • 24. Not DRY. i wish... for variables. for functions. mixins.
  • 26. body background-color: #d2d2d2 .bodycontainer width: 1200px .left width: 430px float: left .appimg width: 430px .right width: 770px float: left
  • 27. //mixins for typography =subheader-font font-family: "Trebuchet MS" =content-font font-family: "Verdana"
  • 28. Javascript just use JQuery, and you are all good.
  • 29. shpaml + sass + javascript != html + css + javascript
  • 30. Hello transcompiler-watcher https://github.com/nubela/transcompiler-watcher
  • 31. (v_env)nubela@nubela-envy:~/Workspace/ctrleff-landing-page/scripts$ ./watcher Trasnscompiling: /home/nubela/Workspace/ctrleff-landing- page/src/templates/influence.shpaml Trasnscompiling: /home/nubela/Workspace/ctrleff-landing- page/src/templates/home.shpaml Trasnscompiling: /home/nubela/Workspace/ctrleff-landing- page/src/static/css/colors.sass Trasnscompiling: /home/nubela/Workspace/ctrleff-landing- page/src/static/css/typography.sass Trasnscompiling: /home/nubela/Workspace/ctrleff-landing- page/src/static/css/main.sass
  • 32. web app = client-side + backend ReST database
  • 33. Backend easy to implement ReSTFUL interface ORM unit-testing templating super small overhead.
  • 35. declare the schema class Ad(db.Model): id = db.Column(db.Integer, primary_key=True) location_id = db.Column(db.Integer, db.ForeignKey('location.id')) location = db.relationship("Location") created_timestamp = db.Column(db.DateTime) contact_email = db.Column(db.String(255)) #meta below description = db.Column(db.String(255)) title = db.Column(db.String(255)) price = db.Column(db.Float(asdecimal=True)) image = db.Column(db.String(255)) category_id = db.Column(db.Integer, db.ForeignKey('category.id')) category = db.relationship("Category")
  • 36. make em serializable @property def serialize(self): return { "id": self.id, "location": self.location.serialize, "created_timestamp": self.created_timestamp.isoformat() , "contact_email": self.contact_email, "description": self.description, "title": self.title, "price": str(int(self.price)), "image": self.image, "category": self.category.serialize , }
  • 37. make it ReSTFUL @app.route('/ad/get', methods=['POST']) def get_ad(): """ Retrieves all the information about an ad. """ from db import Ad ad = Ad.query.get(request.form.get("id")) if ad: return jsonify({"res": ad.serialize }) else: return jsonify({ "res": False, "error": "We are unable to find any classifieds near you!", })
  • 38. create the tables def init_db(): from db import db db.create_all()
  • 39. write the unit-tests def test_ad_creation(self): """ Tests the API to create ads. Conveniently, also tests get ad api call. """ data = { "long": randint(-360000000,360000000), "lat": randint(-360000000,360000000), "category": 5, "email": "test@test.com", "title": "Test Item " + random_string(), "price": str(randint(0,1000)), "image": open_file("sample_upload_pic.jpg"), "description": " ".join([random_string() for i in range(10)]), } #create it create_response = self.app.post("/ad/create", data=data) response_dict = json.loads(create_response.data) ad_id = response_dict["res"] #retrieve it res = self.app.post("/ad/get", data={"id": ad_id}) assert "id" in res.data
  • 40. web app = client-side + backend
  • 44. software stack: 1. SHPAML 2. SASS 3. transcompiler-watcher
  • 45. software stack: 1. SHPAML 2. SASS 3. transcompiler-watcher 4. Flask + its derivatives
  • 46. software stack: 1. SHPAML 2. SASS 3. transcompiler-watcher 4. Flask + its derivatives ?. virtualenv ?. git
  • 47. how does go about performing rapid web dev, Questions? the right way.
  • 48. + + +
  • 49.
  • 50. looking for a developers , and a marketing person. nubela@ctrleff.com / @nubela / @ctrleff