A newer version of the Streamlit SDK is available: 1.61.1
metadata
title: Time Card Generator
emoji: ⏱️
colorFrom: green
colorTo: blue
sdk: streamlit
sdk_version: 1.37.0
app_file: app.py
pinned: false
Time Card Generator
A Streamlit application for creating, editing, and saving shift cards to Firebase Realtime Database through simple HTTP requests. The UI is optimized for Hugging Face Streamlit Spaces and does not require Google Apps Script.
Features
- Add unlimited time cards
- Edit title and start time inline
- Automatically calculate end time as
+2 hours - Save new cards and update existing cards
- Delete cards locally or from Firebase
- Load saved cards automatically on startup
- Use
st.session_statefor responsive card management
Project Structure
streamlit_app/
├── app.py
├── requirements.txt
├── README.md
├── .gitignore
├── assets/
│ └── style.css
├── components/
│ ├── buttons.py
│ ├── card.py
│ └── header.py
├── services/
│ └── api.py
├── utils/
│ └── time_utils.py
└── .streamlit/
└── secrets.toml.example
Configuration
Create .streamlit/secrets.toml from the example file:
FIREBASE_DATABASE_URL="https://smartedu-3d5bf-default-rtdb.firebaseio.com"
FIREBASE_AUTH_TOKEN=""
This repository is already configured with the Firebase Realtime Database URL in .streamlit/secrets.toml:
FIREBASE_DATABASE_URL="https://smartedu-3d5bf-default-rtdb.firebaseio.com"
FIREBASE_AUTH_TOKEN=""
Notes:
- Leave
FIREBASE_AUTH_TOKENempty if your Realtime Database rules allow direct access. - If your database rules require authentication, add a valid Firebase Database auth token there or as a Hugging Face Space secret.
Run Locally
cd streamlit_app
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
streamlit run app.py
Deploy to Hugging Face Streamlit Space
- Create a new Hugging Face Space.
- Choose
Streamlitas the SDK. - Upload the contents of
streamlit_app/. - This repo can run without extra edits because
.streamlit/secrets.tomlis included. - Optionally, add Hugging Face Space secrets named
FIREBASE_DATABASE_URLandFIREBASE_AUTH_TOKENif you prefer managing them outside the repo. - Commit and let the Space build automatically.