### Starting

1. (optional, but good to do daily) Use doctor to check if projects are up-to-date and clean.
    ```bash
    $ owsdev doctor
    ```

1.  If Dynamodb is not already running (say, after a system restart or stopping it explicitly)

    ```bash
    $ owsdev dynamodb start
    ```

1.  Replace your /etc/hosts file with a customized one that remaps qa-*.theorchard.io to localhost.

	```bash
	$ sudo owsdev hosts remap
	```
	
	Take a look at /etc/hosts, you will see lots of entries for qa services. To turn this off and access the normal hosts, run `owsdev hosts restore`.
	
1. Start the proxy in a window of its own.

	```bash
	$ sudo owsdev proxy
	```

1. Now, run it all! Make a full screen terminal window and run.

	```
	$ owsdev tmux start --panes --attach
	```
	
	If you omit the --panes option, each service will run in a separate tmux window.
	
	If you omit the --attach option, all the services will be started but you won't automatically attach the terminal to the tmux session. You can reattach with the command `owsdev tmux attach`

1. Connect to things:
    * If you are running frontend-distro, you can connect to http://localhost:8080/. 
    * If you are running ows-grass, you can make grass-mediated requests at http://localhost:5042/
    * You can make direct local microservice calls via curl at http://qa-ows-*.theorchard.io/.

### Stopping

1. Stop your tmux session, which will kill all the running services.

    ```bash
    $ owsdev tmux stop
    ```
    
1. Kill your proxy with Ctrl-C in window. Note: if you just close the terminal window, the process will continue to run.

1. Restore your hosts file. Only really necessary if you expect to make direct qa-ows-*.theorchard.io requests, e.g. curl for qa-ows-features etc.

    ```bash
    $ owsdev hosts restore
    ```
