|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +This is the **Towlion Platform** repository — a documentation-only repo that defines the architecture, specifications, and guides for a self-hosted GitHub-native micro-PaaS. There is no runnable application code in this repository; it contains only Markdown documentation and MkDocs configuration. |
| 6 | + |
| 7 | +## Repository Structure |
| 8 | + |
| 9 | +``` |
| 10 | +docs/ # All documentation (Markdown) |
| 11 | + index.md # Landing page |
| 12 | + architecture.md # Platform design, tech stack, diagrams |
| 13 | + spec.md # Application contract (ports, endpoints, env vars) |
| 14 | + deployment.md # CI/CD pipeline, zero-downtime deploys, migrations |
| 15 | + self-hosting.md # Fork model, server requirements, bootstrap |
| 16 | + preview-environments.md # PR previews, DNS, cleanup |
| 17 | + ecosystem.md # Org structure, app template, multi-app hosting |
| 18 | + roadmap.md # Phased development plan |
| 19 | +mkdocs.yml # MkDocs Material site configuration |
| 20 | +.github/workflows/ |
| 21 | + docs.yml # GitHub Pages deployment workflow |
| 22 | +``` |
| 23 | + |
| 24 | +## What This Platform Defines |
| 25 | + |
| 26 | +Towlion is a single-server micro-PaaS where GitHub acts as the control plane. Key concepts: |
| 27 | + |
| 28 | +- **Tech stack**: Debian 12, Docker, Caddy, FastAPI, Next.js, PostgreSQL, Redis, MinIO, Celery |
| 29 | +- **Deployment model**: GitHub Actions SSH into a server and run `docker compose up -d --build` |
| 30 | +- **Self-hosting**: Users fork a repo, configure GitHub secrets, push, and the app deploys |
| 31 | +- **Multi-app**: One server hosts multiple apps via subdomain routing through Caddy |
| 32 | +- **App contract**: Backend on port 8000, `GET /health` endpoint, env-var configuration, PostgreSQL + Alembic migrations |
| 33 | + |
| 34 | +## Working With This Repo |
| 35 | + |
| 36 | +### Documentation Only |
| 37 | + |
| 38 | +All content is Markdown in `docs/`. There are no tests, no build steps, and no application code to run. Changes should focus on clarity, accuracy, and consistency across documents. |
| 39 | + |
| 40 | +### Local Preview |
| 41 | + |
| 42 | +```bash |
| 43 | +pip install mkdocs-material |
| 44 | +mkdocs serve |
| 45 | +``` |
| 46 | + |
| 47 | +Site serves at `http://127.0.0.1:8000` with auto-reload. |
| 48 | + |
| 49 | +### Conventions |
| 50 | + |
| 51 | +- Use standard Markdown with MkDocs Material extensions (admonitions, code highlighting, tabbed content) |
| 52 | +- Use code fences with language tags for all code/config examples |
| 53 | +- Keep language clear and concise — prefer short paragraphs and bullet points |
| 54 | +- ASCII diagrams are used for architecture illustrations |
| 55 | + |
| 56 | +### Branch Strategy |
| 57 | + |
| 58 | +- `main` is the primary branch |
| 59 | +- PRs should branch from `main` with descriptive names (e.g., `docs/add-monitoring-guide`) |
| 60 | + |
| 61 | +## Key Relationships Between Documents |
| 62 | + |
| 63 | +- `spec.md` defines the contract that all application repos must follow |
| 64 | +- `architecture.md` describes the runtime environment those apps deploy into |
| 65 | +- `deployment.md` explains the CI/CD pipeline that connects GitHub repos to the server |
| 66 | +- `self-hosting.md` describes how forks configure and deploy independently |
| 67 | +- `ecosystem.md` ties everything together — the org structure, template repo, and multi-app model |
| 68 | +- `roadmap.md` tracks the phased plan from foundation through ecosystem growth |
| 69 | + |
| 70 | +## Common Tasks |
| 71 | + |
| 72 | +- **Adding a new documentation page**: Create a `.md` file in `docs/`, then add it to the `nav` section in `mkdocs.yml` |
| 73 | +- **Updating the spec**: Edit `docs/spec.md` — ensure changes are consistent with `architecture.md` and `deployment.md` |
| 74 | +- **Modifying site config**: Edit `mkdocs.yml` for theme, navigation, or extension changes |
0 commit comments