Flake to setup a local env for atproto development

Its working !

edouard.paris 18e40f14 f887e1a3

verified
Changed files
+84
packages
+78
README.md
···
+
# AT Protocol Development Environment
+
+
A Nix-based development environment for running AT Protocol services (PDS, PLC, Caddy proxy, and MailHog).
+
+
## Quick Start
+
+
1. **Enter the development environment:**
+
```bash
+
nix develop
+
```
+
+
2. **Start all services in tmux:**
+
```bash
+
nix run .#all
+
```
+
This will start all services in a 2x2 tmux pane layout:
+
- Top-left: PLC server
+
- Bottom-left: MailHog server
+
- Top-right: PDS server
+
- Bottom-right: Caddy proxy
+
+
3. **Create an invite code:**
+
```bash
+
scripts/create-invite.sh
+
```
+
+
4. **Create a user account:**
+
```bash
+
goat account create \
+
--pds-host=https://pds.example.org:8443 \
+
--password=password \
+
--email=hello@example.org \
+
--invite-code=pds-example-org:8443-xyldq-yrhxc \
+
--handle=edouard.pds.example.org
+
```
+
+
Expected output:
+
```
+
Success!
+
DID: did:plc:pzvsc3jwfjwidojtpbxv4rdd
+
Handle: edouard.pds.example.org
+
```
+
+
5. **Verify the DID is registered:**
+
```bash
+
goat --plc-host=https://plc.example.org data did:plc:pzvsc3jwfjwidojtpbxv4rdd
+
```
+
+
## Services
+
+
- **Bluesky PDS**: https://pds.example.org:8443
+
- **DID PLC**: https://plc.example.org:8444
+
- **MailHog**: http://localhost:8025
+
+
## Available Tools
+
+
- `goat` - AT Protocol CLI tool
+
- `curl`, `jq` - HTTP and JSON utilities
+
- `tmux` - Terminal multiplexer
+
+
## Management Commands
+
+
- `tmux attach -t atproto` - Attach to the services session
+
- `tmux kill-session -t atproto` - Stop all services
+
- `nix run .#generate-certs` - Generate SSL certificates
+
+
## Prerequisites
+
+
Make sure to add these lines to your `/etc/hosts` file:
+
```
+
127.0.0.1 pds.example.org
+
127.0.0.1 plc.example.org
+
```
+
+
Generate SSL certificates before first use:
+
```bash
+
nix run .#generate-certs
+
```
+6
packages/pds.nix
···
export PDS_HOSTNAME="pds.example.org:8443"
export PDS_SERVICE_URL="https://pds.example.org:8443"
+
# Configure supported handle domains
+
export PDS_SERVICE_HANDLE_DOMAINS=".pds.example.org"
+
# Enable development mode
export PDS_DEV_MODE="true"
+
+
# Configure logging
+
export LOG_ENABLED="true"
# Configure SMTP for MailHog
export PDS_EMAIL_SMTP_URL="smtp://localhost:1025"