You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/API-ROUTES.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ Devonz uses Remix file-based routing. All API endpoints are in `app/routes/api.*
11
11
-`action()` — Handles POST/PUT/DELETE requests
12
12
-`loader()` — Handles GET requests
13
13
14
+
All route handlers are wrapped with `withSecurity()` from `app/lib/security.ts`. This middleware enforces CORS origin validation, SameSite=Strict cookie policy, and input sanitization.
15
+
14
16
---
15
17
16
18
## Chat & AI
@@ -133,6 +135,7 @@ Validated with Zod. Returns a data stream with:
133
135
|`/api/system/git-info`| GET | Git installation and version info |
134
136
|`/api/update`| GET | Check for application updates |
135
137
|`/api/bug-report`| POST | Submit bug reports |
138
+
|`/api/version-check`| GET | Compares local commit hash against latest GitHub commit to detect available updates |
There is no server-side session management — all auth state lives in browser cookies.
168
171
172
+
Additionally, all routes are protected by the `withSecurity()` wrapper which validates CORS origins, enforces `SameSite=Strict` on cookies, and applies a domain allowlist on the git proxy route (`/api/git-proxy/*`).
~35 Remix API routes. See [API Routes](API-ROUTES.md).
103
+
~36 Remix API routes. See [API Routes](API-ROUTES.md).
104
104
105
-
**Key pattern**: Routes use Remix conventions — `action()` for POST/PUT/DELETE, `loader()` for GET. Server-only code lives in `app/lib/.server/`.
105
+
**Key pattern**: Routes use Remix conventions — `action()` for POST/PUT/DELETE, `loader()` for GET. Server-only code lives in `app/lib/.server/`. All route handlers are wrapped with `withSecurity()` from `app/lib/security.ts`, which enforces CORS origin validation, SameSite cookie attributes, and request sanitization.
6.**CSS custom properties for theming**: All theme colors flow through `--bolt-elements-*` variables, enabling runtime theme switching without rebuilds.
198
198
199
+
7.**Security by default** — Every API route is wrapped with `withSecurity()`, enforcing CORS, SameSite cookies, and a URL allowlist on the git proxy.
200
+
201
+
8.**Docker-first deployment** — Multi-stage Dockerfile + docker-compose.yml with GHCR CI/CD and optional Watchtower auto-update enables one-command self-hosting.
202
+
203
+
9.**Startup performance** — Vite `optimizeDeps` pre-bundles critical dependencies and unconfigured LLM providers are skipped during initialization.
Copy file name to clipboardExpand all lines: docs/DEPLOYMENT.md
+95Lines changed: 95 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,101 @@ Devonz supports deploying generated projects to four platforms directly from the
10
10
11
11
---
12
12
13
+
## Docker Self-Hosting
14
+
15
+
### Quick Start
16
+
17
+
```bash
18
+
# 1. Clone the repo
19
+
git clone https://github.com/zebbern/Devonz.git
20
+
cd Devonz/bolt.diy
21
+
22
+
# 2. Copy environment template
23
+
cp .env.example .env.local
24
+
# Edit .env.local with your API keys
25
+
26
+
# 3. Run with Docker Compose (pulls from GHCR)
27
+
docker compose up -d
28
+
```
29
+
30
+
### Building Locally
31
+
32
+
```bash
33
+
pnpm docker:build # Build image locally
34
+
pnpm docker:run # Run standalone container
35
+
docker compose up -d --build # Build + run via Compose
36
+
```
37
+
38
+
### Docker Image
39
+
40
+
The project publishes Docker images to GitHub Container Registry on every push to `main`:
41
+
42
+
-**Image**: `ghcr.io/zebbern/devonz:latest`
43
+
-**Base**: `node:20-slim` with `git` and `curl`
44
+
-**Size**: ~1.5 GB
45
+
-**User**: Non-root (`appuser:1001`)
46
+
47
+
### Docker Compose Profiles
48
+
49
+
| Profile | Command | Description |
50
+
| --- | --- | --- |
51
+
| Default |`docker compose up -d`| Production mode |
52
+
| Dev |`docker compose --profile dev up devonz-dev`| Dev mode with hot reload |
53
+
| Auto-Update |`docker compose --profile auto-update up -d`| Adds Watchtower for automatic updates |
54
+
55
+
### Environment Variables
56
+
57
+
Set `RUNNING_IN_DOCKER=true` in your Docker environment (automatically set in docker-compose.yml). This adjusts Ollama and LMStudio base URLs to use `host.docker.internal` instead of `localhost`.
58
+
59
+
See `.env.example` for the complete list of 55+ environment variables.
60
+
61
+
---
62
+
63
+
## CI/CD Pipeline
64
+
65
+
### GitHub Actions
66
+
67
+
The workflow at `.github/workflows/docker-publish.yml` automatically builds and pushes Docker images to GHCR.
68
+
69
+
**Triggers:**
70
+
- Push to `main` branch → tags image as `latest` and `sha-<hash>`
71
+
- Push version tag (e.g., `v1.0.0`) → tags image as `1.0.0` and `1.0`
72
+
73
+
**Features:**
74
+
- Docker Buildx with GitHub Actions cache for fast rebuilds
The `/api/version-check` endpoint compares the local git commit hash against the latest commit on `main` via the GitHub API. The `UpdateBanner` component in the UI uses this to show a non-intrusive notification when updates are available.
85
+
86
+
### Updating
87
+
88
+
**Git Clone users:**
89
+
```bash
90
+
pnpm run update # Pulls latest, installs, rebuilds
|`pnpm docker:dev`| Dev mode with hot reload in Docker |
165
+
|`pnpm docker:update`| Pull latest GHCR image and restart |
166
+
167
+
---
168
+
169
+
## Running with Docker
170
+
171
+
### Quick Start (Pull from GHCR)
172
+
173
+
```bash
174
+
# Copy env template
175
+
cp .env.example .env.local
176
+
# Edit .env.local with your API keys
177
+
178
+
# Pull and run
179
+
docker compose up -d
180
+
```
181
+
182
+
### Build Locally
183
+
184
+
```bash
185
+
pnpm docker:build # Build image
186
+
pnpm docker:run # Run standalone
187
+
# or
188
+
docker compose up -d --build # Build + run via Compose
189
+
```
190
+
191
+
### Auto-Update (Watchtower)
192
+
193
+
```bash
194
+
# Automatically pulls new images every 5 minutes
195
+
docker compose --profile auto-update up -d
196
+
```
197
+
198
+
The `RUNNING_IN_DOCKER=true` environment variable is set automatically in the Docker Compose configuration, which adjusts Ollama and LMStudio base URLs to use `host.docker.internal`.
199
+
200
+
---
201
+
202
+
## Updating Devonz
203
+
204
+
### Git Clone Users
205
+
206
+
```bash
207
+
pnpm run update # Pull, install, rebuild
208
+
pnpm run update -- --skip-build # Pull + install only
209
+
```
210
+
211
+
### Docker Users
212
+
213
+
```bash
214
+
pnpm docker:update # Pull latest image + restart
215
+
```
216
+
217
+
The app shows a blue banner at the top of the page when a new version is available, with instructions for both update methods.
0 commit comments