Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8dabd63
do not mount codebase as volume
AlexAxthelm Mar 23, 2026
5d460f4
Remove prod-docker target
AlexAxthelm Mar 23, 2026
de62df0
add compose profiles for services
AlexAxthelm Mar 23, 2026
415133a
Move adminer to local services
AlexAxthelm Mar 23, 2026
2b6db31
add deployment-specific stacks for dev environment
AlexAxthelm Mar 23, 2026
2fd5706
wip: seeding for api container
AlexAxthelm Mar 23, 2026
e9b989c
seed for frontend dev
AlexAxthelm Mar 23, 2026
96d71c7
Sucessfully run API locally, with other services in docker
AlexAxthelm Mar 25, 2026
5b91c7f
Merge branch 'main' into cleanup-docker-makefile
AlexAxthelm Mar 25, 2026
75181bf
remove seed mode from db-init
AlexAxthelm Mar 25, 2026
9d0fe9c
Update envvar file, api-dev target works
AlexAxthelm Mar 26, 2026
73e49c5
cleanup of frontend-dev target
AlexAxthelm Mar 26, 2026
b11a86e
add target to follow docker logs
AlexAxthelm Mar 26, 2026
99b0ca6
style: format
AlexAxthelm Mar 26, 2026
df4fb01
Update UV testing targets, some reordering
AlexAxthelm Mar 26, 2026
cc4bd35
reflow dev stack block
AlexAxthelm Mar 26, 2026
104b168
use actual target definitions for packages
AlexAxthelm Mar 26, 2026
d2c5253
update PHONY block
AlexAxthelm Mar 26, 2026
48de3be
Add python build targets
AlexAxthelm Mar 26, 2026
5fd2d3a
update target names in CI checks
AlexAxthelm Mar 26, 2026
778d5fb
Use different var name than `PATH`
AlexAxthelm Mar 26, 2026
a6a63a1
Update test to use new resource signatures
AlexAxthelm Mar 26, 2026
5541a94
update HACKING.md with new startup procedures
AlexAxthelm Mar 26, 2026
5e324c8
pass log level to init container
AlexAxthelm Mar 26, 2026
f3c841f
Use correct envvar for super user
AlexAxthelm Mar 26, 2026
f40132b
Update Makefile
AlexAxthelm Mar 26, 2026
7ad279d
Better error handling
AlexAxthelm Mar 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
python-version-file: ".python-version"

- name: Build
run: make build-python
run: make py-build
3 changes: 1 addition & 2 deletions .github/workflows/python-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ jobs:
python-version-file: ".python-version"

- name: Run format check
run: make uv-format-check

run: make py-format-check
2 changes: 1 addition & 1 deletion .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
python-version-file: ".python-version"

- name: Run Linter
run: make uv-lint
run: make py-lint
2 changes: 1 addition & 1 deletion .github/workflows/python-lock-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
python-version-file: ".python-version"

- name: Lock check
run: make uv-lock-check
run: make py-lock-check
2 changes: 1 addition & 1 deletion .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
python-version-file: ".python-version"

- name: Run Tests
run: make uv-test-isolated
run: make py-test-exact
162 changes: 125 additions & 37 deletions HACKING.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,173 @@
# Hacking on Stitch

This guide covers day-to-day development in the current Stitch monorepo.
This guide covers the day-to-day development workflow in the Stitch monorepo.

## Monorepo layout

- `packages/stitch-auth`: auth/claims/validation package
- `deployments/api`: FastAPI service (`stitch-api`)
- `deployments/stitch-frontend`: React + Vite frontend
- `deployments/db`: DB bootstrap/role scripts
* `deployments/api` — FastAPI service (`stitch-api`)
* `deployments/stitch-frontend` — React + Vite frontend
* `deployments/db` — database bootstrap and role scripts
* `deployments/seed` — local seed data tooling
* `packages/` — shared Python packages

