Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Progressive Web Apps with React

You're reading from   Progressive Web Apps with React Create lightning fast web apps with native power using React and Firebase

Arrow left icon
Product type Paperback
Published in Oct 2017
Publisher Packt
ISBN-13 9781788297554
Length 302 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Scott Domes Scott Domes
Author Profile Icon Scott Domes
Scott Domes
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Creating Our App Structure FREE CHAPTER 2. Getting Started with Webpack 3. Our App's Login Page 4. Easy Backend Setup With Firebase 5. Routing with React 6. Completing Our App 7. Adding a Service Worker 8. Using a Service Worker to Send Push Notifications 9. Making Our App Installable with a Manifest 10. The App Shell 11. Chunking JavaScript to Optimize Performance with Webpack 12. Ready to Cache 13. Auditing Our App 14. Conclusion and Next Steps

User stories

Before we begin building our app, let's take a deeper look at what exactly we want to achieve.

We can start with user stories. A user story is a description of a specific feature of an application, framed from the perspective of one of our users.

Here's the framework, as suggested by Jon Dobrowolski:

Users should be able to _____.
As a user, I want to do ___ because ____.
Given that I'm doing ___, I should be able to ___ in order to ___.

Not all features require the whole framework, though. Let's start with some basic examples:

  • Users should be able to log in and out of the application

Pretty straightforward. I don't think we need to add the justification for this, as it is a fairly basic feature.

Let's move on to something more advanced:

  • Users should be able to view their messages even when offline
  • As a user, I want to be able to check my messages without needing an internet connection, because I may need to read them on the go
  • Given that I start the application without internet access, I should be able to view all past messages

Let's cover some of the more basic functionality of the app. Users should be able to send and receive messages in real-time.

Real-time functionality will be key to our application. There's no point in having chat unless it's fast and fluid:

  • Users should be able to view all messages by a given author
  • As a user, I want to be able to view a list of all messages sent by a given user, because I may need to view their contribution to the conversation without the noise of others' messages
  • Given that I click on a user's email, I should be taken to a profile view with all their messages

The profile view is a special feature you suggested to the client to manage the inevitable chaos of the main chat room.

Let's add a couple more PWA-specific user stories:

  • Users should receive push notifications when a message is sent by another user
  • As a user, I want to be constantly updated on the progress of the conversation, because I don't want to miss anything important
  • Given that the chat is not open or visible on my screen, I should receive notifications for each message sent by another user

And installing:

  • Users should be able to install the app on their mobile device
  • As a user, I want to be able to open the application without navigating to the URL in my browser, because I want easy access to the chat room
  • Given that I have signed up to the chat for the first time, I should be prompted to install the app on my device

Don't worry about how we will achieve these goals; we'll cover that in due time. For now, let's just continue documenting what we want to do.

Our client was big on performance, so let's specify some performance-specific goals:

  • Users should be able to load the app in under 5 seconds, even under shaky network conditions
  • As a user, I want to be able to interact with the app as quickly as possible, because I don't want to be stuck waiting for it to load
  • Given that I have opened the application using a poor internet connection, I should still have it load in under 5 seconds

Load in under 5 seconds is still a bit vague in terms of what that means for our application. We'll revisit this story in more depth in the chapters on performance.

The previously mentioned user stories cover the basic functionality of our app. Let's talk about the specific challenges these points present.

You have been reading a chapter from
Progressive Web Apps with React
Published in: Oct 2017
Publisher: Packt
ISBN-13: 9781788297554
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime