https://github.com/simonh1000/elm-firebase-demo
Elm PWA with Firebase database, messaging and functions
https://github.com/simonh1000/elm-firebase-demo
Last synced: about 2 months ago
JSON representation
Elm PWA with Firebase database, messaging and functions
- Host: GitHub
- URL: https://github.com/simonh1000/elm-firebase-demo
- Owner: simonh1000
- Created: 2017-05-18T19:36:55.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T19:32:14.000Z (over 2 years ago)
- Last Synced: 2024-04-14T02:53:38.131Z (about 1 year ago)
- Language: Elm
- Homepage:
- Size: 2.23 MB
- Stars: 30
- Watchers: 3
- Forks: 3
- Open Issues: 30
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PWA featuring Firebase database & messaging with Elm frontend
An Elm experiment to use Firebase to provide a real time Xmas present idea exchange between a family group. Register, set up your present wishes and claim what you want to buy for others.
## Installation
You need to provide 3 files
### `/src/assets/config/firebase-config.js`
```js
export var firebaseConfig = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: ""
};
```### src/Firebase/fbsw.config.js
```
var prod = {
messagingSenderId: "12345",
url: "https://xxxxxxx.firebaseapp.com/"
};
self.config = self.config || dev;
```.... and connect the cloud functions code to the admin sdk, following https://firebase.google.com/docs/admin/setup
### .firebaserc
```
{
"projects": {
"default": ">"
}
}
```## Set up auth
Go to auth section of firebase console
- enable google
- enable email + password## Create a list of eligible email addresses
these need to convert `@` and `.` into `_`
## Deploy to Firebase: firebase-tools
Check the following are pointing to production assets:
- functions/index.js
- src/Firebase/fb.config.js
- src/Firebase/fbsw.config.js
- database.rules.json`firebase use default`
- Update assets/manifest.json
- Update package.json```
npm run deploy
(i.e. npm run prod && firebase deploy --only hosting)
```## Workbox
- this is installed and operated using the webpack plugin
## Changelog
- 3.0.0: 2019 re-write
- 2.0.0: 2019 re-write## ToDo
- InScreen notification
- remove duplicative userMessage
- Make rollbar work only on production
- Delete item (with warning)
- Add firebase rules so that first person to claim can't be overwritten