Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Modern Web APIs with Node.js & TypeScript

Modern Web APIs with Node.js & TypeScript

Full-Stack-Development! Modern frontends are using Single-Page Applications like Angular or React communicating with some light-weight Web APIs in the background. Thanks to Node.js we can speak one language in both worlds: JavaScript … or even TypeScript! Within this session we want to take a look at building modern and light-weight Web APIs based on Node.js with TypeScript and connect to a database using an ORM called SequelizeJS. A few lines of code are needed to create a “next generation” Web API.

GitHub: https://github.com/thinktecture/frankenjs-2017-nodejs-typescript

Manuel Rauber

May 26, 2017
Tweet

More Decks by Manuel Rauber

Other Decks in Programming

Transcript

  1. Modern Web APIs with Node.js & TypeScript
    FrankenJS
    Manuel Rauber
    @manuelrauber
    Software Architect

    View Slide

  2. The guy who’s talkin’
    Software Architect @ Thinktecture AG
    ! [email protected]
    " @manuelrauber
    # https://manuel-rauber.com
    Manuel Rauber
    FrankenJS
    Modern Web APIs with Node.js & TypeScript

    View Slide

  3. Node.js & Architecture
    Building a Web API
    Modern Web APIs with Node.js & TypeScript
    FrankenJS
    Talking Points

    View Slide

  4. Modern Web APIs with Node.js & TypeScript
    FrankenJS
    Web API Architecture
    • Lightweight service-based architecture
    • Functional services with dedicated interface
    • Aggregates other services
    like database or file system
    • (JSON-based) HTTPS Web APIs
    • Application push services via WebSocket
    • Socket.io
    • SignalR
    HTTP HTTPS WebSocket
    Service A Service B Service C
    Web APIs
    (ASP.NET, Node.js, …)
    AuthN & AuthZ
    Client

    View Slide

  5. • Server-side JavaScript powered by Chrome’s V8 JavaScript engine
    • Asynchronous, event-driven I/O API
    • Cross-platform: Linux, macOS, Windows
    • ECMAScript 6 & 7 features
    • Additional tooling power via TypeScript
    • Enterprise proven: Netflix, Paypal, Groupon, Walmart
    Modern Web APIs with Node.js & TypeScript
    FrankenJS
    Node.js & TypeScript

    View Slide

  6. Modern Web APIs with Node.js & TypeScript
    FrankenJS
    Node.js
    https://nodejs.org/static/documents/casestudies/Node_CaseStudy_Nasa_FNL.pdf

    View Slide

  7. Node.js server
    Event
    Loop
    Single
    Thread
    Request
    Requests
    Request
    Async
    I/O
    Threads
    Delegate
    Non-blocking
    I/O
    Modern Web APIs with Node.js & TypeScript
    FrankenJS
    Node.js

    View Slide

  8. … by not looking at more slides ... J
    Modern Web APIs with Node.js & TypeScript
    FrankenJS
    How to build a Web API with Node.js & TypeScript?

    View Slide

  9. • Modern applications need a modern (Web API) architecture
    • Node.js & TypeScript fits well together
    • Restify for building a Web API Server
    • SequelizeJS as an ORM with Code First support
    Modern Web APIs with Node.js & TypeScript
    FrankenJS
    Summary

    View Slide

  10. • Node.js: https://nodejs.org
    • TypeScript: http://www.typescriptlang.org/
    • Restify: http://restify.com/
    • SequelizeJS: http://docs.sequelizejs.com/
    Modern Web APIs with Node.js & TypeScript
    FrankenJS
    Resources

    View Slide

  11. Thank you! Questions?
    Repository
    Manuel Rauber
    @manuelrauber
    Software Architect
    https://github.com/thinktecture/frankenjs-2017-nodejs-typescript

    View Slide