This page describes how to deploy the ThatNightSky Streamlit app to Streamlit Community Cloud (free tier).
- GitHub account with push access to this repository
- Streamlit Community Cloud account (sign up with GitHub)
VWORLD_API_KEYandANTHROPIC_API_KEYvalues
Streamlit Community Cloud recognises uv.lock natively (since November 2024). No requirements.txt is needed — committing uv.lock is sufficient.
git ls-files uv.lock # should print "uv.lock"-
Push your changes to the
mainbranch.git push origin main
-
Go to share.streamlit.io and log in with GitHub.
-
Click Create app → Deploy a public app from GitHub.
-
Fill in the app settings:
Field Value Repository <your-github-username>/ThatNightSkyBranch mainMain file path src/thatnightsky/app.py -
Open Advanced settings and paste the following into the Secrets field:
VWORLD_API_KEY = "your_key_here" ANTHROPIC_API_KEY = "your_key_here"
Important: Secrets are exposed automatically as environment variables. The app reads them via
os.environ, so no code changes are needed. -
Click Deploy.
| Symptom | Cause | Fix |
|---|---|---|
Build fails — poetry not found |
Cloud misreads pyproject.toml as Poetry format |
Verify uv.lock is committed |
KeyError: VWORLD_API_KEY |
Secrets not entered | Add keys in Advanced settings → Secrets |
ModuleNotFoundError: thatnightsky |
src/ layout not recognised |
Check package config in pyproject.toml |
| App restarts with memory error | Loading hip_main.dat (51 MB) |
Verify @st.cache_resource is applied in compute.py |
| Cold start takes 30–60 seconds | Astronomical data reloaded after sleep | Expected behaviour; loading spinner handles UX |
.envand.streamlit/secrets.tomlare listed in.gitignoreand will never be committed.- API keys are managed exclusively through Streamlit Cloud dashboard Secrets.
- The app limits narrative generation to 3 times per session to control Anthropic API costs.