Svelte 3 Up and Running

Svelte 3 Up and Running

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

What is this book about?

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:

  • Understand why Svelte 3 is the go-to framework for building static web apps that offer great UX
  • Explore the tool setup that makes it easier to build and debug Svelte apps
  • Scaffold your web project and build apps using the Svelte framework
  • Create Svelte components using the Svelte template syntax and its APIs
  • Combine Svelte components to build apps that solve complex real-world problems

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

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
}

API server

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.

Pre-compiled binaries

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).

Run with Docker

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

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.

Book's sample code

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).

Software and Hardware List

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)

Get to Know the Author

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.

Suggestions and Feedback

Click here if you have any feedback or suggestions.

Download a free PDF

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.

https://packt.link/free-ebook/9781839213625

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes