Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
denisecase committed May 30, 2023
1 parent fd47afd commit 2e04ba5
Show file tree
Hide file tree
Showing 32 changed files with 442 additions and 453 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy to shinyapps.io with 3.10

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Deploy to shinyapps
env:
SHINYAPPS_ACCOUNT: ${{ secrets.SHINYAPPS_ACCOUNT }}
SHINYAPPS_SECRET: ${{ secrets.SHINYAPPS_SECRET }}
SHINYAPPS_TOKEN: ${{ secrets.SHINYAPPS_TOKEN }}
run: |
pip install rsconnect-python
rsconnect deploy shiny . --title cintel-04-reactive
142 changes: 11 additions & 131 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,167 +1,47 @@
# This file lists the files and folders that should NOT be committed to GitHub.

# Virtual environment
# Mac files
.DS_Store

# VS Code files
.vscode/

# Python Virtual environment folders
.venv/
venv/

# Jupyter Notebook
.ipynb_checkpoints

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
# ruff linter
.ruff_cache/
33 changes: 12 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
# Continuous Intelligence and Interactive Analytics - Initial App
# Continuous Intelligence and Interactive Analytics - Reactive Apps

- Interactive app: [cintel-04-reactive](https://denisecase.shinyapps.io/cintel-04-reactive/)
- Repository: [cintel-04-reactive](https://github.com/denisecase/cintel-04-reactive)
- Website: [cintel-04-reactive](https://denisecase.github.io/cintel-04-reactive/)
- Author: [Denise Case](https://github.com/denisecase)


Note: 🚀 Rocket Tips are for learners who want to go beyond the basics.
They are NOT required but can improve our workflow, increase productivity, and make things more enjoyable.
-----


## Prerequisites

You'll need the tools installed in

- [cintel-01-getting-started](https://github.com/denisecase/cintel-01-getting-started)
- [cintel-02-app](https://github.com/denisecase/cintel-02-app)
- [cintel-03-data](https://github.com/denisecase/cintel-03-data)

## Sign Up for shinyapps.io (Free Account)

Sign up for a free account on shinyapps.io.
I sign in via GitHub for convenience.

## Copy This Repository

Copy this starter repository into your own GitHub account by clicking the 'Fork' button at the top of this page.
Expand All @@ -41,7 +24,7 @@ Copy this starter repository into your own GitHub account by clicking the 'Fork'

### Make Changes in VS Code

With your respository folder open in VS Code:
With your repository folder open in VS Code:

1. Click on this README.md file for editing.
1. Update the README.md file by changing your name in the author link above.
Expand All @@ -65,6 +48,14 @@ Details matter - check spelling, capitalization, plurals, spacing when things do
- [Seaborn](https://seaborn.pydata.org/)
- [Plotly](https://plotly.com/python/)
- [Bokeh](https://docs.bokeh.org/en/latest/index.html)
- [Seaborn Flights Dataset](https://seaborn.pydata.org/tutorial/data_structure.html)

-----

![Flights](./images/01-flights.PNG)

![MT Cars](./images/02-mtcars.PNG)

![Penguins](./images/03-penguins.PNG)

- [Seaborn Flights Dataset](https://seaborn.pydata.org/tutorial/data_structure.html)
![Relationships](./images/04-relationships.PNG)
34 changes: 0 additions & 34 deletions REQUIREMENTS.md

This file was deleted.

25 changes: 12 additions & 13 deletions SHINY.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,15 @@ When VS Code asks if it should add the new virtual environment, click yes.
- Activate it on Windows: `.venv\Scripts\activate`
- Activate it on macOS/Linux `source .venv/bin/`

## Install Libaries into Virtual Environment
## Install Libraries into Virtual Environment

This gives a good selection of options. You only need to install the ones you use.

```shell
python -m pip install --upgrade pip wheel shiny shinyswatch
python -m pip install --upgrade pandas openpyxl jinja2 matplotlib seaborn plotnine
python -m pip install --upgrade shinywidgets plotly holoviews panel hvplot ipyleaflet
python -m pip install --upgrade jupyter_bokeh

```

OR List your requirements in requirements.txt and install them all at once.

```shell
python -m pip install --upgrade pip wheel
python -m pip install --upgrade -r requirements.txt
```


## Run the App

Verify your virtual environment is activated. Run the app.
Expand All @@ -81,12 +71,21 @@ shiny run --reload app.py
```

Open the app by following the instructions provided in the terminal.
For example, try CRTL CLICK (at the same time) on the URL displayed (http://127.0.0.1:8000).
For example, try CTRL CLICK (at the same time) on the URL displayed (http://127.0.0.1:8000).

Hit CTRL c (at the same time) to quit the app.
If it won't stop, close the terminal window.
Reopen the terminal window and be sure the virtual environment is activated
before running the app again.


-----

## ⚠️ Delete Hosted App Before Pushing to GitHub

Reminder: The GitHub action deploy.yml may not automatically delete an existing app from shinyapps.io so we can redeploy.

Before pushing to GitHub, login to [shinyapps.io](https://www.shinyapps.io/) and view the list of applications.

- First archive the app.
- Then delete the archived app.
Loading

0 comments on commit 2e04ba5

Please sign in to comment.