Frank Zammetti

Modern Full-Stack Development

Using TypeScript, React, Node.js, Webpack, and Docker

Frank Zammetti
Pottstown, PA, USA
ISBN 978-1-4842-5737-1e-ISBN 978-1-4842-5738-8
© Frank Zammetti 2020
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza, New York, NY 10004. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.

Dedicated to Traci, Andrew, and Ashley – the only people I want to share a shed in the woods with when the zombies come!

(Okay, maybe not the “only” ones… but they get the good canned beans.)

Introduction

You know, when I started learning how to program, it was a piece of cake!

You’d turn on the computer and be greeted by a nice little “Ready” prompt. You’d start typing in some code (BASIC), and eventually, you’d type run, hit Enter, and watch whatever it was you put in there spit back something (my first program was a man drawn with various keyboard characters doing jumping jacks). You might save that program to a cassette – yes, kids, acassette ! – and hand it to your friends if you wanted to share.

But that was it. It was just that easy.

Nowadays, though, the story isvery different.

Writing even a trivial application now involves layers upon layers of abstractions and complexities that you must mix together, like baking the world’s most complicated cake, hoping it all works in the end. Then, should you want to distribute the technological terror you’ve constructed (sorry, Aldearan), you’ve got even more challenges to overcome.

Howanyone learns to program from scratch these days, I’m not sure!

But I’m hoping to help there!

With this book, I’m going to look at the ingredients that go into baking a cake – err, building an application – these days. To be sure, it won’t cover everything. And no one recipe is necessarily the same anyway – there are lots of choices available to a developer now. But I believe I’ve chosen the ones most commonly used to build modern full-stack applications.

What exactly is a full-stack application anyway? Well, simply put, it’s an application that includes both a front-end “client,” like a web site, and a back-end “server,” like, well, aserver ! We’re talking about building an application that combines those two halves into a coherent whole. Most application development these days is web-based in some way (where “web” doesn’t have to mean something available on the public Internet, but something built with web technologies like HTML, JavaScript, and CSS), so that’s what we’re going to be doing in this book.

To do this, we’re going to use React, which is one of the most popular libraries for building clients out there today. And we’ll use Node.js, which is a popular choice for back-end development. We’re also going to use TypeScript, a language that enhances JavaScript on both sides of the fence to make our coding lives better. We’re going to touch on several other tools that relate to all of this including Babel and Webpack. We’ll talk about some strategies for connecting the client to the server including REST and WebSockets. Finally, you’ll learn about packaging up applications using the very popular Docker.

All this will be combined to build two full, real applications. This way, it’s not just simple, contrived examples. No, it’ll be real code, practical solutions to real problems encountered in building them, and real techniques for putting all these pieces together and making sense of all this complexity.

In the end, you’ll have a solid foundation for building modern full-stack applications that you can go forward with on your own to create greatness.

I mean it’ll never be as great as my guy doing jumping jacks written in BASIC and loaded off a cassette, but you gotta have goals. ../images/491030_1_En_BookFrontmatter_Figb_HTML.gif

So let’s get to it. There’s work to be done, learning to be accomplished, and, I hope, fun to be had!

Acknowledgments

I’d like to acknowledge the exceptional team at Apress for allowing me to write not one but twelve books for them over the last decade or so. I’ve worked with so many great people, and it’s virtually impossible not to forget someone in a list like this, but among the crew for sure are Ami Knox, Arockia Rajan Dhurai, Beth Christmas, Dulcy Nirmala Chellappa, Chris Mills, Christine Ricketts, Dominic Shakeshaft, Douglas Pundick, Frank Parnell, Frank Pohlmann, Gary Cornell, Jill Balzano, Julie Miller, Katie Stence, Kelly Gunther, Kelly Winquist, Kevin Shea, Kim Wimpsett, Kimberly van der Elst, Krishnan Sathyamurthy, Laura Cheu, Laura Esterman, Leah Weissburg, Leonard Cuellar, Liz Welch, Louise Corrigan, Marilyn Smith, Michelle Lowman, Nancy Chen, Nicole Faraclas, Nirmal Selvaraj, Richard Dal Porto, Sharon Wilkey, Sofia Marchant, Stephanie Parker, Steve Anglin, Tina Nielsen, and Tracy Brown Collins.

As I said, I’m sure I’ve forgotten someone, but rest assured it was not on purpose! Thank you all for giving me a shot and allowing me to continue this journey. I most definitely could not have done it alone and I thank you all, unreservedly!

Table of Contents
Index 367
About the Author
Frank Zammetti

is an application architect for a major financial firm with nearly 25 years of professional experience (plus almost 15 years of nonprofessional experience before that). He is an author of, including this one, 12 technical books for Apress. Frank has also authored over two dozen certification exams for SHL as well as several independent articles for various publications. He is also a fiction author (shameless plug: look him up on Amazon if you like sci-fi) and a musician of some renown (and here, “some” should be taken to mean very little). Frank has been married for 25 years (to the same woman even!) and they have two children together.

 
About the Technical Reviewer
Kenneth Fukizi

is a software engineer, architect, and consultant with experience in coding on different platforms internationally. Prior to dedicated software development, he worked as a lecturer for a year and was then head of IT in different organizations. He has domain experience working with technology for companies in a wide variety of sectors. When he’s not working, he likes reading up on emerging technologies and strives to be an active member of the software community.

 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.161.132