Welcome to GarPR Development
Our dev environment uses vagrant. We have a CI cycle, with a big test suite, and auto-push to production based on jenkins when we push to master and pass all tests
garpr is written using Restful Flask on the backend, with an AngularJS frontend.
Developers should make changes in a branch, and then make a pull request (also see here).
Admins or users, submit bug reports on the issues page.
Interested in getting GarPR in your region? Contact one of the devs.
Interested in being a dev? Also contact one of us. We have an active slack channel :D
- Vagrant
- VirtualBox
- 1024 MB of memory
-
Clone the repository
git clone https://github.com/ripgarpr/garpr.git
-
Navigate to the project directory
cd garpr
-
Run the Vagrantfile to setup the environment. Note that if your Vagrant version is too old, you may get an error, so make sure you get the latest version from their website.
vagrant up
-
SSH into the development VM
vagrant ssh
The vagrant user home directory of the VM will mirror the project directory on the host. It will also contain the project's dependencies.
To start the server run
bash start.sh
The API and webapp will now be started on the VM, and the webapp can be visited on the host @ 192.168.33.10:8000
To pull in any changes made to the project on the host into the VM, use the command sync_vm
. This will allow you to use the text/project editors on your host.
- (Host): Make edits to some files.
- (VM): Run the command:
sync_vm
- (VM): Restart the system (often the system will auto-restart; to force restart, type
bash stop.sh
followed bybash start.sh
). - (Host): Visit 192.168.33.10:8000 to view the new changes.
If stuff goes very wrong (or you would like to restore the initial copy of your db), you can restore the initial state of the Vagrant VM by typing vagrant destroy
followed by vagrant up
.
To run all tests:
nosetests
The local copy of the development database can be accessed through the following mongo command:
mongo admin -u devuser -p devpass01
This authenticates you to the authentication database 'admin'. Once mongo has started,
type use garpr
to switch to the primary database 'garpr'. Alternatively, you can run
mongo garpr -u devuser -p devpass01 --authenticationDatabase admin
to directly connect to the primary database.