Giter Club home page Giter Club logo

Where2Help

Build Status Dependency Status

Development

Run the project locally

Install bundled gems

$ bundle install

Start up postgres (if not already running)

$ postgres -D /usr/local/var/postgres/

Setup the database

$ createuser --superuser postgres

$ rails db:setup

Populate database with sample data

$ rails db:populate

Start up rails!

$ rails server

Run the project in Docker

Make sure you have Docker and Docker-Compose setup and running.

Build the project

$ docker-compose build

Spin up the containers

$ docker-compose up

Setup the database

$ docker-compose run app rails db:setup

Populate database with sample data

$ docker-compose run app rails db:populate

Restart the server

$ docker-compose stop
$ docker-compose up

To run the server as an interactive shell (to use e.g. byebug or pry)

$ docker-compose run --service-ports app

Deployment

Heroku

Set up the following environment variables:

  • DATABASE_URL
  • SMTP_EMAIL_ADDRESS
  • SMTP_EMAIL_PASSWORD
  • FQDN
  • SECRET_KEY_BASE
  • RAILS_ENV
  • RAILS_SERVE_STATIC_FILE

CI

Travis CI is set up to automatically deploy to Heroku:

If you want to skip continuous integration for your commit, add this to your commit message:

[ci skip]

Contributing to Where2Help

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch, master should always be stable.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it, if possible.
  • If you're interested in working on an issue that has been assigned to somebody, we encourage you to get in touch with them first!

Styleguide

Ruby / Rails

Translations

  • the application is bilingual: English & German
  • everything visible to end users needs to be translated
    • views
    • ActiveRecord model-names and -attributes
    • error messages
  • translation strings are kept in /config/locales
  • please stick to the naming conventions:
    • model-names and model-attributes go into active_record.<locale>.yml
    • view-specific translations go into views.<locale>.yml
    • human language defaults go into defaults.<locale>.yml
    • if a gem needs a certain amount of translation strings, these go into <gem_name>.<locale>.yml
    • anything else (helpers, etc.) goes into <locale>.yml

CSS

  • use the .scss syntax
  • use @import over to import styles in application.css.scss
  • keep to the conventions of the application.css.scss manifest:
  • the granularity of rules increases top to bottom (general styles on top, more specific ones last)
    • global rules go into base/
    • page specific styles into pages/
    • site-wide used component rules go into base/components.scss (extract a components/ directory if it gets to big)

Development Environment

Sample Data

To set up a development environment, you can run this command:

Warning, this will drop your database 😱

bundle exec rake db:drop db:setup db:populate

This will:

  • drop your database
  • re-create it
  • load the schema (like running migrations but better)
  • run seeds
  • run the lib/tasks/db/populate.task command to load your database with fake data

On top of a bunch of other Event data and users, you will get:

Emails

You can use the gem letter_opener which opens your emails in a browser tab instead of just printing emails to the logs by running the app like this:

ENABLE_LETTER_OPENER=1 bundle exec rails server

If you run it without the ENABLE_LETTER_OPENER it will run as you would normally expect.

Where2Help's Projects

creative icon creative

All things related to mockups, designs, workflows, wireframes, etc

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.