From Code to Scale! Build a Static Web App in Minutes

Rate this content
Bookmark

You've built an app and you want it to scale. Do you want CI/CD, custom domains, SSL certificates, APIs, global scale of your static assets, authentication, and authorization? Let's learn how to build a static web app on Azure and go from GitHub repo to global scale in minutes.

This talk has been presented at JSNation Live 2020, check out the latest edition of this JavaScript Conference.

FAQ

Azure Static Web Apps is a service that allows you to build and deploy web applications and static sites quickly and easily. It integrates features such as global distribution, custom domains, SSL certificates, authentication, and authorization, all managed from a unified workflow through GitHub Actions.

To deploy a static web app in Azure, you connect your GitHub repository to Azure Static Web Apps, configure build and deployment settings through a wizard interface, and use GitHub Actions to automate the build and deployment process. This creates a globally distributed application with performance optimizations.

Azure Static Web Apps supports multiple authentication providers including Twitter, GitHub, Azure Active Directory, Google, and Facebook. This allows users to log in using their existing accounts from these platforms.

Yes, Azure Static Web Apps allows you to set up custom domains for your applications. You can purchase a domain and configure DNS settings to point to your Azure Static Web App, enhancing your brand visibility and user trust.

In Azure Static Web Apps, serverless technology refers to Azure Functions, which are used to run backend code without managing server infrastructure. This allows you to write and deploy code that executes based on events or HTTP requests, seamlessly integrating with your static web app.

CI/CD stands for Continuous Integration and Continuous Deployment. In Azure Static Web Apps, CI/CD is implemented through GitHub Actions, automating the process of building the application from source code and deploying it to a live environment whenever changes are made to the codebase.

Azure Static Web Apps are automatically scaled and distributed globally, placing content closer to users around the world. This is managed by Azure without requiring any additional configuration from the developer, ensuring optimal performance regardless of the user's location.

Azure Static Web Apps provides automatic SSL certificates for custom domains, ensuring secure connections (HTTPS) for your web applications. This process is handled by Azure, simplifying security management without needing manual SSL certificate configuration.

John Papa
John Papa
31 min
18 Jun, 2021

Comments

Sign in or register to post your comment.

Video Summary and Transcription

The video discusses building and deploying a static web app using Azure Static Web Apps. It covers the importance of code management, CI/CD, APIs, routing, security, authentication, authorization, and global scalability. The process involves pushing code to a GitHub repo, triggering a GitHub action that builds and deploys the static content and APIs. The speaker demonstrates creating an application in the Azure Portal, connecting it to an API, and setting up authentication and authorization. The video also explains setting up custom domains, handling client-side routes, and utilizing serverless technology like Azure Functions. The talk highlights the benefits of Azure Static Web Apps, such as global distribution, integrated authentication, and ease of use for developers.

1. Introduction to Web Application Development

Short description:

You've built an application that connects people who need groceries with those who can provide them. After developing your app, you need to consider code management, CI/CD, APIs, routing, security, authentication, authorization, and global scalability. There are over 30 frameworks available for building web applications, which have fundamentally changed the development process. We now build client-side applications that run entirely in the browser, requiring a new kind of application to handle this shift.

Thank you everybody for having me here at JS Nation and for all the organizers for setting this up today. I want to start with a little story for you. You've built an application, you're a developer, this is what you do and your app connects people who need to get groceries with those people who can provide them. Now millions of people could use this today in the world so let's think about what you would need after you develop your app. Of course you need your code and you probably store it in a place like GitHub and you want to push it to GitHub so make sure that you have your code available and open source but then you also want CI CD. Do you have this to make sure you're testing it and building it and then pushing out new releases? What about your API's? Are you set up to have API's and serverless functions or a backend service or how is all that coordinated? And then you might make sure that you've got your routing set up right. So you've got your app, you've got your API's, do they talk to each other well? Do you need cores set up? What about a reverse proxy? Now you get into things like security? Do you have SSL certificates in a custom domain? Of course you want your own domain for your public website. How do you establish these and how about authentication? You want to make sure you know who the people are who are logging into their app to make sure that they are authenticated and of course authorization to make sure that the roles that they provide in your application are all established already. And what about global scale? You might be in Europe or Asia or the United States or South America, you could be anywhere and your users could also be anywhere. Does your application scale around the world? Wow, you just wanted to build an application right? You just had your code and well what did you build your code with? Did you use something like Angular or maybe you used react or possibly something newer like Svelte or maybe your view developer or something else entirely? There's over 30 different frameworks that you could be using today and I'm sure that's numbers even larger. So the tools today have fundamentally changed how we build web applications. No more do we have a server runtime that we have to produce our websites and we constantly make these page refreshes. Now we're building client-side based applications or static web apps that we use and the applications are built and then they run entirely in the browser. So we've moved these application responsibilities from the server entirely into the client and we need a fundamentally new kind of application to handle this.

2. Building and Deploying Static Web Apps

