how to build  – 3 WEB projects  – in 1 month



how to build  – 3 WEB projects  – in 1 month

0 0


3_web_projects_in_1_month_Pres

My presentation for the second HumanTalks Grenoble

On Github Evangenieur / 3_web_projects_in_1_month_Pres

how to build 

3 WEB projects 

in 1 month

by @Evangenieur

TO BE PRODUCTIVE

Forget what you've learnED

  • Build complex system by analysis
  • Specifications -> Implementation
  • Build stable and robust System
This was systems design before the Web

Web is METASTABLE

like all living networks
  • Simple Architecture : URL / HTTP
  • Usage -> Standardization
  • Non stop evolution / endless possibilites
So let your project be Web based

Web PROJECT BASICS

One job and some paradigms like Social / Real-Time
Goal : Create Incoming and Outgoing Links
Need : an URI Mapping
That's it

Be Agile, don't try to solve non problems

  • StructureYou don't know in which way your project will evolve So keep things small and efficient
  • Data storage / persistency Iter from more flexible to lessMemory -> JSON -> NoSQL -> SQL only if needed
  • HostingBe able to move quickly from hosting solutions to another, use PaaS

HOW TO BUILD THEM QUICKLY ?

  • What are the ressources of your website ?
    Users = [{username: "Evangenieur"}]
  • What the URI mapping ?
    http://myproject.com/evangenieur
  • How can I serve it ?
    @get "/:user": ->
      @send Users.filter (user) =>
        user.username.toLowerCase() is @params.user
                

MORE COMPLEX a Nano API Server

## Data
Users = [ {
  uri_id: "evangenieur"
  username: "Evangenieur"
  channels: [
    { 
      uri_id: "my_channel"
      name: "My Channel"
      messages: []
    } ] 
  } 
]
## Data Traversal
get_user = (user_uri_id) -> 
  if user = Users.filter((user) -> user.uri_id is user_uri_id).pop()
    user.get_channel = (channel_uri_id) ->
      user.channels.filter((channel) => 
          channel_uri_id is channel.uri_id
        ).pop()
    user
## API
require("zappajs") ->
  @get "/:user/:channel": ->
    chan = get_user(@params.user)?.get_channel(@params.channel)
    if chan and @query.message?
        chan.messages.push @query.message
    @send chan || 404

  @get "/:user": ->
    @send get_user(@params.user) || 404


      
Powered by node.js / zappajs

Hackathon 24h/48h process

Goal : 1st Online web service version in 12h to 24h Dev "stable" iteration every 2 hours Merge/Deploy iteration every 4 hours past 12h

Use existing things to build non existing ones

Do not reinvent the wheel
  • Authentification using facebook / twitter / google
  • Data is everywhere build mashups
  • Be resilient use many data sources