Git Product home page Git Product logo

beerconomy's Introduction

beerconomy.com – I Owe You A Beer!

you send a link to someone, saying “I owe you a beer, [dude/chica/homie/whatever].” You have 3 beers to give every day. None on a sunday.

That link takes you to a screen where you can accept the beer (sign in or register).

Your profile shows how many beers you’ve been given, which people have given you beers, and who you’ve given beers to.

There is a world map showing where people were when they were giving you a beer.

Pick a username and password; we don’t want your e-mail. If you don’t enter your e-mail address, make sure to pick a really stupid password so that you don’t forget it.

Let users enter their e-mail only if they want to be able to recover a password.

How to keep from people gifting fake beers?

-give a randomID to the beer

########### # Views: ########### -USER:

-home (show beers received, beers given, map of last 100 received beers)

-giveBeer (if logged in and you have a beer available, you can gift someone a beer) -- generate beer gift link

-receiveBeer (if logged out, offer login/register) (if logged in, receive the beer at a special celebratory screen)

-new

########### # DATABASE: ########### user {

username
passwdhash (salt + hash, bcrypt)
email
joindate
beersGiven: array of userIDs
beersReceived: array of beerIDs

} beer {

sponsor (user)
recipient (user)
givenAt (creation timestamp)
givenFromLocation (geolocation)
beerRandomID (randomID)
receivedAt (timestamp, null until accepted)

}

Relationships: user has many beers beer has TWO users (has many?) beer belongs to ONE user (but was given_by another) # the problem with this is that finding “who has this user GIVEN beers to” requires parsing ALL beers to see which were given_by this user.

DONE: apt-get install postgresql-9.4 postgresql-server-dev-9.4 su - postgres create role beerapp with createdb login password ‘oij34c8902ckdhsaH’ # ctrl-d

rails new myapp –database=postgresql

# changed dev DB to sqlite3

rails generate model User name:string passhash:string email:string beersGiven:array beersReceived:array

rails generate model Beer sponsor:integer recipient:integer lat:string lon:string randID:string receivedAt:timestamp

SETUP:

bundle exec rake db:migrate

# ugliness (for conflicting/outdated/stale gems and stuff) bundle exec rake rails:update:bin

DEBUGGING byebug gem is included; just add ‘byebug’ to set a breakpoint

beerconomy's People

Contributors

groovemonkey avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.