Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

Latest commit

 

History

History
101 lines (67 loc) · 3.23 KB

File metadata and controls

101 lines (67 loc) · 3.23 KB

Native Setup

Quick Reference

  1. Install Dependencies (git, rails, redis, ...)

    i. Install git

    ii. Install rails

    iii. Install ruby

    iv. Install postgres

    v. Install redis

  2. Retrieve codebase

  3. Setup database

  4. Setup environment

  5. Run codebase

  6. Run tests

  7. Interact With Codebase

Install Dependencies

Git

Git is a distributed version control system. This is how our code is stored and managed. Git can be frustrating, but it is an essential tool. If you want to learn more about Git, a great resource is Think Like a Git. If you find yourself in a real git pickle, see "Oh, shit, git!". If you have already installed Git as a part of the Docker Toolbox, you don't need to install it again using the following link.

Rails Setup

Rails is required to run locally.

Mac: COMING SOON

Windows: COMING SOON

Linux: COMING SOON

Ruby Setup

Rails is required to run locally.

Mac: https://gorails.com/setup/osx/10.13-high-sierra

Windows: COMING SOON

Linux: COMING SOON

Redis Setup:

Redis is required to run locally.

Mac: COMING SOON

Windows: COMING SOON

Linux: COMING SOON

Code Base

You are now ready for the actual OperationCode Backend code base.

  • The common practice is to make a copy of the GitHub repository you want to work on (known as forking the repo), make your changes, and then request to merge those changes back into the project (known as a pull request).

  • Forking a repo is done through GitHub's web UI. It can be found in the top right corner of the OperationCode Backend's GitHub page.

  • The following commands will pull down the source code from your forked repo.

  • Make sure to replace [YOUR-GITHUB-NAME] with your GitHub name. (example: https://github.com/iserbit/operationcode_backend.git)

Running Backend


Local Development Environment

Fork the repo first.

git clone https://github.com/[YOUR-GITHUB-NAME]/operationcode_backend.git operationcode-upstream
cd operationcode-upstream
git remote add upstream https://github.com/OperationCode/operationcode_backend.git
  1. If Bundler is not installed run gem install bundler.
  2. Run bundle install to install all of the gems in your Gemfile.
  3. Download and install PostgreSQL if you don't have it already.

Database Setup:

1a. Run redis in separate tab.

  1. Run cp config/database.yml. config/native_setup_database.yml.
  2. Run bin/rake db:create.
  3. Run bin/rake db:migrate.
  4. Run bin/rake db:seed

Testing

  1. Run RAILS_ENV=test rake db:test:prepare.
  2. Run bin/rake test & rubocop.

Running OperationCode Backend:

To run the OperationCode Backend simply type:

rails s

Interact With Backend:

You can now visit http://localhost:3000 (or run make open) and you should see a Rails welcome message!