Giter Site home page Giter Site logo

redfox2's Introduction

Redfox2

This application is a Progressive Web App designed to be a simple & easy way to handle online PDFs. This application was built in VueJS 2, however the core non-ui code is written in ES6 Javascript and can be re-used in whatever JS framework you desire.

Further development

Redfox2 is not 100% finished and will require some additional tweaks in order to smoothly integrate into your environment. To continue where we left off, you can look at the issues section. The issues detail the problems we have been having, what we have completed, as well as where we planned on going if we had more time.

The most important tweaks are:

  • Changing the download URLs in List.vue::created
  • Making the app check the hash (e-tag) of the PDF before downloading (this stop it from re-downloading the PDF if nothing has changed).

Gotcha's

There are a few things which need to be considered when using this project in production.

  1. PWA Checklist

    PWAs have a number of specific requirements in order for the browser to detect it as a valid PWA. Google was kind enough to make a checklist. The most important one is that the entire app MUST BE HTTPS.

  2. CORS

    The application attempts to download PDFs from URLs which you define. These URLs must either be on the same URL which the app is hosted, or you must set the appropriate headers.

    (our intention was to host PDFs in S3 and set CORS headers to allow app.tld to access the files)

Usage

There are two main methods of hosting this application.

  1. Using docker (recommended)
# build the image
docker build -t redfox2 .
# run the image
docker run -p 80:80 redfox2

The application will now be available at http://localhost:80

  1. Using a 'standard' webserver
# build the project
npm run build
# move the dist folder to your webserver
cp dist /path/to/your/webdir

Development

  1. Install the dependencies
    npm install
    
  2. Run the development server
    # this will start the development server on 8080
    npm run serve
    

Additional references

redfox2's People

Contributors

dependabot[bot] avatar djcass44 avatar

redfox2's Issues

Offline storage is broken

Data is not being recognised as already existing. Possible has to do with the mime-type it's being saved as (it's always object when it should be string)

There is leftover skeleton code

Vue CLI created unused skeleton code. I haven't removed what was created for vue-router
Since we will probably not have more than the 1 page, this code isn't required and can be safely removed.

Platform testing

Since our target platform is iOS, we need a way to make sure that everything works in Safari.
This can be done with a physical device or via the iOS simulator running on macOS (physical or in a vm)

Date timezone may not be local

new Date() seems to use UTC

Using momentjs also uses UTC. Hard coding it probably isn't the best idea because we don't know what the timezone of the end users will be

NEW successful download doesn't show until reload

Repro:

  1. Make sure storage is empty
  2. Load page
  3. Reload page after 5-10 seconds

Expected: After 2, successfully downloaded document should be available
Actual: Document isn't shown until page is reloaded

PDF opening compat is unknown

Confirmed to work:

  • Firefox 66.0.1 - Desktop

Not working

  • Chromium 73.0.3683.75 - Desktop (opens with correct URL but no content)

Tests on Safari Mobile MUST be done.

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.