docs.rodeo

MDN Web Docs mirror

CycleTracker

{{NextMenu("Web/Progressive_web_apps/Tutorials/CycleTracker/HTML_and_CSS")}} 

{{PWASidebar}} 

This intro-level tutorial walks through all the steps of building a basic progressive web app, or PWA. We will be using web technologies — HTML, CSS, and JavaScript — to build a menstruation cycle tracking web app called “CycleTracker”. Like all web apps, CycleTracker is designed to work in all browsers on all devices.

By default, PWAs are regular websites, built with the same technologies. Just like regular websites, PWAs are linkable, discoverable via search engines, and visible in a browser. By including a manifest file, and serving the website over TLS, any website can become a PWA.

We will first cover the steps of building a fully functional web app, then progressively enhance CycleTracker to make it installable, and to work even when the user is offline.

PWA benefits

Using the languages of the web, we will create a fully functioning application that works both online and offline, both in the browsers and on the user’s operating systems (OS). Like any regular website, CycleTracker is hosted on and downloadable from a web server. All we need is a text editor: CycleTracker, like all PWAs, doesn’t require any additional programming language knowledge, packaging, or proprietary SDK. CycleTracker, like any PWA, can be seamlessly installed on any operating system without the need of app stores (nor app store approval and fees).

Compared to OS-installed software applications

Once installed, PWAs can be made to appear and act similarly to other applications installed on the user’s device:

CycleTracker PWA lessons

The base web application for this PWA tutorial is a period tracker, in which the user can track the beginning and end of each menstrual cycle. We’ll create a static website shell and style it, then learn how to create a secure connection to view our progress. We’ll add JavaScript functionality converting the HTML and CSS shell into a fully functioning application storing data in localStorage. Using this fully functional web application you built, we will progressively enhance this web app into an offline capable PWA by adding a manifest file, including iconography, and a service worker.

The steps include:

To complete this tutorial, it is helpful to have a basic level of understanding of HTML, CSS, and JavaScript. The tutorial provides instructions on creating the manifest file and initiating the service worker, as well as setting up a local development environment so you can view your progress.

While a secure connection is a requirement, there are no software requirements for creating a PWA other than any text editor to code the PWA and a browser to view it.

You can try the live period tracker and view the period tracker source code on GitHub.

{{NextMenu("Web/Progressive_web_apps/Tutorials/CycleTracker/HTML_and_CSS")}} 

In this article

View on MDN