Short description:

Your build process creates static assets like HTML, JavaScript, and CSS. Traditional web servers can't handle the build steps, so a new kind of cloud service like Azure Static Web Apps is needed. With Azure Static Web Apps, you can build and host your web apps, handle authorization and authentication, utilize serverless technology with Azure Functions, and implement continuous integration and deployment. Behind the scenes, your code is pushed to a GitHub repo, triggering a GitHub action that builds and deploys the static content and APIs. The result is a globally deployed static web app. Let's dive into a demo where we create an application, connect it to an API, and cover authorization and authentication.

So your build process runs and that build process creates static assets, things like HTML, JavaScript, and CSS and then those assets have to be put up on a server somewhere which then light up your web application.

Traditional web servers don't handle the build steps that apps require, they just serve the code. We need a fundamentally new kind of cloud service to handle this and this is where tools like Azure Static Web Apps can really help you out.

So thank you for coming here today, my name is John Papa and I'm going to show you how you can build and deploy a static web app in just minutes. So let's talk about what static web apps are and how Azure Static Web Apps helps you get there. In this process you're going to see a couple different things, but to sum up, you're going to build and host your web apps. You want to build them and you want to host them, that's the key part. You might also want authorization and authentication, knowing who the users are and what they can do. You also may want to have APIs.

Most applications have data somewhere, so we're going to use serverless technology, in this case using Azure Functions. You also want to have CICD, continuous integration to continually build and test your apps, and continuous deployment to deploy your applications out either to production or maybe a preview URL so you don't take your production site down when you want to see what's happening.

All right, so enough talking about this, let's take a look at what's actually happening behind the scenes. Here we've got a GitHub repo. All of our code might be in it, and I just decided to say that my code is in an app folder, and my functions, my serverless technology, is in an API folder. You can put yours where you'd like, and then we push our code up to GitHub and maybe we make a pull request into a branch, and this fires off a GitHub action, a workflow file that then does our commands. What does that do? It runs npm run build, and then deploys the static content, or HTML, JavaScript, and CSS, up to a website, and if we have them, our APIs with Azure Functions, which are optional in this process. Then collectively, those two things become our static web apps application, and they get deployed globally around the world with multiple points of presence.

So that's what's happening behind the scenes. Now, it's time to actually see what's happening and try it ourselves. So let's go through a demo, but before we run into this, let's look at what we're going to do. We're going to create an application, and they're going to take that app, and we're going to connect it to an API. So we have our data with the application. And then we're going to cover authorization and authentication. So let's start where you start, though, and that's with your code on GitHub. We'll flip over to our application. So in our application here, we've got a GitHub repository which you can check out as well. Mine's called jsnationlive2020. And what I want to do is take this application, which you can see I've got Angular, React, Svelte, and Vue in here. Normally wouldn't run all four, but I'm going to choose Svelte today, because why not? This application is written in four different technologies, so you can try it yourself. And I'm going to run that app.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Domain Driven Design with Vue Applications
Vue.js London 2023Vue.js London 2023
14 min
Domain Driven Design with Vue Applications
Top Content
Welcome to this talk on domain-driven design in Vue.js application. Today we are going to look into domain-driven design, its benefits and how it works with Vue.js domain-driven design versus the MVVM model. Vue.js thrives in domain-driven design, a design approach that models software to match a domain. DDD emphasizes understanding business logic and creating a domain that reflects the language and concepts. Integrating DDD in Vue.js offers benefits such as effective modeling of complex business domains, structured code reflecting domain logic, and easier onboarding and ownership.
How to Share Code between React Web App and React Native Mobile App in Monorepo
React Summit 2022React Summit 2022
7 min
How to Share Code between React Web App and React Native Mobile App in Monorepo
This presentation focuses on sharing code between React web and React native mobile apps. The speaker demonstrates how to achieve feature parity using a Monorepo with NX. They highlight the importance of sharing non-UI code, such as business logic and state management, through shared libraries. This approach allows the apps to focus on UI code while keeping non-UI code separate. For more details, refer to the speaker's blog post.
Data Loaders - Elevating Data Fetching in Vue
Vue.js Live 2024Vue.js Live 2024
30 min
Data Loaders - Elevating Data Fetching in Vue
Data loaders provide a solution for complex and repetitive data fetching in Vue.js applications. Using data loaders allows for more independent data fetching and integrates with the navigation cycle. The data loader plug-in adds a navigation guard for data fetching and loading. Lazy loading and caching can be implemented using Pina Colada and Glada loaders. These loaders can improve the performance and speed of data fetching in applications.
The Next Wave of Web Frameworks is BYOJS
JSNation 2022JSNation 2022
23 min
The Next Wave of Web Frameworks is BYOJS
The next wave of web frameworks is BYOJS, covering the history and evolution of building web applications. The evolution of web frameworks and build systems includes popular choices like React, Angular, and Vue, as well as advanced build systems like Webpack and Rollup. The rise of performance measurement tools and the adoption of the Jamstack have led to improved web performance. The Jamstack architecture focuses on pre-rendering pages, decoupling APIs and services, and enhancing pages with JavaScript. Astro, a static site generator with SSR support, promotes the islands architecture and partial hydration.
MIDI in the Browser... Let's Rock the Web!
JSNation 2022JSNation 2022
28 min
MIDI in the Browser... Let's Rock the Web!
MIDI is a versatile communication protocol that extends beyond music and opens up exciting possibilities. The Web MIDI API allows remote access to synths and sound modules from web browsers, enabling various projects like music education systems and web audio-based instruments. Developers can connect and use MIDI devices easily, and the Web MIDI API provides raw MIDI messages without semantics. The WebMidi.js library simplifies working with the Web MIDI API and offers a user-friendly interface for musicians and web developers. MIDI on the web has generated significant interest, with potential for commercial growth and endless possibilities for web developers.
Using Next.JS and Redux for Epic Noscript Web Apps
React Advanced Conference 2021React Advanced Conference 2021
21 min
Using Next.JS and Redux for Epic Noscript Web Apps
This Talk explores developing web applications that work without JavaScript enabled in the browser, while still enjoying the benefits of modern web technologies. The speaker demonstrates converting an existing application to work without JavaScript by wrapping buttons in a form and preventing the default submit event. React helpers are introduced to handle async actions and the speaker shows how to make a counter app work without JavaScript by removing unnecessary callbacks and changing buttons to a button component. The talk also covers adding a form and a surprise feature, and emphasizes that by leveraging forms and an event-based store, applications can seamlessly work with or without JavaScript.

