File size: 2,452 Bytes
7e57d6a
 
 
 
 
 
73860b5
f18ed57
7e57d6a
 
 
 
7a18dc2
5d95f5f
7a18dc2
5d95f5f
7a18dc2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
title: YFDash
emoji: 🏃
colorFrom: indigo
colorTo: blue
sdk: streamlit
sdk_version: 1.31.1
app_file: src/Home.py
pinned: false
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

# YFDashboard Streamlit Application

Template Repo for Streamlit Application - https://github.com/JonSolow/streamlit-template

Here are some of the features of the template:

- VSCode .devcontainer for local development: [Documentation](https://code.visualstudio.com/docs/devcontainers/containers)
  - docker-compose.yml
  - Dockerfile
- Linting Configuration [TO-DO] (allows for clean code and quicker detection of possible bugs as one of the first steps in Shift-left testing)
  - [Black](https://black.readthedocs.io/en/stable/index.html)
  - [ruff](https://beta.ruff.rs/docs/)
  - [mypy](https://mypy.readthedocs.io/en/stable/index.html)
- Unit Tests
  - [pytest](https://docs.pytest.org/)

# Start Here to Develop

1. Prerequisites

- Install [Visual Studio Code](https://code.visualstudio.com/)
- Install [Visual Studo Code Extension - Dev containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
- Install [Docker](https://www.docker.com/)

2. Confirm Docker is installed by executing command `docker -v`
3. Open VSCode to a New Window and open this repository's directory
4. You may see a notification that the Folder containers a Dev Container configuration file. If so, click on "Reopen in Container"

- If you do not see this notification, press `F1` key and begin typing the following until you can see the option "Dev Containers: Rebuild and reopen in Container".
- This action will reopen the VSCode within a Docker container suitable to develop and locally run the application.

5. The dev container will start up the Streamlit application.

- To access the application, navigate to http://localhost:8501
  - The container forwards the port 8501 where the Streamlit application is hosted
- Any changes made to the code will be reflected in the Streamlit application when you refresh.

6. Now inside the VSCode dev container, to run tests, execute `./tests/run_tests.sh`

- This script has an optional argument `-f` for "fix mode" which allows for configuration of black and ruff to automatically apply fixes.

7. As functions are added to the application, unit tests can/should be added in `tests/unit`, with existing support utilizing the `pytest` library.