hangman for the masses showcase of web tech

27
Hangman for the Masses A Showcase of Web Tech

Upload: olmo-f-maldonado

Post on 15-Apr-2017

82 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Hangman for the Masses Showcase of Web Tech

Hangman for the MassesA Showcase of Web Tech

Page 2: Hangman for the Masses Showcase of Web Tech

Who Am I• Ex-Googler• M.S. Electrical Engineering, UCLA• B.S. Electrical Engineering, UTSA• CTO, GMG Agency, LLC• MooTools Core Developer• Tech Tuesdays Organizer

Page 3: Hangman for the Masses Showcase of Web Tech

Expectations• Have fun and learn something new• Invite you to code, or pay someone to code• Appreciate Web Tech• Don’t read the code, unless you want to

Code Available on Githubgithub.com/ibolmo/hangmanapp

Page 4: Hangman for the Masses Showcase of Web Tech

Building Hangman, or An App1.Requirements2.Research3.Implementation4.Deployment5.Have a Brewski (Profit), and repeat

Page 5: Hangman for the Masses Showcase of Web Tech

Requirements (Business Logic/Specs)

• Anyone can take turns• Anyone can contribute solutions and hints• Display a running countdown• Show points accumulated• Show show animated hangman• Show spaces left to be guessed...

Page 6: Hangman for the Masses Showcase of Web Tech

Requirements (Platform/Technical Reqs.)

• Real-time updates• Broadcast updates to all players• Mobile-ready (lightweight, and responsive)• Cross-browser (Chrome, Firefox, Safari, IE)

Page 7: Hangman for the Masses Showcase of Web Tech

Research (Real-time Updates)

CurrentPrevious

Frameworks

Tech WebSocketsRefresh

Long PollingFlash

Ajax Push Engine

Page 8: Hangman for the Masses Showcase of Web Tech

Research (Real-time Updates Winner)

• Pure Javascript• Data Synchronization• Latency Compensation• Live Updates• Hot Code Pushes

I’m in no way associated with Meteor.com

meteor.comMeteor is an open-source platform for building top-

quality web apps in a fraction of the time.

Page 9: Hangman for the Masses Showcase of Web Tech

Tech Review: Node.JS nodejs.org

Arguably in Everyone’s Mind

Ruby on Rails

Node.JS

Credit: Google Trends Jan. 2012 to Oct. 2013

Page 10: Hangman for the Masses Showcase of Web Tech

Tech Review: JavaScript Language

Virtually Guaranteed a JobCredit: Google Trends Jan. 2012 to Oct. 2013

JavaScript 50,091

C++31,426

Python23,392

Ruby14,347

Page 11: Hangman for the Masses Showcase of Web Tech

Implementation• Installation and Test• Prepare Client• Prepare Models• Prepare Server• Secure• Deploy

Incoming Code

Focus on explanation, and review code later.

Page 12: Hangman for the Masses Showcase of Web Tech

hangmanapp.meteor.com

Page 13: Hangman for the Masses Showcase of Web Tech

• Mac / Linux Only (Windows coming soon™) > curl https://install.meteor.com | /bin/sh• Create project > meteor create hangman && cd hangman• Test > meteor

Installation

Page 14: Hangman for the Masses Showcase of Web Tech

Prepare Client (client.js, hangman.html)

Objective: Define client sections/content that is dynamic and programmable.

• Create your layout• Convert to template sections• Define the Templates for each section

Page 15: Hangman for the Masses Showcase of Web Tech

Prepare Client (client.js, hangman.html)

Example: How to define sections, templates, and the display logic.

Page 16: Hangman for the Masses Showcase of Web Tech

Prepare Client (model.js)

Objective: Define the data you’d like to keep.

• Optionally, define code that is shared between the client and the server.

Page 17: Hangman for the Masses Showcase of Web Tech

Prepare Models (model.js)

Example: Complete contents of the model.js file.

Page 18: Hangman for the Masses Showcase of Web Tech

Prepare Server (server.js)

Objective: Define the how the client should interact with the server, and any business logic.

• Define processing and publishing of data• Referee and arbitrate the game

Page 19: Hangman for the Masses Showcase of Web Tech

Prepare Server (server.js)

Example: Methods available to the client.

Page 20: Hangman for the Masses Showcase of Web Tech

Prepare Server (client.js, server.js)

Example: How does the guess method get called?

Page 21: Hangman for the Masses Showcase of Web Tech

Secure the ApplicationBy default the application is insecure and all clients receive a copy of all the data.

Why? Because it’s easier to develop the app.

To secure you remove the autopublish and insecure packages. Then, define what is allowed and published.

Page 22: Hangman for the Masses Showcase of Web Tech

Prepare Server (server.js, client.js)

Example: Securing the application.

Page 23: Hangman for the Masses Showcase of Web Tech

Deploy the ApplicationAs simple as running a single command > meteor deploy hangmanapp.meteor.com

Once deployed all clients will receive the latest code.

Page 24: Hangman for the Masses Showcase of Web Tech

hangmanapp.meteor.com

Page 25: Hangman for the Masses Showcase of Web Tech

• Real-Time Dashboards• Chatrooms (Help Desk/Live Chat)• Auto-Updating/Optimizing Websites• Advertising/Interactive Displays

Other Applications

Page 26: Hangman for the Masses Showcase of Web Tech

Quick-Plug: Hackathons• Bi-weekly event• 7:30 PM until bust (or 2 a.m.)• Moonbeans on 10th St.• Join Meetup group for more info:

www.meetup.com/mcallen-tech-developers

Page 27: Hangman for the Masses Showcase of Web Tech

Questions?

Olmo Maldonado@ibolmo

github.com/ibolmo

www.gmgagency.com