rapid web development, the right way

50
rapid web dev, the right way. how does go about performing

Upload: nubela

Post on 10-May-2015

549 views

Category:

Technology


3 download

DESCRIPTION

The founder of ctrleff demonstrates his methodology of web development that has evolved through the years to find the perfect balance between speed and scalability.

TRANSCRIPT

Page 1: Rapid web development, the right way

rapid web dev,the right way.

how does go about performing

Page 2: Rapid web development, the right way

$ whoami

Steven Gohctrleff

Page 3: Rapid web development, the right way

what makes it rapid?what is the right way?

Page 4: Rapid web development, the right way

1. super easy to prototypeaka, does not get in your way.

Page 5: Rapid web development, the right way

print(“hello world”)python

Page 6: Rapid web development, the right way

class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); }}

java

Page 7: Rapid web development, the right way

2. scalable

Page 8: Rapid web development, the right way

2. scalablecollaborators will not be cursing (that much) at your shitty code base

Page 9: Rapid web development, the right way

2. scalablecollaborators will not be cursing (that much) at your shitty code base

proven technology that is actually used by huge infrastructures. (no rewriting needed)

Page 10: Rapid web development, the right way

3. fun!!!!!!!!nuff said.

Page 11: Rapid web development, the right way

android dev hackathon

Page 12: Rapid web development, the right way

android dev hackathon

solo dev vs groups of 5wouldn't mind a new android tabletso... cheat!

Page 13: Rapid web development, the right way

radar = phonegap = webapp

Page 14: Rapid web development, the right way

web app = client-side + backend

Page 15: Rapid web development, the right way

web app = client-side + backend

Page 16: Rapid web development, the right way

web app = client-side + backendhtml

css

javascript

Page 17: Rapid web development, the right way

HTMLis !@$#ing ugly and boring. i also think it is verbose.

Page 18: Rapid web development, the right way

<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>

Page 19: Rapid web development, the right way

Disgusting eh?i wish...i have a pythonic html. indentation for nesting.something that's nice to work with css.

i wish...

Page 20: Rapid web development, the right way

Hello SHPAML.360 line python library.

Page 21: Rapid web development, the right way

bodydiv#wrap

div.bodycontainer#maindiv.left

> img.appimg src="/static/images/menu_less_shadow.png" div.right

div.introHello You,

div.contentdiv.graybox

span.firstRemember 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>.

Page 22: Rapid web development, the right way

CSS

Page 23: Rapid web development, the right way

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; }

Page 24: Rapid web development, the right way

Not DRY.i wish...for variables. for functions. mixins.

Page 25: Rapid web development, the right way

Hello SASS.its a gem.

Page 26: Rapid web development, the right way

bodybackground-color: #d2d2d2 .bodycontainer

width: 1200px

.leftwidth: 430pxfloat: left

.appimgwidth: 430px

.rightwidth: 770pxfloat: left

Page 27: Rapid web development, the right way

//mixins for typography

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

=content-font font-family: "Verdana"

Page 28: Rapid web development, the right way

Javascriptjust use JQuery, and you are all good.

Page 29: Rapid web development, the right way

shpaml + sass + javascript!= html + css + javascript

Page 30: Rapid web development, the right way

Hello transcompiler-watcherhttps://github.com/nubela/transcompiler-watcher

Page 31: Rapid web development, the right way

(v_env)nubela@nubela-envy:~/Workspace/ctrleff-landing-page/scripts$ ./watcher Trasnscompiling: /home/nubela/Workspace/ctrleff-landing-page/src/templates/influence.shpamlTrasnscompiling: /home/nubela/Workspace/ctrleff-landing-page/src/templates/home.shpamlTrasnscompiling: /home/nubela/Workspace/ctrleff-landing-page/src/static/css/colors.sassTrasnscompiling: /home/nubela/Workspace/ctrleff-landing-page/src/static/css/typography.sassTrasnscompiling: /home/nubela/Workspace/ctrleff-landing-page/src/static/css/main.sass

Page 32: Rapid web development, the right way

web app = client-side + backendReST

database

Page 33: Rapid web development, the right way

Backendeasy to implement ReSTFUL interfaceORMunit-testingtemplatingsuper small overhead.

Page 34: Rapid web development, the right way

Hello Flask.python microframework.

Page 35: Rapid web development, the right way

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")

declare the schema

Page 36: Rapid web development, the right way

@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 em serializable

Page 37: Rapid web development, the right way

@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!", })

make it ReSTFUL

Page 38: Rapid web development, the right way

def init_db(): from db import db db.create_all()

create the tables

Page 39: Rapid web development, the right way

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": "[email protected]", "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

write the unit-tests

Page 40: Rapid web development, the right way

web app = client-side + backend

Page 41: Rapid web development, the right way

software stack:

Page 42: Rapid web development, the right way

software stack:1. SHPAML

Page 43: Rapid web development, the right way

software stack:1. SHPAML2. SASS

Page 44: Rapid web development, the right way

software stack:1. SHPAML2. SASS3. transcompiler-watcher

Page 45: Rapid web development, the right way

software stack:1. SHPAML2. SASS3. transcompiler-watcher4. Flask + its derivatives

Page 46: Rapid web development, the right way

software stack:1. SHPAML2. SASS3. transcompiler-watcher4. Flask + its derivatives

?. virtualenv?. git

Page 47: Rapid web development, the right way

rapid web dev,the right way.

how does go about performing

Questions?

Page 48: Rapid web development, the right way

+ +

+

Page 49: Rapid web development, the right way
Page 50: Rapid web development, the right way

looking for a developers , and a marketing person.

[email protected] / @nubela / @ctrleff