This is the code repository for Svelte 3 Up and Running, published by Packt.
A practical guide to building production-ready static web apps with Svelte 3
Svelte is a modern JavaScript framework used to build static web apps that are fast and lean, as well as being fun for developers to use. This book is a concise and practical introduction for those who are new to the Svelte framework which will have you up to speed with building apps quickly, and teach you how to use Svelte 3 to build apps that offer a great app user experience (UX).
This book covers the following exciting features:
If you feel this book is for you, get your copy today!
All of the code is organized into folders. For example, Chapter02.
The code will look like the following:
if (test expression)
{
Statement upon condition is true
}
Throughout the book, you'll be building a sample Journaling application with Svelte 3 that runs within a web browser. Like most front-end applications, the sample app comes with a back-end API server that is used to authenticate users and offer persistent storage for the data.
The easiest way to launch the API server is to download a pre-compiled binary for your platform. Pre-compiled binaries are available in this GitHub repository in the Releases section.
After downloading the archive for your platform and uncompressing it, launch the API server by double-clicking on the executable file. You should see the application running in a terminal window. You'll then be able to connect to the API server by opening http://localhost:4343
in your browser. To terminate the API server, close the terminal window.
Note for macOS users:
The pre-compiled binary is not signed with an Apple developer certificate, and Gatekeeper will refuse to run it in newer versions of macOS. If this happens to you, you will notice an error saying that the app is coming from an unidentified developer.
To run the application on macOS you can either (temporarily) disable Gatekeeper and allow unsigned applications (see the Apple Support page) or run this command:
xattr -rc path/to/application
(where
path/to/application
is the location of the downloaded binary).
If you have Docker installed on your development machine, you can run the API server with:
docker run --rm -p 4343:4343 \
-v ~/data:/data \
italypaleale/sveltebook
Where ~/data
is the path on your local machine where the API server will store persistent data.
Source code for the API server (written in Go) is present in the api-server directory, and instructions to run from source are in that folder's README file.
In the ch*
folders, you can find the sample code for each chapter of the book.
Following is what you need for this book: The book is for frontend or full-stack developers looking to build modern web apps with Svelte. Web developers with experience in leading frontend JavaScript frameworks who wish to learn Svelte will find this book useful. The book assumes a solid understanding of JavaScript and core HTML5 technologies. Basic understanding of modern frontend frameworks will be beneficial, but not necessary.
With the following software and hardware list you can run all code files present in the book (Chapter 1-7).
Chapter | Software required | OS required |
---|---|---|
1 to 7 | Node.js 10 or higher with NPM | Windows, macOS, and Linux (Any) |
6 | Microsoft Azure subscription or free trial | Windows, macOS, and Linux (Any) |
6 | GitHub Account | Windows, macOS, and Linux (Any) |
Alessandro Segala is a Product Manager at Microsoft working on developer tools. He has over a decade of experience building full-stack web applications, having worked as a professional developer as well as contributing to multiple open source projects. Alessandro is the maintainer of svelte-spa-router, one of the most popular client-side routers for Svelte 3.
Click here if you have any feedback or suggestions.
If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.