Skip to content

Commit b6ec3b8

Browse files
Merge pull request #41 from CodeForPhilly/readme-to-docs
docs: merge README content into docs
2 parents 726fd20 + fa9c51f commit b6ec3b8

File tree

5 files changed

+109
-51
lines changed

5 files changed

+109
-51
lines changed

README.md

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# CHIME
2+
23
The **C**OVID-19 **H**ospital **I**mpact **M**odel for **E**pidemics
34

45
[![CHIME](https://user-images.githubusercontent.com/1069047/76693244-5e07e980-6638-11ea-9e02-1c265c86fd2b.gif)](http://predictivehealthcare.pennmedicine.org/chime)
@@ -7,51 +8,9 @@ Interested in [contributing](https://codeforphilly.github.io/chime/CONTRIBUTING.
78

89
Join our [Code For Philly](https://codeforphilly.org/projects/chime) project or our [Slack workspace](https://codeforphilly.org/chat) in the [#covid19-chime-penn](https://codeforphilly.org/chat/covid19-chime-penn) channel if you'd like to chat with us. We'd appreciate your [feedback](http://predictivehealthcare.pennmedicine.org/contact/).
910

10-
## Development
11-
To test the app locally just run:
12-
13-
```sh
14-
streamlit run app.py
15-
```
16-
17-
This will open a browser window with the app running on port 8000. If you need the app to run on another port, you can edit `.streamlit/config.toml`, or use the magic ENV var, `STREAMLIT_SERVER_PORT` - see [this streamlit issue](https://github.com/streamlit/streamlit/pull/527). So, for example, to run the app on port 1234, you would change the last line of `config.toml` to `port = 1234` or invoke the app like this:
18-
19-
```sh
20-
STREAMLIT_SERVER_PORT=1234 streamlit run app.py
21-
```
22-
23-
### With `pipenv`
24-
```bash
25-
pipenv shell
26-
pipenv install
27-
streamlit run app.py
28-
```
29-
30-
### With `conda`
31-
```bash
32-
conda env create -f environment.yml
33-
source activate chime
34-
pip install streamlit
35-
streamlit run app.py
36-
```
37-
38-
### Developing with `docker`
39-
40-
Copy `.env.example` to be `.env` and run the container.
41-
42-
```bash
43-
cp .env.example .env
44-
docker-compose up
45-
```
46-
47-
You should be able to view the app via `localhost:8000`. If you want to change the
48-
port (as described above), then you also have to set `PORT` in the `.env` file.
49-
50-
**NOTE** this is just for usage, not for development--- you would have to restart and possibly rebuild the app every time you change the code.
51-
52-
If you'd like to use `docker-compose` for development, please run `docker-compose up --build` every time you make changes.
53-
54-
## Deployment
55-
**Before you push your changes to master make sure that everything works in development mode.**
11+
## Documentation
5612

57-
Changes merged to `master` will be automatically deployed to [http://penn-chime.phl.io/](http://predictivehealthcare.pennmedicine.org/chime).
13+
- [Getting Started: Try Online](https://codeforphilly.github.io/chime/getting-started/try-online.html)
14+
- [Getting Started: Run Locally](https://codeforphilly.github.io/chime/getting-started/run-locally.html)
15+
- [Contributing: Overview](https://codeforphilly.github.io/chime/CONTRIBUTING.html)
16+
- [Contributing: Application Development](https://codeforphilly.github.io/chime/contributing/app-dev.html)

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- Operations Support—*coming soon*
1111
- Operations
1212
- [The `chime-live` Cluster](./operations/chime-live-cluster.md)
13+
- [Deploy to Heroku](./operations/heroku.md)
1314
- [Deploy to Your Own Cluster](./operations/byok8s.md)
1415
- [Code of Conduct](CODE_OF_CONDUCT.md)
1516
- [Maintainers](MAINTAINERS.md)

docs/contributing/app-dev.md

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,72 @@
1010

1111
## Developer Requirements
1212

13-
List out requirements. We should allow for all platforms (MacOS/Windows/Linux)
13+
The application is built with [Streamlit](https://www.streamlit.io/), Streamlit requires:
1414

15-
Make sure that you have the requirements installed before proceeding.
15+
- Python 2.7.0 or later / Python 3.6.x or later
16+
- PIP
17+
18+
See [Streamlit's Getting Started guide](https://docs.streamlit.io/getting_started.html) for detailed information on prerequisites and setup
19+
20+
## Running CHIME Locally
21+
22+
### With `pipenv`
23+
24+
```bash
25+
pipenv shell
26+
pipenv install
27+
streamlit run app.py
28+
```
29+
30+
### With `conda`
31+
32+
```bash
33+
conda env create -f environment.yml
34+
source activate chime
35+
pip install streamlit
36+
streamlit run app.py
37+
```
38+
39+
### Choosing a Different Port
40+
41+
If you need to run the application on a different port than the default (8000), you can export a variable in your shell session to override it with any port number of your choice before running:
42+
43+
```bash
44+
export STREAMLIT_SERVER_PORT=1234
45+
streamlit run app.py
46+
```
1647

1748
## Project Layout
1849

19-
Explain how the project is laid out so other can pinpoint quickly the core components. Some of these are in progress.
50+
### Application files
51+
52+
- `script/`: Developer workflow scripts following [GitHub's Scripts To Rule Them All](https://github.com/github/scripts-to-rule-them-all) pattern.
53+
- `app.py`: Main source for the application
54+
- `.streamlit/`: [Streamlit config options](https://docs.streamlit.io/cli.html)
55+
- `.env`: Local environment variables to use when running application, this file is copied from `.env.example` to start you out and then ignored by git
56+
- `Pipfile`
57+
- `Pipfile.lock`
58+
- `environment.yml`
59+
- `requirements.txt`
60+
61+
### Documentation
62+
63+
- `docs/`: Markdown documentation in [GitBook format](https://gitbookio.gitbooks.io/docs-toolchain/structure.html) used to generate `gh-pages` website at [codeforphilly.github.io/chime](https://codeforphilly.github.io/chime)
64+
65+
### Operations support
66+
67+
- `.github/workflows/`: [GitHub Actions](https://github.com/features/actions) workflows implementing automations driven by GitHub events
68+
- `.holo/`: [Hologit](https://github.com/JarvusInnovations/hologit) projection configuration, used to generate `gh-pages` branch from content changes in `docs/` tree
69+
- `k8s/`: Kubernetes manifests for [the `chime-live` cluster](https://codeforphilly.github.io/chime/operations/chime-live-cluster.html)
70+
- `.env.example`: A starter `.env` file distributed with the project
71+
- `docker-compose.yml`: Runtime container configuration for running the application locally via Docker
72+
- `Dockerfile`: Recipe for building Docker container that runs the application
73+
- `Procfile`: Supports running the application on Heroku
2074

2175
## Testing
2276

77+
*No testing routine is available yet. If you have thoughts on how to add one, please contribute!*
78+
2379
## Validating CHIME
80+
81+
*No validation routine is available yet. If you have thoughts on how to add one, please contribute!*

docs/getting-started/run-locally.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
11
# Getting Started: Run Locally
22

3-
*Coming soon*
3+
This guide aims to provide the easiest and most reliable method for getting a copy of the application running locally.
4+
5+
If you're a developer looking to do heavier work on the application, check out the [Contributing: Application Development](../contributing/app-dev.md) for a more advanced guide covering practical developer workflows.
6+
7+
## Quickstart with Docker
8+
9+
From the root directory of the repository, you should be able to get up and running with one command:
10+
11+
```bash
12+
./script/server
13+
```
14+
15+
This script will:
16+
17+
- Verify that `docker` and `docker-compose` are available on your system
18+
- Initialize `.env` if needed from `.env.example`
19+
- Use `docker-compose up` to build and start an instance of the application as a background daemon
20+
- Print out the URL you can open the app at (usually [http://localhost:8000](http://localhost:8000))
21+
22+
### Running on a Different Port
23+
24+
If you need to run the server on a different, edit the `PORT` option in your `.env` file. You might need to do this if you have something else already running on the default port (8000).
25+
26+
## Updating After Changing Code
27+
28+
If you edit code, or checkout a new branch, the update script will handle all needed steps to refresh your running instance:
29+
30+
```bash
31+
./script/update
32+
```
33+
34+
## Shutdown and Cleanup
35+
36+
From the same directory, run this command to shut down the Docker container and clean up any volumes:
37+
38+
```bash
39+
docker-compose down -v
40+
```

docs/operations/heroku.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Operations: Deploy to Heroku
2+
3+
The Heroku instance at [`pennchime.herokuapp.com`](https://pennchime.herokuapp.com/) will be automatically redeployed when changes are merged into the `master` branch off [the `pennsignal/chime` repository](https://github.com/pennsignals/chime).

0 commit comments

Comments
 (0)