Coder Social home page Coder Social logo

preact-book-example's Introduction

preact-book-example

Check out the book that uses the code in this repo: https://bleedingedgepress.com/progressive-web-apps-with-preact/

Yet another Hacker News PWA

Development

Serving the development build with hot reload on localhost:8080

$ npm run dev

Serving a production build locally

$ npm run serve

Running Unit (Jest) Tests

$ npm test

Running End-to-end tests

You need to start the local production build manually prior to running e2e tests.

$ npm run serve

And in another terminal window:

$ npm run test:e2e

Deploying with Firebase

You will first need to have an account on Firebase. To register, visit https://firebase.com/

Once registered, install firebase-tools available on npm.

$ npm i -g firebase-tools

firebase-tools contains a wide array of commands to interact with your Firebase account. You'll only need a few for deployment. Before we do that, we'll need to authenticate via the command-line.

$ firebase login

A new browser window/tab will pop up and you will need to authenticate via Google SSO. Once authenticated, you can close your browser window and head back to the terminal to initialize your new Firebase app.

$ firebase init

This will generate a .firebaserc and an empty firebase.json file in your current project directory which will be replaced via preact-cli auto-generated firebase.json config.

$ preact serve -- server config

Once your firebase.json is populated by preact-cli, simply deploy like so:

$ firebase deploy

As a convenience, you can also run npm run deploy which will rebuild the firebase.json and run firebase deploy

$ npm run deploy

For detailed explanation on how things work, checkout the CLI Readme.

preact-book-example's People

Contributors

vutran avatar download avatar troymott avatar oskarhane 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.