tableflip / makelunch

:hocho: Who's cooking?
1 stars 1 forks source link

Make Lunch!

CircleCI - https://lunch.tableflip.io

Helps figure out who should cooking next by recording stats on how many servings you've made vs how many you've received.

If I cook for 8 people (including me), I recieve 1 portion and give 8, so am +7

Meals are historical records. The stats on the Eaters are calculated on meal insert. It's an experiment in document storage style.

To recommend who cooks next we look at how has the lowest value of servings.given - servings.recieved.

TODO:

Getting started

Build it with Docker

# Build it
docker build -t makelunch .

# Run it
docker run --init -p 3000:3000 -u "node" -e "MONGO_URL=<her hair is full of secrets>" -e "ROOT_URL=http://localhost:3000" -e "METEOR_SETTINGS=$(cat settings.json)" makelunch

Deploy it with now.sh

Put env config in .env.production

ROOT_URL="https://lunch.tableflip.io"
MONGO_URL="@makelunch-mongo-url-prod"
METEOR_SETTINGS="@makelunch-settings-prod"

Then On the TABLEFLIP now account (if you plan to deploy to lunch.tableflip.io)

Add secrets

now secret add makelunch-mongo-url-prod <db url>
now secret add makelunch-settings-prod "${cat settings.json | tr -d '\n'}"

Deploy!

now --dotenv=.env.production --docker

You can run that last command to your hearts content. Each deploy get's it's own url.

Once your happy with it, alias the deployment to the live URL

now alias https://makelunch-zyfwsdybcl.now.sh/ lunch.tableflip.io

You should see:

$ now alias https://makelunch-mdpmammtdx.now.sh lunch.tableflip.io
> lunch.tableflip.io is a custom domain.
> Verifying the DNS settings for lunch.tableflip.io (see https://zeit.world for help)
> Success! Domain tableflip.io (FOn9AsAAz4hzoeh1z5Fa463G) added
> Verification OK!
> Provisioning certificate for lunch.tableflip.io
> Success! lunch.tableflip.io now points to makelunch-mdpmammtdx.now.sh! [29s]

:rocket:

Collections

Meals

{
  date: isoDate
  chef: [userId]
  eaters: [userId]
  guests: Integer
  dish: String
}

Eaters

{
  name: String,
  img: url,
  servings: {
    given: Integer,
    received: Integer
  }
  mealsCooked: Interger,
  lastCooked: isoDate,
  lastEaten: isoDate
}

Initial data