Coder Social home page Coder Social logo

arlyonr / offline-first-react-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from crutchcorn/offline-first-react-app

0.0 0.0 0.0 230 KB

An offline first React app with the ability to manually diff stale data from offline clients

JavaScript 6.63% TypeScript 85.79% CSS 2.02% Astro 5.56%

offline-first-react-app's Introduction

Offline-First React App

This repo is meant to act as a proof-of-concept. As a result, it may have bugs, incomplete features, styling issues, and other problems.

This is a proof-of-concept for an offline-first React app that interacts with a server.

A list of people and the detail information about one of them

It features:

  • A React app that only needs to fetch data once a day
  • Eager loading of data when the app is online
  • A server that uses a simple JSON file as a database
  • A list view of people that are in the "database"
  • A detail view of a person that doesn't require a network request
  • A "diff" view that encourages the user to select the new data when the server updates while the app is offline

A diff view showing the changes that were made to a person's data

Getting Started

To get started, run the following commands:

yarn install
yarn dev

This will start the server and the client. The client will be available at http://localhost:3000.

How to Use It

The app is designed to be used in the following way:

  1. Open the app in a browser
  2. Disable the network connection
  3. Open a person's detail view
  4. Change the person's name
  5. Enable the network connection
  6. Watch the data be updated to the server

A list of people and the detail information about one of them

To see the diff view, follow these steps:

  1. Open the app in a browser
  2. Disable the network connection
  3. Open a person's detail view
  4. Change the person's name
  5. Open localhost:3000/updatedates in a new tab
  6. Press the "Update" button
  7. Enable the network connection on the first tab

A diff view showing the changes that were made to a person's data

Technologies Used

This app uses the following technologies:

offline-first-react-app's People

Contributors

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