-
-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GETTING_STARTED.md and update README.md
- Loading branch information
Showing
3 changed files
with
116 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
### Getting Started | ||
|
||
This is a general guide to setting up an Open Food Network development environment on your local machine. | ||
|
||
The following guides are located in the wiki and provide more OS-specific step-by-step instructions: | ||
|
||
- [Ubuntu Setup Guide][ubuntu] | ||
- [macOS Sierra Setup Guide][sierra] | ||
- [OSX El Capitan Setup Guide][el-capitan] | ||
|
||
### Dependencies | ||
|
||
* Rails 3.2.x | ||
* Ruby 2.1.5 | ||
* PostgreSQL database | ||
* PhantomJS (for testing) | ||
* See Gemfile for a list of gems required | ||
|
||
If you are likely to need to manage multiple version of ruby on your local machine, we recommend version managers such as [rbenv](https://github.com/rbenv/rbenv) or [RVM](https://rvm.io/). | ||
|
||
For those new to Rails, the following tutorial will help get you up to speed with configuring a [Rails environment](http://guides.rubyonrails.org/getting_started.html). | ||
|
||
### Get it | ||
|
||
If you're planning on contributing code to the project (which we [LOVE](CONTRIBUTING.md)), it is a good idea to begin by forking this repo using the `Fork` button in the top-right corner of this screen. You should then be able to use `git clone` to copy your fork onto your local machine. | ||
|
||
git clone https://github.com/YOUR_GITHUB_USERNAME_HERE/openfoodnetwork | ||
|
||
Jump into your new local copy of the Open Food Network: | ||
|
||
cd openfoodnetwork | ||
|
||
And then add an `upstream` remote that points to the main repo: | ||
|
||
git remote add upstream https://github.com/openfoodfoundation/openfoodnetwork | ||
|
||
Fetch the latest version of `master` from `upstream` (ie. the main repo): | ||
|
||
git fetch upstream master | ||
|
||
### Get it running | ||
|
||
When ready, run `script/setup`. If the script succeeds you're ready to start developing. If not, take a look at the output as it should be informative enough to help you troubleshoot. | ||
|
||
If you run into any other issues getting your local environment up and running please consult [the wiki](wiki). | ||
|
||
If still you get stuck do not hesitate to open an issue reporting the full output of the script. | ||
|
||
Now, your dreams of spinning up a development server can be realised: | ||
|
||
bundle exec rails server | ||
|
||
To login as Spree default user, use: | ||
|
||
email: [email protected] | ||
password: spree123 | ||
|
||
### Testing | ||
|
||
Tests, both unit and integration, are based on RSpec. To run the test suite, first prepare the test database: | ||
|
||
bundle exec rake db:test:prepare | ||
|
||
Then the tests can be run with: | ||
|
||
bundle exec rspec spec | ||
|
||
The project is configured to use [Zeus](zeus) to reduce the pre-test startup time while Rails loads. See the [Zeus GitHub page](zeus) for usage instructions. | ||
|
||
Once [npm dependencies are installed](karma), AngularJS tests can be run with: | ||
|
||
./script/karma run | ||
|
||
If you want karma to automatically rerun the tests on file modification, use: | ||
|
||
./script/karma start | ||
|
||
### Multilingual | ||
Do not forget to run `rake tmp:cache:clear` after locales are updated to reload I18n js translations. | ||
|
||
### Rubocop | ||
The project is configured to use [rubocop](rubocop) to automatically check for style and syntax errors. | ||
|
||
You can run rubocop against your changes using: | ||
|
||
rubocop | ||
|
||
|
||
[developer-wiki]: https://github.com/openfoodfoundation/openfoodnetwork/wiki | ||
[sierra]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-macOS-(Sierra) | ||
[el-capitan]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-OS-X-(El-Capitan) | ||
[ubuntu]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-Ubuntu | ||
[wiki]: https://github.com/openfoodfoundation/openfoodnetwork/wiki | ||
[zeus]: https://github.com/burke/zeus | ||
[rubocop]: https://rubocop.readthedocs.io/en/latest/ | ||
[karma]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Karma |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,85 +10,22 @@ Supported by the Open Food Foundation, we are proudly open source and not-for-pr | |
|
||
We're part of global movement - get involved! | ||
|
||
* Fill in this short survey to tell us who you are and what you want to do with OFN: https://docs.google.com/a/eaterprises.com.au/forms/d/1zxR5vSiU9CigJ9cEaC8-eJLgYid8CR8er7PPH9Mc-30/edit# | ||
* Find out more and join in the conversation - http://openfoodnetwork.org | ||
* Join the conversation [on Slack](slack). Make sure you introduce yourself in the #general channel | ||
* Head to [https://openfoodnetwork.org](https://openfoodnetwork.org) for more information about the global OFN project | ||
* Check out the [User Guide](https://guide.openfoodnetwork.org/) for a list of features and tutorials | ||
|
||
## Contributing | ||
|
||
## Getting started | ||
If you are interested in contributing to the OFN in any capacity, please introducing yourself [on Slack](slack), and have a look through our [Contributor Guide](contributor-guide) | ||
|
||
Below are instructions for setting up a development environment for Open Food Network. More information is in the [developer wiki](https://github.com/openfoodfoundation/openfoodnetwork/wiki). | ||
Our [GETTING_STARTED](GETTING_STARTED.md) and [CONTRIBUTING](CONTRIBUTING.md) guides are the best place to start for developers looking to set up a development environment and make contributions to the codebase. | ||
|
||
If you're interested in provisioning a server, see [the project's Ansible playbooks](https://github.com/openfoodfoundation/ofn_deployment). | ||
## Provisioning | ||
|
||
If you're interested in provisioning a server, see [ofn-install](ofn-install) for the project's Ansible playbooks. | ||
|
||
### Dependencies | ||
We also have a [Super Admin Guide](super-admin-guide) to help with configuration of new servers. | ||
|
||
* Rails 3.2.x | ||
* Ruby 2.1.5 | ||
* PostgreSQL database | ||
* PhantomJS (for testing) | ||
* See Gemfile for a list of gems required | ||
|
||
|
||
### Get it | ||
|
||
The source code is managed with Git (a version control system) and | ||
hosted at GitHub. | ||
|
||
You can view the code at: | ||
|
||
https://github.com/openfoodfoundation/openfoodnetwork | ||
|
||
You can download the source with the command: | ||
|
||
git clone https://github.com/openfoodfoundation/openfoodnetwork.git | ||
|
||
|
||
### Get it running | ||
|
||
For those new to Rails, the following tutorial will help get you up to speed with configuring a [Rails environment](http://guides.rubyonrails.org/getting_started.html). | ||
|
||
When ready, run `script/setup`. If the script succeeds you're ready to start developing. If not, take a look at the output as it should be informative enough to help you troubleshoot. | ||
|
||
If you run into any other issues getting your local environment up and running please consult [the wiki](https://github.com/openfoodfoundation/openfoodnetwork/wiki). | ||
|
||
If still you get stuck do not hesitate to open an issue reporting the full output of the script. | ||
|
||
Now, your dreams of spinning up a development server can be realised: | ||
``` | ||
bundle exec rails server | ||
``` | ||
To login as Spree default user, use: | ||
``` | ||
email: [email protected] | ||
password: spree123 | ||
``` | ||
### Testing | ||
|
||
Tests, both unit and integration, are based on RSpec. To run the test suite, first prepare the test database: | ||
|
||
bundle exec rake db:test:prepare | ||
|
||
Then the tests can be run with: | ||
|
||
bundle exec rspec spec | ||
|
||
The site is configured to use | ||
[Zeus](https://github.com/burke/zeus) to reduce the pre-test | ||
startup time while Rails loads. See the Zeus github page for | ||
usage instructions. | ||
|
||
Once [npm dependencies are | ||
installed](https://github.com/openfoodfoundation/openfoodnetwork/wiki/Karma), AngularJS tests can be run with: | ||
|
||
./script/karma run | ||
|
||
If you want karma to automatically rerun the tests on file modification, use: | ||
|
||
./script/karma start | ||
|
||
### Multilingual | ||
Do not forget to run `rake tmp:cache:clear` after locales are updated to reload I18n js translations. | ||
|
||
## Credits | ||
|
||
|
@@ -110,4 +47,9 @@ Do not forget to run `rake tmp:cache:clear` after locales are updated to reload | |
|
||
## Licence | ||
|
||
Copyright (c) 2012 - 2015 Open Food Foundation, released under the AGPL licence. | ||
Copyright (c) 2012 - 2018 Open Food Foundation, released under the AGPL licence. | ||
|
||
[slack]: https://join.slack.com/t/openfoodnetwork/shared_invite/enQtMzU2Mjk5MDc2MjA5LTM4ZTAzZjIwNzIxMmU5ODFiNWY1MTU2ZWUyNzQwNjdjNTY0N2VhY2UwOGU4ZmVjNzYyZDU2NjY3NzZkZmQwYjk | ||
[contributor-guide]: https://ofn-user-guide.gitbook.io/ofn-contributor-guide/who-are-we | ||
[ofn-install]: https://github.com/openfoodfoundation/ofn-install | ||
[super-admin-guide]: https://ofn-user-guide.gitbook.io/ofn-super-admin-guide |