630b07d48f3a27659ad5e723f141e191a2915926
Three real, reproducible bugs in DEPLOYMENT.md's app-server setup steps, each found by actually following the guide on a real box rather than static review: - useradd --system --create-home is unreliable on Debian in both directions: sometimes it silently skips creating the home directory, sometimes it creates it AND populates it from /etc/skel (.bashrc/.profile/.bash_logout). Either way it broke a later step -- the skel files make git clone refuse to clone into a non-empty directory. Fixed by dropping --create-home and creating the directory ourselves, deferring anything else that goes in it (uploads/) until after the clone. - Documented a personal/deployment-user access token as a first-class alternative to the SSH deploy key for cloning, alongside its plaintext- in-.git/config tradeoff. - The create-user command nested a user-chosen password inside two layers of shell quoting (an outer bash -c '...' plus inner double quotes) -- fragile for any password with a space or a literal '. Replaced with dropping into an authenticated interactive shell first, so there's only one layer of quoting to get right at an actual prompt. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
DS Chat
A web-based team chat service (Mattermost-style, no threaded conversations), invite-only. See ARCHITECTURE.md for the full system design and phased build plan.
Phase 1: auth, open-room CRUD, and single-instance WebSocket chat, backend
- a minimal frontend. Phase 2: private rooms, room roles (owner/admin/ member), and room invites — backend only, see below. Later phases (push notifications, Redis fan-out, the admin portal, the bot/extension system, and production deployment) are tracked as issues in the repo's issue tracker, prioritized.
Structure
backend/— FastAPI + SQLAlchemy 2.0 (async) + PostgreSQL. Seebackend/README.mdfor local setup, migrations, how to create a user (site registration is invite-only — no public sign-up endpoint), and the Phase 2 room-roles/invites API.frontend/— React + Vite PWA (login, room list, chat view). Still Phase-1-only: it doesn't yet call any of the Phase 2 endpoints. A UI redesign is happening separately; frontend work resumes once that lands.
Quickstart
# 1. Postgres (see backend/README.md for details)
docker run -d --name ds-chat-postgres \
-e POSTGRES_USER=ds_chat -e POSTGRES_PASSWORD=ds_chat -e POSTGRES_DB=ds_chat \
-p 5432:5432 postgres:16-alpine
# 2. Backend
cd backend
python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
cp .env.example .env # then set SESSION_SECRET
.venv/bin/alembic upgrade head
.venv/bin/python -m app.cli create-user alice alice@example.com "some-password"
.venv/bin/uvicorn app.main:app --reload &
# 3. Frontend (in another shell)
cd frontend
npm install
npm run dev
Then open http://localhost:5173 and log in with the account created above.
The Vite dev server proxies /api and /ws to the backend on :8000, so no
CORS configuration is needed in development.
Deployment
See DEPLOYMENT.md for the full production runbook — two Debian 13 servers, no containers, matching ARCHITECTURE.md §9.