How to run SyncBot locally (Dev Container, Docker Compose, native Python) and manage dependencies. For cloud deploy and CI/CD, see DEPLOYMENT.md. For runtime env vars in any environment, see INFRA_CONTRACT.md.
The upstream repository (F3Nation-Community/syncbot) is the shared codebase. Each deployment maintains its own fork:
| Branch | Role |
|---|---|
main |
Tracks upstream. Use it to merge PRs and to sync with the upstream repository (git pull upstream main, etc.). |
test / prod |
On your fork, use these for deployments: GitHub Actions deploy workflows run on push to test and prod (see DEPLOYMENT.md). |
Typical flow: develop on a feature branch → open a PR to main → merge → when ready to deploy, merge main into test or prod on your fork.
Needs: Docker Desktop (or Docker Engine on Linux) + Dev Containers in VS Code.
cp .env.example .envand setSLACK_BOT_TOKEN(xoxb-...).- Dev Containers: Reopen in Container — Python, MySQL, and deps run inside the container.
cd syncbot && python app.py→ app on port 3000 (forwarded).- Expose to Slack with cloudflared or ngrok from the host; set Slack Event Subscriptions / Interactivity URLs to the public URL.
Optional SQLite: in .env set DATABASE_BACKEND=sqlite and DATABASE_URL=sqlite:////app/syncbot/syncbot.db.
cp .env.example .env # set SLACK_BOT_TOKEN
docker compose up --buildApp on port 3000; restart the app service after code changes.
Needs: Python 3.12+, Poetry. Run MySQL locally (e.g. docker run ... mysql:8) or SQLite. See .env.example and INFRA_CONTRACT.md.
.env.example— local env vars with comments.- INFRA_CONTRACT.md — runtime contract for any cloud (DB, Slack, OAuth, production vs local).
syncbot/
├── syncbot/ # App (app.py); slack_manifest_scopes.py = bot/user OAuth scope lists (manifest + SLACK_BOT_SCOPES / SLACK_USER_SCOPES)
├── syncbot/db/alembic/ # Migrations (bundled with app for Lambda)
├── tests/
├── docs/
├── infra/aws/ # SAM, bootstrap stack
├── infra/gcp/ # Terraform
├── deploy.sh # Root launcher (macOS / Linux / Git Bash)
├── deploy.ps1 # Windows launcher → Git Bash or WSL → infra/.../deploy.sh
├── slack-manifest.json
└── docker-compose.yml
After poetry add / poetry update, regenerate the pinned file used by the Docker image and pip-audit in CI so it matches poetry.lock:
poetry self add poetry-plugin-export # Poetry 2.x; once per Poetry install
poetry export -f requirements.txt --without-hashes -o syncbot/requirements.txtThe root ./deploy.sh may run poetry update and regenerate syncbot/requirements.txt when Poetry is on your PATH (see DEPLOYMENT.md).
CI runs pip-audit on syncbot/requirements.txt and infra/aws/db_setup/requirements.txt (see .github/workflows/ci.yml).