Coder Social home page Coder Social logo

abritopach / ionic-offline-mode Goto Github PK

View Code? Open in Web Editor NEW
18.0 3.0 6.0 822 KB

Sample project that shows how to build an Dogs breeds APP with offline mode that caches API data so it can be used as a fallback later.

JavaScript 5.29% TypeScript 73.41% HTML 11.89% CSS 9.40%
ionic ionic4 json-server offline-mode offline-storage offline typescript capacitor

ionic-offline-mode's Introduction

IonicOfflineMode

Sample project that shows how to build an Dogs breeds APP with offline mode that caches API data so it can be used as a fallback later. Also, we create an offline manager which stores requests made during that time so we can later send out the calls one by one when we are online again.

This project is an example created in the Devdactic Blog that have been modified by me. This project has been developed to practice my skills with the tech stack shown above.

This project shows you how to:

* Use Capacitor in Ionic 4.
* Show dogs breeds list.
* Add new dog breed.
* Handling network changes.
* Storing API requests locally.
* Making API requests with local caching.

Technologies: Ionic, Capacitor, TypeScript.

Start fake json server

    $ cd json-server
    $ json-server --watch db.json

Running

Before you go through this example, you should have at least a basic understanding of Ionic concepts. You must also already have Ionic installed on your machine.

  • Test in localhost:

To run it, cd into ionic-offline-mode and run:

npm install
ionic serve

Capacitor: Add Platforms

    $ npx cap add ios
    $ npx cap add android

Capacitor: Syncing your app

Every time you perform a build (e.g. npm run build) that changes your web directory (default: www), you'll need to copy those changes down to your native projects:

    $ npx cap copy

Capacitor: Open IDE to build

    $ npx cap open ios
    $ npx cap open android

Requirements

ionic-offline-mode's People

Contributors

abritopach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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