|
| 1 | +# Native Setup |
| 2 | + |
| 3 | +### Git |
| 4 | +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](http://think-like-a-git.net/). If you find yourself in a real git pickle, see ["Oh, shit, git!"](http://ohshitgit.com/). 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. |
| 5 | + |
| 6 | +* [Install Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) |
| 7 | + |
| 8 | +### Code Base |
| 9 | +You are now ready for the actual **OperationCode Backend** code base. |
| 10 | + |
| 11 | +* 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`). |
| 12 | +* 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](https://github.com/OperationCode/operationcode_backend) page. |
| 13 | + |
| 14 | +* The following commands will pull down the source code from your forked repo. |
| 15 | +* Make sure to replace `[YOUR-GITHUB-NAME]` with your GitHub name. (example: https://github.com/iserbit/operationcode_backend.git) |
| 16 | + |
| 17 | +#### Local Development Environment |
| 18 | +_Fork the repo first._ |
| 19 | +```bash |
| 20 | +git clone https://github.com/[YOUR-GITHUB-NAME]/operationcode_backend.git operationcode-upstream |
| 21 | +cd operationcode-upstream |
| 22 | +git remote add upstream https://github.com/OperationCode/operationcode_backend.git |
| 23 | +``` |
| 24 | + |
| 25 | +1. If [Bundler](https://bundler.io/) is not installed run `gem install bundler`. |
| 26 | +2. Run `bundle install` to install all of the gems in your [Gemfile](Gemfile). |
| 27 | +3. Download and install [PostgreSQL](https://www.postgresql.org/download/) if you don't have it already. |
| 28 | + |
| 29 | +#### Database Setup: |
| 30 | + |
| 31 | + |
| 32 | +1. Run `cp config/database.yml. config/native_setup_database.yml`. |
| 33 | +2. Run `bin/rake db:create`. |
| 34 | +3. Run `bin/rake db:migrate`. |
| 35 | +4. Run `bin/rake db:seed` --> **This is where I am getting errors** :sweat_smile:. |
| 36 | + |
| 37 | +### Testing |
| 38 | +1. Run `RAILS_ENV=test rake db:test:prepare`. |
| 39 | +2. Run `bin/rake test & rubocop`. |
| 40 | + |
| 41 | +#### Running OperationCode Backend: |
| 42 | +To run the OperationCode Backend simply type: |
| 43 | +```bash |
| 44 | +rails s |
| 45 | +``` |
| 46 | + |
| 47 | +You can now visit http://localhost:3000 and you should see the "Yay! You're on Rails!" welcome message. |
0 commit comments