GDG Torino's PWA built with Polymer, Rollup & Workbox.
This project requires node.js and npm.
To install the necessary dependencies run:
$ npm installTo build and launch the app locally, create a .env file in the project root and provide
the following variables:
CONTENTFUL_SPACE_ID=...
CONTENTFUL_ACCESS_TOKEN=...
CONTENTFUL_MANAGEMENT_TOKEN=...
EVENTBRITE_ORG_ID=...
EVENTBRITE_TOKEN=...The following command starts Rollup compilation in watch mode and the live development server:
$ npm run startto build for production run:
$ npm run build:prodTypeScript interfaces corresponding to Content Types on Contentful can be built (or updated after changes in the CMS) using the following command:
$ npm run build:ctypesNote that this needs the CONTENTFUL_MANAGEMENT_TOKEN and CONTENTFUL_SPACE_ID variables to be set
to be set in .env to work properly.
A service worker is automatically created at build time using
workbox. To configure the SW edit workbox.config.js.
This project is already set up with Travis CI to deploy the master branch on Firebase Hosting. Follow these steps to enable CD:
Make sure to connect Travis to your website repo. See https://docs.travis-ci.com/user/tutorial/#to-get-started-with-travis-ci
In .travis.yml, in deploy > project provide the id of the Firebase project you want to deploy to.
If you dont' already have it, install the Firebase cli by running:
$ npm i -g firebase-toolsTo obtain a Firebase CI token run:
$ firebase login:cicopy the token.
Go to https://travis-ci.org/, select the website repository and go to More options > Settings.
Under "Environment variables" create the same variables as in the .env file (see configure).
Also paste the Firebase token in a variable called FIREBASE_TOKEN.
Now every time a pull request is merged to master a deploy is triggered. To configure this behavior edit .travis.yml
(see Firebase Deployment on Travis CI docs).
This project is licensed under the MIT License, see LICENSE file for details.
