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

Commit 1e09b88

Browse files
authored
Overmind: Config to start and end everything (#410)
Install tmux and overmind and copy the `.overmind.env.example` file to `overmind.env` and copy the `Procfile.dev.example` to `Procfile.dev` then adjust the location of your frontend repo in the Procfile. Default assumes that the frontend repo is located in the same folder as the backend repo. For ex: Change `cd ../dwellingly-app` to `cd ../your_relative_location` or use an absolute path. Start all servers with `overmind start`. You can connect to any server in the terminal with `overmind connect name_of_process`. for ex: `overmind connect frontend` or `overmind connect backend` This will start a development frontend and backend server. And start a testing backend and frontend server. Simplifies start up and removes the need to set config to specify which server to start.
1 parent 579cbd4 commit 1e09b88

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ __pycache__/
44
*.py[cod]
55
*$py.class
66

7+
# overmind config
8+
.overmind.env
9+
Procfile.dev
10+
711
# C extensions
812
*.so
913

.overmind.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
OVERMIND_PROCFILE=Procfile.dev

CONTRIBUTING.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ NOTE: Default development database is SQLite3. (Optionally setup and use [Postgr
9898

9999
8. Start the server using the flask environment (required every time the project is re-opened):
100100
- Run: `pipenv run flask run`
101-
- Run and restart the server on changes: `pipenv run flask run --reload`
101+
- Optional: Use overmind to start frontend and backend servers with `overmind run start`: See [Starting servers with Overmind](#Starting-servers-with-Overmind)
102102
9. Test the server and view coverage reports. Use of coverage reporting is recommended to indicate test suite completeness and to locate defunct code in the code base.
103103
- Run all the tests: `pipenv run pytest --cov .`
104104
- Run tests in a particular directory: `pipenv run pytest --cov [path to directory]`
@@ -177,6 +177,27 @@ If the above steps don't work and give you an error about either not being able
177177

178178
Everything should be golden now, and running the `pipenv` commands from above should work.
179179

180+
### Starting servers with Overmind
181+
182+
You can start both frontend and backend servers with one command if you have overmind installed.</br>
183+
Visit [https://github.com/DarthSim/overmind#installation](https://github.com/DarthSim/overmind#installation) for installation instructions.
184+
copy both `overmind.env.example` and `Procfile.dev.example` to configure overmind.
185+
186+
Run: `cp .overmind.env.example .overmind.env && cp Procfile.dev.example Procfile.dev`
187+
In your `Procfile.env` file change the location of the frontend repo if its different than the default. The default assumes the frontend repo is located in the same directory as the backend repo.
188+
189+
Then you can start all servers with `overmind start`.
190+
191+
This will start two backend servers and two frontend servers. one dev server and one test server (for system testing) for each repo.
192+
193+
For backend:
194+
- The dev server is on port 5000
195+
- The test server is on port 5010
196+
197+
For Frontend:
198+
- The dev server is on port 3000
199+
- The test server is on port 3010
200+
180201
### Note For Windows Users
181202

182203
Python does not come by default for Windows users. Sometimes the PATH variable in Windows will point to the wrong path and you will have trouble running the `python` and `pipenv` commands. If you don't have Python installed then follow these steps. If the steps listed above did not work for you, try the following.

Procfile.dev.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
backend: export FLASK_ENV=development && pipenv run flask run -p 5000
2+
backend_testing: export FLASK_ENV=testing && pipenv run flask run -p 5010 --reload
3+
frontend: cd ../dwellingly-app && PORT=3000 npm run start
4+
frontend_testing: cd ../dwellingly-app && export REACT_APP_PROXY=http://localhost:5010 && npm run startTest

0 commit comments

Comments
 (0)