Skip to content

Commit 7955093

Browse files
baijumclaude
andcommitted
docs: add scope page and fix inaccurate deployment claims
Add docs/scope.md covering design boundaries, infrastructure constraints, and when to use alternatives. Fix deployment.md: replace false zero-downtime claim with honest deploy behavior, correct 3-environment promotion to actual 2-environment model. Update cross-references in tutorial.md, deploy-prompt.md, README.md, AGENTS.md, and mkdocs.yml. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e35b731 commit 7955093

8 files changed

Lines changed: 84 additions & 17 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ docs/ # All documentation (Markdown)
1111
index.md # Landing page
1212
architecture.md # Platform design, tech stack, diagrams
1313
spec.md # Application contract (ports, endpoints, env vars)
14-
deployment.md # CI/CD pipeline, zero-downtime deploys, migrations
14+
deployment.md # CI/CD pipeline, deploy behavior, migrations
1515
self-hosting.md # Fork model, server requirements, bootstrap
1616
preview-environments.md # PR previews, DNS, cleanup
1717
ecosystem.md # Org structure, app template, multi-app hosting

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Full documentation is available at **[towlion.github.io/platform](https://towlio
1010

1111
- [Architecture](https://towlion.github.io/platform/architecture/) — platform design, tech stack, diagrams
1212
- [App Specification](https://towlion.github.io/platform/spec/) — application contract (ports, endpoints, env vars)
13-
- [Deployment](https://towlion.github.io/platform/deployment/) — CI/CD pipeline, zero-downtime deploys, migrations
13+
- [Scope](https://towlion.github.io/platform/scope/) — design boundaries and when to use something else
14+
- [Deployment](https://towlion.github.io/platform/deployment/) — CI/CD pipeline, deploy behavior, migrations
1415
- [Self-Hosting](https://towlion.github.io/platform/self-hosting/) — fork model, server requirements, bootstrap
1516
- [Preview Environments](https://towlion.github.io/platform/preview-environments/) — PR previews, DNS, cleanup
1617
- [Ecosystem](https://towlion.github.io/platform/ecosystem/) — org structure, app template, multi-app hosting

docs/deploy-prompt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ Important notes:
5858
## See also
5959

6060
- [Tutorial](tutorial.md) — step-by-step walkthrough with detailed commands
61-
- [Deployment](deployment.md) — pipeline internals and zero-downtime strategy
61+
- [Deployment](deployment.md) — pipeline internals and deploy behavior
6262
- [Self-Hosting](self-hosting.md) — fork model and infrastructure overview

docs/deployment.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,27 @@ Deployment command:
3939
docker compose up -d --build
4040
```
4141

42-
## Zero-Downtime Deployments
42+
## Deploy Behavior
4343

44-
The platform uses rolling updates to keep applications available during deployments.
44+
The platform rebuilds and restarts containers on each deploy. There is a brief gap where the application is unavailable.
4545

4646
```
47-
Current version (v1) running
47+
Stop current container
4848
4949
50-
Start new container (v2)
50+
Rebuild image from source
5151
52-
Health check passes
52+
53+
Start new container
5354
5455
55-
Switch traffic to v2
56+
Health check passes
5657
5758
58-
Stop v1
59+
Caddy routes traffic
5960
```
6061

61-
Docker Compose starts the new container before removing the old one. The reverse proxy (Caddy) only forwards traffic to healthy services.
62+
During the rebuild and restart, Caddy returns 502 for requests to the application. This gap is typically a few seconds. For the target use case — small apps with low traffic — this is acceptable. See [Scope and Design Boundaries](scope.md) for when to consider alternatives.
6263

6364
### Docker Health Check Configuration
6465

@@ -74,7 +75,7 @@ services:
7475
retries: 5
7576
```
7677
77-
If the health check fails, traffic stays on the previous version.
78+
If the health check fails, Docker will restart the container according to the `restart: always` policy.
7879

7980
## Database Migrations
8081

@@ -131,26 +132,26 @@ curl https://app.example.com/health
131132

132133
## Environment Promotion
133134

134-
The platform supports promotion through environments:
135+
The platform has two environments:
135136

136137
```
137138
Pull Request → Preview environment
138-
Merge to develop → Staging deployment
139139
Merge to main → Production deployment
140140
```
141141

142142
| Branch | Environment |
143143
|---|---|
144144
| PR branch | Preview |
145-
| `develop` | Staging |
146145
| `main` | Production |
147146

147+
Preview environments are created automatically for pull requests and cleaned up when the PR is closed. See [Preview Environments](preview-environments.md) for details.
148+
148149
## Platform Capabilities Summary
149150

150151
| Feature | Implementation |
151152
|---|---|
152153
| CI/CD | GitHub Actions |
153-
| Zero-downtime deploys | Rolling container updates |
154+
| Deploy pipeline | Rebuild and restart on push to main |
154155
| Database migrations | Alembic |
155156
| Preview environments | PR deployments |
156157
| Object storage | MinIO |

docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ GitHub repository → GitHub Actions → SSH deploy → server runtime
2020

2121
Each repository contains everything required to deploy itself. Push code, and your application is live.
2222

23+
See [Scope and Design Boundaries](scope.md) for what the platform does and does not do.
24+
2325
## Key Features
2426

2527
- **GitHub-native deployment** — no custom CLI or dashboard needed

docs/scope.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Scope and Design Boundaries
2+
3+
## What Towlion Is
4+
5+
- A **single-server micro-PaaS** for deploying small web applications
6+
- **GitHub as the control plane** — no custom dashboard, CLI, or API
7+
- **Docker Compose** for container orchestration, **Caddy** for reverse proxy and automatic TLS
8+
- **Fork-to-deploy** model — fork a template repo, configure secrets, push to deploy
9+
- **Opinionated stack** — FastAPI, PostgreSQL, Redis, MinIO, Celery
10+
11+
## Design Boundaries
12+
13+
These are intentional constraints, not missing features. They keep the platform simple and predictable.
14+
15+
### Infrastructure
16+
17+
| Boundary | Detail |
18+
|---|---|
19+
| Single server only | No clustering, no multi-server, no load balancing. Your server is a single point of failure by design. |
20+
| Debian Linux only | The bootstrap script targets Debian 12. Other distributions are untested. |
21+
| No automated server provisioning | You create and manage your own server. The bootstrap script configures it, but you are responsible for procurement and access. |
22+
| Fixed resource limits | Static CPU and memory limits per container. No auto-scaling. |
23+
24+
### Deployment
25+
26+
| Boundary | Detail |
27+
|---|---|
28+
| Brief downtime during deploys | `docker compose up -d --build` rebuilds and restarts containers. Caddy returns 502 during the gap. This is typically a few seconds. |
29+
| No built-in test pipeline | The deploy workflow builds and deploys. It does not run your test suite — add that step yourself if needed. |
30+
| Push-to-main deploys | No staging environment, no approval gates, no canary or blue-green deploys. Merging to `main` deploys to production. |
31+
32+
### Operations
33+
34+
| Boundary | Detail |
35+
|---|---|
36+
| No high availability | Single PostgreSQL, Redis, and MinIO instances. No replication or automatic failover. |
37+
| 5-minute alert granularity | Health checks run via cron every 5 minutes. This is not real-time monitoring. |
38+
| 7-day backup retention | Daily `pg_dump` with 7-day retention. Recovery is manual. There is no disaster recovery plan beyond these backups. |
39+
| No multi-tenant management | Each fork is independent. There is no shared admin panel or centralized management across apps. |
40+
41+
### Technology
42+
43+
| Boundary | Detail |
44+
|---|---|
45+
| Not Kubernetes | Docker Compose only. If you need pods, services, ingress controllers, or declarative infrastructure, use Kubernetes. |
46+
| Opinionated stack | FastAPI + PostgreSQL + Redis + MinIO + Caddy. Other frameworks and databases are outside the supported path. |
47+
| No container registry | Images are built on the server from source code. There is no registry push/pull step. |
48+
49+
## When to Use Something Else
50+
51+
| If you need... | Consider instead |
52+
|---|---|
53+
| Multi-server / high availability | Kubernetes, Docker Swarm, Nomad |
54+
| Auto-scaling | AWS ECS, Cloud Run, Fly.io |
55+
| Managed databases | AWS RDS, DigitalOcean Managed DB |
56+
| Zero-downtime deploys | Kubernetes rolling updates, blue-green deploy tooling |
57+
| Large-scale traffic | Cloud-native platforms with load balancers |
58+
| Non-Python backends | Dokku, Coolify, CapRover |
59+
60+
## Sweet Spot
61+
62+
Towlion is built for indie developers, small SaaS products, personal tools, hobby projects, and AI-generated applications. If your app serves a handful of users, runs comfortably on a single server, and you want to own your infrastructure without managing Kubernetes, Towlion is a good fit.

docs/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ git commit -m "feat: add new feature"
236236
git push origin main
237237
```
238238

239-
GitHub Actions runs the deployment pipeline automatically. The platform uses [rolling updates](deployment.md#zero-downtime-deployments) so your application stays available during deploys.
239+
GitHub Actions runs the deployment pipeline automatically. Your application will be briefly unavailable during the rebuild (typically a few seconds).
240240

241241
To pull upstream changes from the original repository:
242242

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ extra_css:
3131

3232
nav:
3333
- Home: index.md
34+
- Scope: scope.md
3435
- Tutorial: tutorial.md
3536
- Architecture: architecture.md
3637
- App Specification: spec.md

0 commit comments

Comments
 (0)