Coder Social home page Coder Social logo

gsvh / pwa-swr-basic Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.71 MB

Progressive Web App with offline capabilities using React, Vite, and SWR.

Home Page: https://pwa-with-swr-cache-basic-example.onrender.com/

JavaScript 2.16% HTML 1.88% CSS 13.04% TypeScript 82.92%
react swr vite

pwa-swr-basic's Introduction

React + Vite + SWR Progressive Web App

This project is a demonstration of how to build a Progressive Web App (PWA) with offline capabilities using React, Vite, and SWR.

Purpose

The purpose of this project is to demonstrate a basic progressive web application that is built with React, Vite, and SWR.

For caching static assets and pages for offline use, it uses vite-plugin-pwa.

For caching data for offline use, it uses the basic LocalStorage Based Persistent Cache example from SWR. The data being used in this example is time information from WorldTimeAPI.

Technologies

  • React: A JavaScript library for building user interfaces.
  • Vite: A build tool that aims to provide a faster and leaner development experience for modern web projects.
  • SWR: A React Hooks library for remote data fetching.

Getting Started

  1. Clone the repository
  2. Install dependencies with yarn install
  3. Start the PWA with yarn pwa (The normal development server can still be started with yarn dev, but PWA features will not be available)

Demo

https://pwa-with-swr-cache-basic-example.onrender.com

You'll see two cards, one that shows the browser time (using JavaScript Date), and one that shows the time from the API. Once you have downloaded the application, you should be able to open the application even if you have no internet connection, and see the last fetched API time.

Enjoy exploring and building upon this project!

pwa-swr-basic's People

Contributors

george-van-heerden avatar

Stargazers

 avatar

Watchers

George S van Heerden avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.