taddison / turnip-tracker

You win some, you lose some. But you track them ALL. 💰

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Turnip Tracker

Goals

Todo

  • Authenticate with auth0 (see https://github.com/taddison/turnip-tracker.git)
  • Store data in fauna (price, transactions)
    • graphql - index to search by user
    • prices endpoint returns prices for user
  • Each user only sees their own turnips

Building

Database Setup

  • Create a database on fauna (https://dashboard.fauna.com/)
  • Import the graphql schema file schema.gql
  • Create a new role (security -> manage roles)
    • Grant CRUD on all three collections (Transaction, User, Price)
    • Grant read on all five indexes (transactions, prices, users, price_user_by_user, transaction_user_by_user)
  • Create a new key in the role
  • Place this key in a .env.local file, with the name FAUNA_SECRET. See .env.sample for an example.

Running the app

  • Clone the repo
  • yarn dev

Refs

Notes

mutation CreatePrice {
  createPrice(
    data: {
      user: { connect: 261564896538264084 }
      weekStart: "2020-03-27"
      isMorning: false
      price: 101
    }
  ) {
    _id
  }
}

About

You win some, you lose some. But you track them ALL. 💰


Languages

Language:JavaScript 100.0%