Coder Social home page Coder Social logo

fast-poll's Introduction

Fast Poll PWA

A fun little side project for creating polls on the fly. The goal was to make a PWA utilizing the JAMStack architectural pattern. You can find the blogposts I wrote on creating the basics of this application as well as more info on JAMStack here: part 1, part 2, and part 3.

A lighthouse report for www.fastpoll.co can be found here. Keep in mind your results may vary. Try running the test multiple times if you get differing results.

A few key points I wanted to hit on this project:

  • [x]: The application works offline. *With the exception of non-cached dynamic data.
  • [x]: Prompts users to save the application to their home screen for devices that support that functionality.
  • [x]: Statically generate the shell of the application and dynamically pull in the data.
  • [x]: Implement a backend and authentication on a static website.
  • [x]: Cache static assets via the service worker spec so that time-to-first-paint upon revists is almost instantaneous even on slow and flaky connections.
  • [x]: Make use of the PRPL Pattern (thanks to Gatsby.js) in conjuction with the App Shell Model.
  • [x]: Create a blazing fast progressive web application using React.js and several other modern front-end libraries that also performs incredibly well when it comes to SEO.

Notable tools used:

  • Gatsby.js - A react.js framework used for statically generating websites.
  • Firebase - A back-end as a service framework. I use firestore and their auth services in this application.
  • Netlify - A global CDN and a continuous deployment solution for static websites.
  • Styled Components - A react-specific css-in-js solution.
  • Redux - Flux inspired client-side state management.
  • Jest - Testing platform.
  • Prettier - Code formatting.
  • ESLint - Javascript linting. I'm using a customized version of Airbnb's ESLint rules.

Running the application

Clone the repository and run npm install.

  • For development, run npm run dev.
  • For a production build, run npm run build.

You can find the other scripts in the package.json.

Deploying the application

If you want to depoy the application, you'll have to get your own firebase web API keys and update the config object in ./src/services/firebase.js. You can find out how here.

Known issues and bugs

If you know why or how to fix any of these issues, please let me know how I can go about that or create a pull request. Thanks.

  • I'm unable to use async-await in src/ directory. During the Building static HTML for pages process when I build the application for production an error is thrown. See issue #1.
  • All pages depend on firebase.js since my provider is wrapping the application in gatsby-browser.js. Directly importing it in the ./src directory throws a webpack error. See issue #2.

A big thank you to Ted Kulakevich for help with the design.

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.