61 lines
1.6 KiB
Markdown
61 lines
1.6 KiB
Markdown
# WriteKit - Local Development
|
|
|
|
## Prerequisites
|
|
- Docker & Docker Compose
|
|
- GitHub OAuth App (for login)
|
|
|
|
## Setup GitHub OAuth
|
|
1. Go to https://github.com/settings/developers
|
|
2. New OAuth App:
|
|
- Name: `WriteKit Local`
|
|
- Homepage: `http://writekit.lvh.me`
|
|
- Callback: `http://writekit.lvh.me/auth/github/callback`
|
|
3. Copy Client ID and Secret
|
|
|
|
## Run
|
|
```bash
|
|
# Set OAuth credentials
|
|
export GITHUB_CLIENT_ID=your_client_id
|
|
export GITHUB_CLIENT_SECRET=your_client_secret
|
|
|
|
# Start
|
|
docker compose up --build
|
|
```
|
|
|
|
Or create `.env` file:
|
|
```
|
|
GITHUB_CLIENT_ID=your_client_id
|
|
GITHUB_CLIENT_SECRET=your_client_secret
|
|
```
|
|
|
|
## Access
|
|
- **Platform**: http://writekit.lvh.me
|
|
- **Traefik dashboard**: http://localhost:8080
|
|
- **MinIO console**: http://localhost:9001 (minioadmin/minioadmin)
|
|
|
|
## Create a demo
|
|
```bash
|
|
curl -X POST http://writekit.lvh.me/api/demo
|
|
```
|
|
Returns subdomain like `demo-abc123.writekit.lvh.me` - works automatically, no hosts file needed.
|
|
|
|
## Environment Variables
|
|
|
|
### Required
|
|
| Variable | Description |
|
|
|----------|-------------|
|
|
| `DATABASE_URL` | PostgreSQL connection string |
|
|
| `DOMAIN` | Base domain |
|
|
| `BASE_URL` | Full URL for OAuth callbacks |
|
|
| `SESSION_SECRET` | Cookie encryption (32+ chars) |
|
|
| `GITHUB_CLIENT_ID` | GitHub OAuth client ID |
|
|
| `GITHUB_CLIENT_SECRET` | GitHub OAuth secret |
|
|
|
|
### Optional
|
|
| Variable | Description |
|
|
|----------|-------------|
|
|
| `GOOGLE_CLIENT_ID/SECRET` | Google OAuth |
|
|
| `DISCORD_CLIENT_ID/SECRET` | Discord OAuth |
|
|
| `R2_*` | Cloudflare R2 storage |
|
|
| `IMAGINARY_URL` | Image processing service |
|
|
| `CLOUDFLARE_API_TOKEN/ZONE_ID` | Analytics |
|