This repository contains the Robot U community site.
It is a thin application layer over Forgejo:
- Forgejo is the source of truth for authentication, public content repos, and issue-backed discussions.
- This app provides the web UI, course/lesson browsing, markdown rendering, and ICS calendar ingestion.
- The current live Forgejo instance is `https://aksal.cloud`.
## Stack
- Backend: FastAPI
- Frontend: Preact + TypeScript + Vite
- Python tooling: `uv`, `ruff`
- Frontend tooling: `bun`, Biome
## Important Files
-`app.py`: FastAPI app and SPA/static serving
-`live_prototype.py`: live payload assembly for courses, lessons, discussions, and events
-`forgejo_client.py`: Forgejo API client
-`calendar_feeds.py`: ICS/webcal feed loading and parsing
-`settings.py`: env-driven runtime settings
-`frontend/src/App.tsx`: client routes and page composition
-`frontend/src/MarkdownContent.tsx`: safe markdown renderer used in lessons and discussions
-`scripts/start.sh`: main startup command for local runs
## Repo Layout Notes
- The root repository is the site application.
-`examples/quadrature-encoder-course/` is a separate nested git repo used as sample content. It is intentionally ignored by the root repo and should stay that way.
## First-Time Setup
### Python
```bash
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
```
### Frontend
```bash
cd frontend
~/.bun/bin/bun install
```
## Environment
Runtime configuration is loaded from shell env, then `.env`, then `.env.local` through `scripts/start.sh`.
- Browser sign-in uses Forgejo OAuth/OIDC. `APP_BASE_URL` must match the URL opened in the browser, and the Forgejo OAuth app must include `/api/auth/forgejo/callback` under that base URL.
- Browser OAuth requests only identity scopes. The backend stores the resulting Forgejo token server-side and may use it only after enforcing public-repository checks.
-`FORGEJO_TOKEN` is optional and should be treated as a read-only local fallback. Browser sessions and API token calls may write comments only after verifying the target repo is public.
- API clients can query with `Authorization: token ...` or `Authorization: Bearer ...`.