Source code for Treehouse Village Ecohousing internal website
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
Etienne Baqué ebd4371360 Add AGPL3 license to the project 4 days ago
app Improved the car booking process 6 days ago
bin Reorganized credentials and secrets 3 months ago
config Improved the car booking process 6 days ago
db Switch from Payment table to RoomPayment table 4 weeks ago
lib Added tests for recent controllers 9 months ago
public Fix car booking create action 1 month ago
spec Added charge time events 3 weeks ago
storage Initial commit 1 year ago
vendor Initial commit 1 year ago
.gitattributes Initial commit 1 year ago
.gitignore Added Marketplace feature 10 months ago
.rspec Added rspec 1 year ago
.rubocop.yml Implemented the ten day booking rule 7 months ago
.ruby-version Initial commit 1 year ago
.tool-versions Added car booking system 4 months ago
Capfile Added tests for recent controllers 9 months ago
Gemfile Added Sidekiq cron gem and scheduler 7 months ago
Gemfile.lock Added Sidekiq cron gem and scheduler 7 months ago
LICENSE Add AGPL3 license to the project 4 days ago
Procfile Fixed pending booking confirmation 7 months ago
README.md Reorganized credentials and secrets 3 months ago
Rakefile Added tests for recent controllers 9 months ago
config.ru Added tests for recent controllers 9 months ago

README.md

Treehouse

This Rails application provides services used by members of the Treehouse Village Ecohousing community.

Development setup

  1. Set up your local environment using asdf. Alternatively, feel free to skip the following and install Ruby, Postgresql, NodeJS and Redis manually.

    To set up your environment with asdf:

    1. Install asdf locally.
    2. Make sure you install dependencies needed for the asdf Postgres plugin.
    • If you're a Debian-based distro user, you may also want to add the following package: libpq-dev.
    1. Install all asdf plugins needed for this project, get all needed gems and setup your local database by running the following:
    bin/dev_setup
    
  2. At this point, your local database will be setup for the application. It's time to seed it:

    bundle exec rails db:seed
    
  3. Finally, start your server to access the app by running:

    foreman start
    

    This will start your Rails (Puma) server as well as Sidekiq and Redis. If you only want to start your server, run:

    bundle exec rails server # or 'rails s'
    

    The app is now available at http://localhost:3000. To log in with an admin, use admin@example.com. Otherwise, use user@example.com. The password for both these accounts is password.

Tests

To run all tests:

bundle exec rspec

Deployments

To deploy main to home.treehousevillage.ca, simply run the following from the project root:

bin/deploy

This script will first run all tests, and if no test fails, then it will proceed with the deployment.

What if something is broken after deployment?

No worries! Take a deep breath then run the following command from the project root:

bundle exec cap production deploy:rollback

This will revert to the previous deployed revision (side note: the last 5 deployment revisions are kept on the server).

After this rollback has taken effect and you've checked that everything is working again, please consider writing a test will cover this scenario.

Update secrets

To update the application secrets, first ask a developer to give you the master.key file. Once you received it, place it in the config folder.

You can then run the following to update the application secrets:

rails credentials:edit