Coder Social home page Coder Social logo

kofronpi / cyclecity-core Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andrewhao/cyclecity-core

0.0 2.0 0.0 233 KB

PostGIS-based activity storage service

Home Page: http://www.cyclecity.io

Ruby 83.61% JavaScript 3.69% CSS 0.65% HTML 11.08% Shell 0.72% CoffeeScript 0.24%

cyclecity-core's Introduction

Cyclecity Core

The core API behind the Cyclecity GPS route analytics service.

Code Climate CircleCI

Generated with Raygun.

Development

Getting Started

Requirements

To run the specs or fire up the server, be sure you have these installed (and running):

  • Ruby 2.2 (see .ruby-version).
  • PostgreSQL 9.x (brew install postgresql) with superuser 'postgres' with no password (createuser -s postgres).
  • PhantomJS for Capybara and Javascript testing (brew install phantomjs).

First Time Setup

After cloning, run bin/setup to install missing gems and prepare the database.

Note, rake db:sample_data loads a small set of data for development. Check out db/sample_data.rb for details.

Running the Specs

To run all Ruby and Javascript specs.

$ rake

Running the Application Locally

$ foreman start
$ open http://localhost:3000

Conventions

Git

  • Branch development is auto-deployed to acceptance.
  • Branch master is auto-deployed to production.
  • Create feature branches off of development using the naming convention (features|chores|bugs)/a-brief-description-######, where ###### is the tracker id.
  • Rebase your branch before merging into development to produce clean merge bubbles.
  • Retain merge commits for multi-commit branches when merging into development (e.g. git merge --no-ff branchname).
  • Craft atomic commits that make sense on their own and can be easily cherry-picked or reverted if necessary.

Code Style

Generally speaking, follow the Ruby Style Guide. Additionally, these are other guidelines adopted by the team:

Always use double quotes for test/spec descriptions, unless the subject is a class/module.

describe SomeController do
  context "when logged in as an admin" do
    describe "#some_method" do
      it "does some thing"
    end
  end
end

Additional/Optional Development Details

Code Coverage (local)

Coverage for the ruby specs:

$ COVERAGE=true rspec

Code coverage is reported to Code Climate on every CI build so there's a record of trending.

Using Guard

Guard is configured to run ruby and jasmine specs, and also listen for livereload connections.

$ bundle exec guard

Using Mailcatcher

$ gem install mailcatcher
$ mailcatcher
$ open http://localhost:1080/

Learn more at mailcatcher.me. And please don't add mailcatcher to the Gemfile.

Continuous Integration and Deployment with CircleCI

This project is configured for continuous integration and deployment with CircleCI and Heroku.

Check out circle.yml and bin/deploy.sh for details.

Server Environments

Hosting

Acceptance and Production are hosted on Heroku under the [email protected] account.

Environment Variables

Several common features and operational parameters can be set using environment variables.

Required

  • SECRET_KEY_BASE - Secret key base for verfying signed cookies. Should be 30+ random characters and secret!

Optional

  • HOSTNAME - Canonical hostname for this application. Other incoming requests will be redirected to this hostname.
  • BASIC_AUTH_PASSWORD - Enable basic auth with this password.
  • BASIC_AUTH_USER - Set a basic auth username (not required, password enables basic auth).
  • PORT - Port to listen on (default: 3000).

Third Party Services

  • Heroku for hosting.
  • CircleCI for continuous integration and deployment.

Heroku needs a buildpack:

$ heroku buildpacks:add https://github.com/cyberdelia/heroku-geo-buildpack.git#1.3

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.