Workshops on related topic

Going on an adventure with Nuxt 3, Motion UI and Azure
JSNation 2022JSNation 2022
141 min
Going on an adventure with Nuxt 3, Motion UI and Azure
WorkshopFree
Melanie de Leeuw
Melanie de Leeuw
We love easily created and deployed web applications! So, let’s see what a very current tech stack like Nuxt 3, Motion UI and Azure Static Web Apps can do for us. It could very well be a golden trio in modern day web development. Or it could be a fire pit of bugs and errors. Either way it will be a learning adventure for us all. Nuxt 3 has been released just a few months ago, and we cannot wait any longer to explore its new features like its acceptance of Vue 3 and the Nitro Engine. We add a bit of pizzazz to our application with the Sass library Motion UI, because static design is out, and animations are in again.Our driving power of the stack will be Azure. Azure static web apps are new, close to production and a nifty and quick way for developers to deploy their websites. So of course, we must try this out.With some sprinkled Azure Functions on top, we will explore what web development in 2022 can do.
Azure Static Web Apps (SWA) with Azure DevOps
DevOps.js Conf 2022DevOps.js Conf 2022
13 min
Azure Static Web Apps (SWA) with Azure DevOps
WorkshopFree
Juarez Barbosa Junior
Juarez Barbosa Junior
Azure Static Web Apps were launched earlier in 2021, and out of the box, they could integrate your existing repository and deploy your Static Web App from Azure DevOps. This workshop demonstrates how to publish an Azure Static Web App with Azure DevOps.
How to develop, build, and deploy Node.js microservices with Pulumi and Azure DevOps
DevOps.js Conf 2022DevOps.js Conf 2022
163 min
How to develop, build, and deploy Node.js microservices with Pulumi and Azure DevOps
Workshop
Alex Korzhikov
Andrew Reddikh
2 authors
The workshop gives a practical perspective of key principles needed to develop, build, and maintain a set of microservices in the Node.js stack. It covers specifics of creating isolated TypeScript services using the monorepo approach with lerna and yarn workspaces. The workshop includes an overview and a live exercise to create cloud environment with Pulumi framework and Azure services. The sessions fits the best developers who want to learn and practice build and deploy techniques using Azure stack and Pulumi for Node.js.
Web Accessibility in JavaScript Apps
React Summit 2022React Summit 2022
161 min
Web Accessibility in JavaScript Apps
Workshop
Sandrina Pereira
Sandrina Pereira
Often we see JavaScript damaging the accessibility of a website. In this workshop, you’ll learn how to avoid common mistakes and how to use JS in your favor to actually enhance the accessibility of your web apps!
In this workshop we’ll explore multiple real-world examples with accessibility no-nos, and you'll learn how to make them work for people using a mouse or a keyboard. You’ll also learn how screen readers are used, and I'll show you that there's no reason to be afraid of using one!
Join me and let me show you how accessibility doesn't limit your solutions or skills. On the contrary, it will make them more inclusive!
By the end, you will:- Understand WCAG principles and how they're organized- Know common cases where JavaScript is essential to accessibility- Create inclusive links, buttons and toggleble elements- Use live regions for errors and loading states- Integrate accessibility into your team workflow right away- Realize that creating accessible websites isn’t as hard as it sounds ;)