## Prerequisites

- Docker Desktop (`docker`, `docker compose`)
- `uv` for Python dependency/workspace management
- Node.js + npm (for frontend-only workflows)
* Docker Desktop (`docker`, `docker compose`)
* `uv` for Python dependency and workspace management
* Node.js + npm for frontend development

## First-time setup

From the repo root:

```bash
cp env.example .env
make uv-sync-dev
```

You can also run the equivalent `uv` command directly:

```bash
uv sync --group dev --all-packages
```

If you are running the full stack via Docker, `uv sync` is optional unless you also run tests/tools on host.
## The main entrypoints

In most cases, start with one of these three commands:

* `make frontend-dev`
* `make api-dev`
* `make dev-docker` (or `make reboot-docker`)

### `make frontend-dev`

Use this when you are primarily working on the frontend.

This target:

* installs frontend dependencies if needed
* starts the supporting local services in Docker
* runs the Vite dev server on the host

The API and supporting services run in Docker, while the frontend runs locally with fast rebuilds.

```bash
make frontend-dev
```

### `make api-dev`

Use this when you are primarily working on the API.

This target:

## Run the stack (recommended)
* starts the supporting local services in Docker
* runs the FastAPI app on the host with reload enabled

The frontend and supporting services run in Docker, while the API runs locally for a tighter backend loop.

```bash
docker compose up --build
make api-dev
```

Or:
### `make dev-docker`

Use this when you want the whole local stack running in Docker.

This is the best choice when you want the most production-like local setup or do not need to run either app directly on the host.

```bash
make dev-docker
```

Useful local URLs:
## Which one should I use?

A simple rule of thumb:

* changing React/UI code: `make frontend-dev`
* changing FastAPI/backend code: `make api-dev`
* validating the whole stack together: `make dev-docker`

## Useful local URLs

Depending on which entrypoint you use, these are the main local endpoints:

* Frontend: `http://localhost:3000`
* API docs: `http://localhost:8000/docs`
* Adminer: `http://localhost:8081`

## Other useful targets

You do not need to memorize the whole Makefile, but these are worth knowing.

- Frontend: http://localhost:3000
- API docs: http://localhost:8000/docs
- Adminer: http://localhost:8081
### `make check`

## Common dev commands
Runs the main verification suite in one command:

Run from repo root.
* lint
* tests
* format checks
* lockfile checks

Use this before pushing or when you want a quick confidence pass.

```bash
make lint
make test
make format
make format-check
make check
```

Python-only:
### `make clean`

Resets local build artifacts, caches, frontend install/build outputs, and Docker state.

⚠️ **Warning:** this target includes `clean-docker`, which removes Docker containers **and volumes**. This will delete your local database data.

Use this when you want a completely fresh environment.

```bash
uv run ruff check
uv run ruff format
uv run pytest deployments/api
make clean
```

Frontend-only:
### `make reboot-docker`

Performs a clean Docker reset and immediately brings the full stack back up with builds.

This is a convenience target for the common “wipe it and restart everything” workflow.

```bash
npm --prefix deployments/stitch-frontend ci
npm --prefix deployments/stitch-frontend run dev
npm --prefix deployments/stitch-frontend run lint
npm --prefix deployments/stitch-frontend run test:run
make reboot-docker
```
## Reset local DB data

### `make follow-stack-logs`

Follows logs for the full Docker-based local stack.

Useful when debugging service startup or cross-service interactions.

```bash
docker compose down -v
docker compose up db api frontend
make follow-stack-logs
```

Or:
## Common quality commands

From the repo root:

```bash
make clean-docker
make dev-docker
make lint
make test
make format
make format-check
make lock-check
make check
```

## When things get weird

A good escalation path is:

```bash
make check
make clean
make reboot-docker
```

That sequence catches most local issues caused by stale caches, stale frontend installs, or stale Docker volumes.
Loading
Loading