> For the complete documentation index, see [llms.txt](https://docs.healthuniverse.com/overview/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.healthuniverse.com/overview/core-concepts/15-second-quick-start/streamlit-quick-start.md). Agents can also search and read this documentation through its [MCP server](https://docs.healthuniverse.com/overview/~gitbook/mcp).

# Streamlit Quick-Start

This quick-start will guide you through packaging your python app with Streamlit and deploying it to Health Universe. You will need to have a GitHub account to create your repository.

## Step 1: Create a GitHub repository

1. Create a new repository on GitHub to host your project. You can make the repository either public or private, and it is a good idea to have a readme.md file in the repository and use a .gitignore template so that you can ignore the .env. This is important when you're linking a local development environment to a github repository.

   * [x] **Repo contains main.py and requirements.txt**
   * [x] **Repo has a readme.md**
   * [x] **Use the "python" .gitignore template (to ignore .env)**

   Note: If you're using a local development environment, link your local environment to your GitHub repository<br>
2. Clone the repository to your local machine:

   `git clone https://github.com/<your_account>/<your_repo_name>.git`<br>
3. Change to your project directory:

   `cd <your_repo>`<br>
4. Create a virtual environment using:\
   `python -m venv .env`<br>
5. Activate your virtual environment with:

   `source .env/bin/activate`<br>
6. Upgrade pip to make sure things go smoothly:\
   `python -m pip install --upgrade pip`<br>
7. Install the streamlit library with:\
   `pip install streamlit`

#### If you're using ChatGPT (or editing directly into GitHub)

You will need to have at minimum a main.py file, and a requirements.txt file. you can copy/paste code into these files directly in GitHub.

1. Create a main.py file in your repository. This is where your code should reside.

```python
import streamlit as st

st.title("Welcome to Health Universe!")
st.write("This is a sample application.")

alarm_clock = st.slider('hour', 0, 23, 17) # min: 0h, max: 23h, default: 17h
st.header(alarm_clock) # print in large text
```

1. Create a requirements.txt file. For streamlit, it should include (at a minimum) Streamlit as a requirement.

```python
streamlit
# Include any other libraries required by your app.
```

Make sure that you commit any changes that you make before you deploy with health universe.

## Step 2: Create your python app within your local environment

In your local repository, create the following files:

* **main.py**: This file should contain your Python model.
* **requirements.txt**: This file will list your project dependencies.

Next, learn a little bit about how Streamlit works.

* [Overview of the main concepts](https://docs.streamlit.io/library/get-started/main-concepts) for creating UI with Streamlit.
* [Here's a nifty cheat sheet](https://docs.streamlit.io/library/cheatsheet) for all the interface elements you can create.

### main.py

```python
import streamlit as st

st.title("Welcome to Health Universe!")
st.write("This is a sample application.")

alarm_clock = st.slider('hour', 0, 23, 17) # min: 0h, max: 23h, default: 17h
st.header(alarm_clock) # print in large text
```

### requirements.txt

```txt
streamlit
# Include any other libraries required by your app.
```

**Test out your app by running it locally:**

Run your app locally using: `streamlit run main.py`

## Step 3: Deploy to Health Universe

1. Push your local repo to GitHub.
2. Log in or create a Health Universe account if you haven't already.
3. Go to [https://healthuniverse.com](https://www.healthuniverse.com) and navigate to "Apps."
4. Click "Add App" to create a new app.
5. Fill out the following fields:
   * App Name: Name of your app
   * Description: A brief description of your app
   * Github Account: Your GitHub username
   * Github Repo: The exact name of your GitHub repository
   * Main File: The name of your python file (usually `main.py`)
6. Click "Add App" to deploy your app. This process may take a few minutes.

Once you've completed these steps, your app will be published on Health Universe!

## 🥳🥳🥳


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.healthuniverse.com/overview/core-concepts/15-second-quick-start/streamlit-quick-start.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
