Scanned negatives publishing app
Branch: master
Clone or download
Latest commit aeeea6e Jun 9, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
config
docs Add files via upload May 12, 2018
firebase /firebase/admin folder w/ update-download-urls script Jun 8, 2018
lib remove route mixin and model Jun 2, 2018
public
tests upload screen ui May 10, 2018
vendor Initial Commit from Ember CLI v3.1.3 May 5, 2018
.editorconfig Initial Commit from Ember CLI v3.1.3 May 5, 2018
.ember-cli migrating old ui May 6, 2018
.eslintignore
.eslintrc.js eslint May 16, 2018
.gitignore /firebase/admin folder w/ update-download-urls script Jun 8, 2018
.travis.yml
.watchmanconfig Initial Commit from Ember CLI v3.1.3 May 5, 2018
LICENSE Create LICENSE May 12, 2018
README.md
config-example.js dev and production fb envs May 13, 2018
ember-cli-build.js Initial Commit from Ember CLI v3.1.3 May 5, 2018
package-lock.json
package.json 0.0.14 Jun 8, 2018
testem.js Initial Commit from Ember CLI v3.1.3 May 5, 2018

README.md

index65

Scanned negatives publishing app.

Ember.js & Firebase using ember-cli-zuglet. A reimplementation of my CouchDB-based index65.

Demo site Use zeeba@gmail.com / hello-world to sign-in (read-only member)

Installation

Firebase

  • Create a firebase project
  • Enable Storage
  • Enable Firestore in Database section
  • Authentication → Sign-in Method → Enable Email/Password

Configuration

  • Copy config-example.js as config.js
  • Go to Firebase console and select Project Overview → "Add Firebase to your webapp", copy config.
  • Paste it in your config.js production object, the same way it is done in config-example.js
  • Delete messagingSenderId

Firebase & Ember

Install Node.js (LTS or Latest, doesn't matter, both works just fine).

Install app dependencies:

$ npm install

Install firebase functions dependencies:

$ cd firebase/functions
$ npm install

Install firebase cli:

$ npm install -g firebase-tools

Select your firebase project:

$ firebase use --add

Build ember app and deploy it along with firebase functions, security rules:

npm run deploy

Sign-up

  • Open https://<app-id>.firebaseapp.com/session/sign-up
  • Email, password, sign-up

By default none of the signed up users are allowed to access anything in the app.

Make yourself an admin

  • Open Firebase Console → Database → users → uid
  • Add "admin" in roles array
  • Go back to the index65, you should be an admin now.

And you're done.

Connect domain (optional)

  • In Firebase Console select Hosting
  • Connect Domain
  • Follow the steps

Add billing (optional)

  • In Firebase console bottom left there is "Spark" and "Upgrade"
  • Click
  • Select "Blaze", Purchase

To set daily spending limit:

  • Open Google AppEngine Settings: https://console.cloud.google.com/appengine/settings
  • Select your Firebase project
  • Under application settings, click "Edit"
  • Set daily spending (0 or more)

Content

  • login as admin
  • add source
  • add collection
  • upload pictures

Pictures has the following expected file name format:

prefix-<group_id>-<image_id>.jpg

valdis-001-001.jpg
valdis-001-002.jpg
valdis-001-003.jpg
...
valdis-130-036.jpg
valdis-130-037.jpg

Notes

Schema

/users/{uid}
  email: string
  displayName: string
  createdAt: date
  roles: Array<String>

/sources/{source}
  name: string

  /collections/{collection}
    name: string

    /groups/{group}
      identifier: number

        /images/{image}
          identifier: number
          storage: {
            original: {
              size : {
                width: number
                height: number
              }
              url: string
            },
            200x200: {
              size: {
                width: number,
                height: number
              },
              url: string
            }
            1024x1024: {
              size: {
                width: number,
                height: number
              },
              url: string
            }
          }
/images/{source}/{collection}/{group}/{image}
  * original
  * 1024 (jpeg)
  * 200 (jpeg)

TODO

  • Group description, year, picture
  • Allow selected members to edit selected sources
  • Allow members to edit their displayName
  • Delete group with images
  • Delete collection including groups
  • Delete source including all nested docs