Giter Club home page Giter Club logo

Poold.in

This is the primary web app for pooldin. It is currently in early stage development and should not be placed in a production environment.

All development is assumed to be in on Mac OSX with the following dependencies:

  • Homebrew
  • Heroku Toolbelt
  • Postgresapp (docs)
  • [sudo] brew install git node
  • [sudo] easy_install pip
  • [sudo] pip install virtualenvwrapper
  • [sudo] gem install foreman (See Environment below for details)
  • [sudo] gem install watchr

You will be working with python virtual environments quite often when testing different dependencies and working with others. Make sure to configure and optimize virtualenv/virtualenvwrapper for your workflow.

Develop

git clone [email protected]:pooldin/pooldin.git pooldin
cd pooldin
mkvirtualenv pooldin
make init

This installs both production and development dependencies as well as the database. Check out the Makefile to see what was installed and how the separation between production and development is made.

Environment

We are currently using Heroku for hosting which means many configuration values are defined as environment variables. In order to support this architecture while working locally, they have provided their toolbelt.

The heroku gem is useful as is but the foreman gem is out of date. Specifically, we need the foreman run command to support the --env flag so we can specify custom environment files. Currently, this can only be fixed by installing the foreman gem (which you may have done above):

[sudo] gem install foreman

We use the conf directory to define Procfile and requirements.txt files for a different environment. The default environment is dev. However, all make commands support custom environments via the ENV variable. For example:

make ENV=test
make ENV=test run
make ENV=test shell

This helps keep environment and Procfile pollution to a minimum as well as maintains environment state accross different scenarios.

NOTE: Due to Heroku constraints, the production Procfile and requirements.txt are symlinked to their conf/prod counterparts.

Here are the currently required environment variables:

  • POOLDIN_ENV
  • POOLDIN_DATABASE_URL
  • POOLDIN_SECRET_KEY
  • POOLDIN_SESSION_SALT

Database

When make init is run, it creates the conf/dev/.env environment file. It assumes that your database uri is:

postgresql://localhost/pooldin

Make sure to change this uri to your local database uri.

Commands

  • make db
  • make reset

Assets

When make init is run, the last action it takes is to build the assets to the static directory with the make assets command. Assets are managed via the flask-assets plugin and are specified in pooldin/assets/manifest.yaml. The built in watch command doesn't watch less properly so we use watchr to watch for file changes during development. See conf/dev/Watchr for details.

** Commands**

  • make assets
  • make css
  • make css-debug
  • make js
  • make js-debug

Lint

In a perfect world, a release will not go out without a series of checks. Linting is one of those checks to make sure code is developed in a consistent mannor.

Until we have the infrastructure in place, we'll have to be good citizens and check our own belly buttons for lint.

make lint

Gotchas

The watch command that runs with make run only compiles unminified static files. This means that development will go a little faster since you don't have to wait for the minified files as well. However, since we are committing static files for Heroku, there is potential that the minified files that are used on Heroku, will not be compiled when you commit.

Make sure to run make css js before you commit asset changes.

Known Issues

  • The webassets dependency is on a development version (0.8.dev) to make use of correct build and functionality.

Optional Tools

Python

  • pip install pyflakes
  • pip install pep8

MacVim

Postgres

TODO

Implement CI

We need to compile static resources and that is only currently possible by adding them to git so heroku can pick them up. We need to add a CI process to correctly deploy and keep build files out of the repo.

For now the resources are being committed to git. This is ugly. We need to fix this.

Poold.in's Projects

pooldb icon pooldb

A temporary repo to manage the pooldin schema outside of any application

pooldcode icon pooldcode

Poold.in private python package index on S3

pooldlib icon pooldlib

The foundational library which defines poold.in and is used by pooldwww and pooldREST

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.