/tradebindr

An app to connect Magic The Gathering traders.

Primary LanguageHTML

tradebindr.com

A site to help you find other nearby people to trade Magic: The Gathering cards with.

Local Development Setup

  1. pip install virtualenv if you don't already have it
  2. cd tradebindr go to wherever you cloned the repo
  3. virtualenv venv create a virtualenv
  4. source venv/bin/activate activate the virtualenv
  5. pip install -r requirements.txt to install all python dependencies
  6. Install Postgres 9.3 or higher. On Mac it may be easier to use Postgres.app but I haven't tried it. I use the normal install from postgresql.org.
  7. Create a database named tradebindr or whatever you want. You may need to create a postgres user other than the default user or at least set a password for the default user. I forget.
  8. export DATABASE_URL=postgres://username:password@localhost:5432/database-name to set a necessary environment variable tradebindr will need to start up. Replace username, password, and database-name of course.
  9. Next we will create the database tables. In the future I'll use Alembic migrations so this will be easier.
  10. python to start a repl
  11. from app import db so we can work with the db
  12. db.create_all() to populate the database with tables
  13. quit() we're done there
  14. You did it! Run the app with python app.py
  15. You should be able to go to http://localhost:5000

Folder & File Descriptions

  • phonegap - a starting point for packaging this as a Phonegap app through build.phonegap.com
  • static - static assets like images, css, javascript that Flask will serve for now
  • templates - templates used by render_template() calls in app.py
    • home.html - has some javascript in it to perform card name autocompletion
    • location.html - has some javascript in it to get the users location and ajax post it to the server
  • app.py - the entire application. needs to be split up into models and controllers.
  • Procfile - used by Heroku to launch the application
  • requirements.txt - python depedencies for installation with pip install -r requirements.txt