• Stars
    star
    147
  • Rank 251,347 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A beginner-focused half day workshop covering node.js

node-workshop

A beginner-level intro to node.js. For presentation slides, check out the gh-pages branch.

Challenges

Challenge One: Standard Libraries

Using node's standard libraries http and fs and built-in JSON support, read in a comma-seprated file of key-value pairs, and create an HTTP server which returns the file's contents as JSON.

Challenge Two: CommonJS Modules

Create two new CommonJS modules in a project directory. One module should expose an instantiable object called "Person". Your constructor should accept a JavaScript object literal, which will have properties to assign to the Person. Every person should have a property knowsKungFu set to false. The constructor should be able to override this. To accomplish this, install underscore from npm and use it's _.extend function in your constructor.

Your second custom module will be a custom logger, which will have an info logging function. This function should print out the current date and time, as well as the given log message.

Challenge Three: Express and Request Routing

Create an Express application which responds to an HTTP GET request, and renders an HTML page using the EJS template engine. This HTML page should contain a form, which issues a POST action to log in a user, then redirect back to the same page.

The POST action should store the user's username somehow - either in memory (store in an object) or in a cookie. On every GET request to the form, the app should check for a logged-in user using connect middleware. If the username has been stored, it should be displayed in the HTML page using a context variable for the EJS template engine.

Challenge Four: Persistence with Mongoose

Sign up for and create a free MongoDB instance at MongoHQ. Use this connection string to authorize a Mongoose application that will have a single model, a blog post with a title and a body. Using Express, create a simple application that will save a new blog post, and list out all existing blog posts on an HTML page.

Bonus Challenge

Secure the entire application with HTTP Basic Authentication middleware.

Bonus Challenge

Create an API for listing blog posts as JSON, secured with HTTP basic.

Challenge Five: Chatting with Socket.io

Create a simple chat room application using socket.io. Starting with the simple chat example, add the ability for each user to add a nickname for themselves. You will need to store some "session" information about each socket connection. Consult the socket.io docs for guidance on how to do this.

Challenge Six: Browserify

Install the browserify package from npm globally - npm install -g browserify. The file "browser.js" contains node.js-style code that uses both core node and third party modules from npm. Use the browserify command line utility to create a browser-ready version of browser.js called commandline.js, which should reside in the "public" directory of the project.

You will also want to check out the npm module browserify-middleware. This module works with express to always serve the most recent version of your browserified source, and includes source maps so you can view and debug individual files. In app.js, figure out how to use browserify-middleware to serve up a file called middleware.js to the browser, which contains the browserified contents of browser.js.

More Repositories

1

Helium

Unmaintained - check out github.com/appcelerator/alloy instead
JavaScript
135
star
2

todomvc-plusplus

TodoMVC++ Sample Application
JavaScript
93
star
3

Suds

A lightweight SOAP client library for JavaScript (no longer supported by me)
Objective-C
50
star
4

leavejoeamessage

Build Interactive Voicemail for Sports Fans
JavaScript
32
star
5

twilio-express

Twilio demo app using express
JavaScript
30
star
6

callcenter

A call center in the cloud, powered by Twilio and Parse
JavaScript
30
star
7

starfox

HTML 5 Gamepad input magically beamed to your node application via a web socket
JavaScript
29
star
8

node-spritekit

A node.js API for creating 2D games for iOS using SpriteKit
JavaScript
21
star
9

gae-chat

GAE group chat example app (Java)
Java
18
star
10

TwilioTitanium

Titanium Module and Example App for Twilio VoIP
Objective-C
18
star
11

NodeSpriteKit

iOS project (and eventual Cocopod) for node-spritekit
Objective-C
15
star
12

mobilenode

A tiny node-like environment for native mobile apps
JavaScript
10
star
13

raffler

The Raffler: A simple SMS raffle app, powered by Twilio
JavaScript
10
star
14

mobilenode-ios

A small node.js-like runtime environment for native iOS apps
Objective-C
9
star
15

mad-parse

Mobile App Distribution with Twilio and Parse
JavaScript
9
star
16

appcelerator_mq

Cross-library implementation of the Appcelerator Message Queue
JavaScript
8
star
17

groupeditor

A group text editor using socket.io and Twilio
JavaScript
7
star
18

grace

Grace Framework - A hybrid Java/JavaScript framework for RESTful web applications
JavaScript
7
star
19

kv_and_you

Demo app for Kevin's "Key/Value Databases and You" workshop
TypeScript
6
star
20

operator

A Twilio-powered desktop soft phone and communications app for developers.
JavaScript
6
star
21

gopher

Gopher Express is an opinionated flavor of express (expressjs.com)
JavaScript
6
star
22

template-example

Example app to demonstrate re-use of Jade templates between client and server
JavaScript
4
star
23

vue-basics

A basic Vue.js 2.0 starter app for Node.js
JavaScript
4
star
24

deno-hono-vite-template

WIP: Template project for a web app project using Hono and Vite
TypeScript
4
star
25

twilio-raw

A demo twilio node app, using just the low-level HTTP APIs
JavaScript
4
star
26

ogson

Original Gangster Object Notation
JavaScript
4
star
27

twilio-parse

Twilio helper library for Parse Cloud Code
JavaScript
3
star
28

better-know-frameworks

Source for the "Better Know Your Web Frameworks" game show at Deno Fest 2023 in Tokyo
JavaScript
3
star
29

twilio-workshop

The Twilio Workshop
Ruby
3
star
30

fetchling

Declaratively build fluent REST API clients
TypeScript
2
star
31

tyrion

An SMS chat server that's kind of like IRC, but not really.
JavaScript
2
star
32

deno-astro-adapter

Patched version of the built-in Astro SSR adapter for Deno
2
star
33

deno_courier_example

A sample application that schedules future Courier notifications using the Deno queue API
TypeScript
2
star
34

murphytext

demo app for texting in a keyword and getting a link back
JavaScript
2
star
35

jumpstart

Twilio Jumpstart Workshop Starter Projects
PHP
2
star
36

kevin.mn

Source code for the website of the same name
JavaScript
2
star
37

echobase-node

coming soon
JavaScript
1
star
38

flutterfox

HTML
1
star
39

uppercase

Make strings angry on JSR
TypeScript
1
star
40

video-quickstart-swift

Twilio Video quickstart app in Swift
Swift
1
star
41

java-example

Java example app prototype
Java
1
star
42

sms-interview

A general purpose SMS interview platform, with an emphasis on collecting report data from areas underserved by Internet connectivity
JavaScript
1
star
43

simple_api_server

A simple API server demo for the Deno docs
TypeScript
1
star
44

buzz

An npm installable version of the Buzz HTML 5 Audio Library (http://buzz.jaysalvat.com/)
JavaScript
1
star
45

openai_tutorials

A collection of code snippets and short tutorials for OpenAI
TypeScript
1
star