From ad54a3836dc0c0a37d5a858707ac452fb6fae394 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 1 Apr 2026 12:41:49 +1100 Subject: [PATCH] feat: Update readme --- README.md | 106 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 93 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 9206f25..819da09 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,99 @@ -# Python Flask Webserver Template +# Weekly Calendar -Python3 website template including git actions +Flask app for displaying a weekly Bible study schedule, with optional Google Sheets integration and an automatic upcoming-week highlight. + +## Features + +- Renders schedule entries with date, leaders, and topic +- Highlights the next upcoming week automatically +- Supports theme switching in the UI +- Loads schedule data from Google Sheets CSV export or local fallback JSON +- Provides an API endpoint for schedule data + +## Requirements + +- Python 3.13+ (recommended) + +## Local Development + +1. Install dependencies using UV -# Development -1. Install requirements ```bash -python3 -m pip install -r requirements.txt -``` -2. Run the dev server -```bash -python3 server.py +uv sync ``` -# Production -Run using the main.py file +2. Start the development server: + ```bash -python3 main.py -``` \ No newline at end of file +uv run main.py +``` + +3. Open: + +```text +http://127.0.0.1:5000 +``` + +## Production Run + +Run with Gunicorn via the included launcher: + +```bash +uv run main.py +``` + +Default bind address is `0.0.0.0:5000`. + +## Configuration + +Use a `.env` file or environment variables. + +- `GOOGLE_SHEET_URL`: Optional. If set, schedule data is fetched from Google Sheets. +- `WORKERS`: Optional Gunicorn worker count (default: `1`). +- `THREADS`: Optional Gunicorn thread count (default: `2`). + +If `GOOGLE_SHEET_URL` is not set or fetch/parsing fails, the app falls back to `schedule_data.json` if present. + +## Google Sheets Data Format + +Expected columns: + +- `Date` +- `Leaders` (comma-separated names) +- `Topic` + +Supported date formats include: + +- `2026-04-07` +- `7/4/2026`, `04/07/2026`, `7-4-2026` +- `7 Apr 2026`, `April 7, 2026` +- `April 7` (current year inferred) + +## API + +- `GET /api/v1/schedule` + +Response shape: + +```json +{ + "schedule": [ + { + "date": "April 7", + "leaders": ["Alice", "Bob"], + "topic": "Romans 8" + } + ] +} +``` + +## Docker + +Build and run: + +```bash +docker build -t weekly-calendar . +docker run --rm -p 5000:5000 --env-file .env weekly-calendar +``` + +Built images are available at: `git.woodburn.au/nathanwoodburn/weekly-calendar:latest` \ No newline at end of file