From dd7a19f113fe3110d8178c2b4bf9fcc32809f8b6 Mon Sep 17 00:00:00 2001 From: Alex Palmer <24211477+ThatAlexPalmer@users.noreply.github.com> Date: Wed, 19 Aug 2026 08:57:55 -0400 Subject: [PATCH 1/3] fix(docker): publish TAP Mongo on 27027 and stop auto-restart Local Mongo used restart: always on host 27017, so Docker Desktop brought it back and stole the default Mongo port. Pin mongo:8.2, publish 27027, and bind-mount app source for Docker hot reload. --- .env.example | 5 +- AGENTS.md | 2 + CLAUDE.md | 63 +------------------ README.md | 7 ++- WARP.md | 20 +++--- app/WARP.md | 2 +- docker-compose.yml | 20 +++++- docker/Dockerfile.app | 4 +- docs/src/pages/development/factory-deploy.mdx | 2 +- docs/src/pages/development/run-server.mdx | 5 +- docs/src/pages/development/setup.mdx | 2 +- package.json | 1 + scripts/bootstrap-plume.sh | 3 +- scripts/dev.sh | 10 +-- scripts/setup.sh | 4 +- 15 files changed, 55 insertions(+), 95 deletions(-) diff --git a/.env.example b/.env.example index 377e304e..45f750cc 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,9 @@ # Offchain db connection string for mongodb -DATABASE_URL="mongodb://tap:tap@localhost:27017/mongo?authSource=admin&retryWrites=true&w=majority" +# TAP publishes Mongo on host 27027 (container still uses 27017) so it does not steal +# the default Mongo port. Override with MONGO_PORT in docker-compose if needed. +DATABASE_URL="mongodb://tap:tap@localhost:27027/mongo?authSource=admin&retryWrites=true&w=majority" DATABASE_REPLSET="0" # set to "1" if using --replSet option in mongo. this allows transactions +# MONGO_PORT=27027 # RPC URL for blockchain connection # Anvil (local): http://127.0.0.1:8545 diff --git a/AGENTS.md b/AGENTS.md index 74d0302d..0d593d51 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -24,6 +24,7 @@ pnpm app:dev # http://localhost:3000/app (reads app/.en | Piece | Process | | --- | --- | | Mongo + API + poller | Docker via `pnpm bootstrap` / `docker compose up` | +| Mongo only | `pnpm docker:mongo` — **host port 27027** (not 27017). `restart: unless-stopped`. `pnpm docker:down` frees the port. | | Product UI / wallet | Host `pnpm app:dev` + `app/.env.local` + browser extension wallet (EIP-6963, no cloud key) | | Contract artifacts | `pnpm setup` → `chain/out` (required before server image build) | | Factory in Mongo | `REUSE_TAP_FACTORY=1` (demo) or `pnpm deploy-factory` (you own it) | @@ -46,6 +47,7 @@ pnpm app:dev # http://localhost:3000/app (reads app/.en | Stale factory impl in docs | Hardcoded old address | Always read impl onchain (`factory:register` does); live beacon ≠ landing screenshot | | Mint OK, register **500** | Docker app rewrites to `localhost:8293` | Docker: `NEXT_PUBLIC_API_URL=http://server:8293`; host app:dev: `localhost:8293` | | Poller `0xUPDATE_ME` / invalid BytesLike | Placeholder PRIVATE_KEY | Real hex for server-signed; placeholder OK for read-only poller | +| TAP Mongo on 27017 / other app blocked | Old compose published default Mongo port with `restart: always` | Host port is **27027**. Host `DATABASE_URL` uses 27027. Inside compose, Mongo is still `mongodb:27017`. `pnpm docker:down` then `pnpm docker:mongo`. | **Plume defaults:** `CHAIN_ID=98866`, `RPC_URL=https://rpc.plume.org`. Prefer mainnet for product work (not Anvil mint). diff --git a/CLAUDE.md b/CLAUDE.md index caa1956a..e4bc5434 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,64 +1,5 @@ # CLAUDE.md -Guidance for Claude Code working in the Transfer Agent Protocol (TAP) Cap Table monorepo. +Same guidance as [`AGENTS.md`](./AGENTS.md). Read that file, then [`WARP.md`](./WARP.md) and [`app/WARP.md`](./app/WARP.md), before changing this repo. -The canonical, always-up-to-date guidance for this repo lives in the `WARP.md` files. **Read them before making changes:** - -- [`WARP.md`](./WARP.md) — monorepo architecture, development commands, important patterns, security tooling, and Git workflow. -- [`app/WARP.md`](./app/WARP.md) — frontend (`tap-app`) conventions: routes under `/app`, styled-components, wallet/web3, generated contract hooks, direct-wallet write path. -- [`CONTRIBUTING.md`](./CONTRIBUTING.md) — branch, commit, and pull-request conventions. - -## Initial setup (agents) - -**Goal:** Mongo + API + poller on Plume, then host product UI. Do **not** treat Docker app alone as “ready for wallet work.” - -```bash -pnpm install -REUSE_TAP_FACTORY=1 pnpm bootstrap # Plume stack + register shared demo factory in Mongo -# Fill secrets once in .env AND app/.env.local: -# NEXT_PUBLIC_OPERATOR_ADDRESS, PRIVATE_KEY (if server-signed / deploy) -# Wallet UI: install a browser extension wallet (Rabby, MetaMask, etc.) — no cloud key needed -pnpm app:dev # http://localhost:3000/app (reads app/.env.local) -``` - -| Piece | Process | -| --- | --- | -| Mongo + API + poller | Docker via `pnpm bootstrap` / `docker compose up` | -| Product UI / wallet | Host `pnpm app:dev` + `app/.env.local` + browser extension wallet (EIP-6963, no cloud key) | -| Contract artifacts | `pnpm setup` → `chain/out` (required before server image build) | -| Factory in Mongo | `REUSE_TAP_FACTORY=1` (demo) or `pnpm deploy-factory` (you own it) | - -### Factory mental model (do not confuse) - -1. **Protocol builder** — ships BUSL contracts; owns the **shared demo** factory on Plume (`0xcd6…`, owner TAP Admin `0x366a…`). Beacon upgrades for that demo deployment. -2. **Transfer-agent business** — deploys **their own** `CapTableFactory` (`pnpm deploy-factory`). That factory is their book of business (many issuer cap tables). -3. **Issuer ADMIN** — calls `createCapTable` on a factory (permissionless); becomes admin of **that** cap table. Wallet manage UI is this path. Using the shared factory ≠ owning it. -4. **Mongo `factories`** — local mirror only (`factory:register` / deploy auto-register). Not onchain ownership. - -### Failure matrix (already hit in the wild) - -| Symptom | Cause | Fix | -| --- | --- | --- | -| Turbopack `Can't resolve '@tap/units'` on `:3000` | Docker app image missing `packages/` **or** Docker owns port while host expects `app:dev` | Fixed in `docker/Dockerfile.app` (`COPY packages/`); or `docker compose stop app` + `pnpm app:dev` | -| No wallets in connect modal | No browser extension / EIP-6963 | Install Rabby / MetaMask (EIP-6963) — no cloud key or project id needed | -| `COPY chain/out` docker build fail | Artifacts missing | `pnpm setup` / `forge build --via-ir`; bootstrap now asserts non-empty `chain/out` | -| Fresh Mongo empty of companies | Poller only tracks registered issuers | Mint new company, or Load from wallet / register existing; not auto-import of all chain history | -| Stale factory impl in docs | Hardcoded old address | Always read impl onchain (`factory:register` does); live beacon ≠ landing screenshot | -| Mint OK, register **500** | Docker app rewrites to `localhost:8293` | Docker: `NEXT_PUBLIC_API_URL=http://server:8293`; host app:dev: `localhost:8293` | -| Poller `0xUPDATE_ME` / invalid BytesLike | Placeholder PRIVATE_KEY | Real hex for server-signed; placeholder OK for read-only poller | - -**Plume defaults:** `CHAIN_ID=98866`, `RPC_URL=https://rpc.plume.org`. Prefer mainnet for product work (not Anvil mint). - -Bootstrap is idempotent — safe to re-run. Prefer `SKIP_APP=1 pnpm bootstrap` if you only need API and will run `pnpm app:dev` on the host. - -## Quick reminders - -- Package manager is **pnpm** (pnpm workspace monorepo) — do not use `npm` or `yarn`. -- Never commit directly to `main`; branch from it and open a PR. PR titles follow Conventional Commits. -- The blockchain is the source of truth; the off-chain DB mirrors it via the event poller. -- Don't hand-edit `app/src/generated.ts` — regenerate with `pnpm --filter tap-app generate:wagmi`. -- Shared write-path units live in **`@tap/units`** (`packages/units`): 1e10 scaling, UUID↔bytes16, share-cap checks. Import from there in app and server; don't reintroduce local `scaleAmount` copies or ×10000 docs. -- **Product UI is `/app/*`** (Companies, New company, company workspace). Marketing is `/`. Legacy `/mint` and `/manage*` redirect to `/app`. Frontend dev = `pnpm app:dev`. -- Manage UI write path is **direct-wallet only** (`useDirect*` + `useOnchainAction` + `/register-onchain` for class/person/issuance). **Transfer** = `useDirectTransferStock` → `CapTable.transferStock`; poller mirrors TransferStock — do not call the server transfer API from the UI. -- Company nav: use real `issuerId` via `capTableHref` / `query.issuerId` — never link with a pathname that still contains `[issuerId]`. -- Factory addresses are deployment-specific. Never hardcode impl addresses; keep Mongo `factories` and `app/.env.local` aligned. CLI/Mongo register is **local config**, not product onboarding. +Do not duplicate setup, factory, or failure-matrix notes here — edit `AGENTS.md` instead. diff --git a/README.md b/README.md index 5c68a936..bbf6c6c6 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ pnpm app:dev # Product UI — http://localhost:3000/app |---------|-----| | **Server** | http://localhost:8293 | | **App (host)** | http://localhost:3000 — use `pnpm app:dev` for wallet work (`app/.env.local`) | -| **MongoDB** | localhost:27017 | +| **MongoDB** | localhost:27027 (not 27017) | `pnpm bootstrap` is idempotent. Prefer host `pnpm app:dev` for the product UI; Docker app is optional. @@ -65,9 +65,10 @@ Then go read official [docs](https://docs.transferagentprotocol.xyz) ### Scripts ```bash -# Docker (runs all services: MongoDB, server, app) +# Docker (MongoDB, server, app) pnpm docker:up # Start all services -pnpm docker:down # Stop all services +pnpm docker:mongo # Mongo only (host 27027) +pnpm docker:down # Stop and remove containers (frees 27027) pnpm docker:logs # Stream logs pnpm docker:build # Rebuild and start diff --git a/WARP.md b/WARP.md index d9794cee..a9915099 100644 --- a/WARP.md +++ b/WARP.md @@ -137,15 +137,7 @@ REUSE_TAP_FACTORY=1 pnpm bootstrap # Mongo + API (+ app image), demo factory i pnpm app:dev # product UI — do not rely on Docker app alone ``` -`pnpm bootstrap` (`scripts/bootstrap-plume.sh`) is idempotent: ensures `.env` + `app/.env.local`, installs deps if needed, builds contracts and **asserts** non-empty `chain/out`, creates `offchain-db`, `docker compose up -d --build`, waits for API health, optionally registers the shared demo factory when `REUSE_TAP_FACTORY=1`. Use `SKIP_APP=1` to start only mongodb+server. - -**Factory model (required reading):** -- **Protocol builder** — owns shared demo factory on Plume (`0xcd6…`, owner TAP Admin `0x366a…`). -- **Transfer agent** — deploys **own** factory via `pnpm deploy-factory` (auto Mongo register); beacon upgrades are theirs. -- **Issuer ADMIN** — `createCapTable` (permissionless) on a factory; wallet manage UI. Using shared factory ≠ owning it. -- **Mongo `factories`** — local mirror only. - -**Failure matrix:** `@tap/units` missing on `:3000` → Docker app without `packages/` (fixed in `Dockerfile.app`) or stop Docker app and use `pnpm app:dev`. Empty connect modal → install a browser extension wallet (Rabby, MetaMask — EIP-6963; no cloud key required). `COPY chain/out` fail → run `pnpm setup`. Fresh Mongo has no historical issuers until mint/register/load-from-wallet. Mint OK but register **500** → Docker app `NEXT_PUBLIC_API_URL` must be `http://server:8293`. Poller `invalid BytesLike 0xUPDATE_ME` → placeholder `PRIVATE_KEY`; poller now falls back to read-only when key is missing. +`pnpm bootstrap` is idempotent. Use `SKIP_APP=1` for mongodb+server only, or `pnpm docker:mongo` for Mongo alone (host **27027**, not 27017). Factory model + failure matrix: [`AGENTS.md`](./AGENTS.md). Manual steps (if not using bootstrap): @@ -154,7 +146,7 @@ pnpm install pnpm setup cp .env.example .env # also create app/.env.local with the same NEXT_PUBLIC_* values -pnpm docker:up # or: docker compose up -d mongodb server +pnpm docker:mongo # host 27027; or SKIP_APP=1 pnpm bootstrap for API too pnpm app:dev ``` @@ -428,7 +420,8 @@ The system supports multiple environments via `.env` files: **Key Variables**: -- `DATABASE_URL`: MongoDB connection string +- `DATABASE_URL`: MongoDB connection string (host TAP Mongo is **27027**; compose-internal stays `mongodb:27017`) +- `MONGO_PORT`: optional host publish port (default 27027) - `DATABASE_REPLSET`: Set to "1" for replica set (enables transactions) - `RPC_URL`: Ethereum RPC endpoint - `CHAIN_ID`: Network chain ID (31337 for Anvil, 98866 for Plume Mainnet, 98867 for Plume Testnet) @@ -550,12 +543,13 @@ Libraries: 13. **Issuing a stakeholder's first stock**: the Issue Stock dropdown needs the issuer's stakeholders, so `GET /cap-table/holdings/stock` returns `stakeholders` (and `stockClasses`) — the manage UI can populate the dropdown before any issuance exists. Don't source the stakeholder list only from `holdings[]`; it's empty until stock is issued, which would make a fresh cap table unable to issue its first shares after a page reload. 14. **Nav issuer id**: company section links must use the real UUID from `router.query.issuerId` (or path), never a pattern string from `pathname` — otherwise users land on `/app/companies/%5BissuerId%5D`. 15. **Ghost stock classes**: registering metadata with `is_onchain_synced: false` after a failed wallet path, or jumping the poller past unprocessed events, leaves classes in Mongo that never landed onchain. Prefer receipt-gated `/register-onchain` (synced + tx_hash) and reconcile over head-jumps for routine refresh. -15. **Transfer already exists onchain/server**: UI transfer is a thin direct-wallet wrapper around `CapTable.transferStock` / TransferStock poller handling — do not invent a parallel transfer protocol or reimplement scaling outside `@tap/units`. +16. **Transfer already exists onchain/server**: UI transfer is a thin direct-wallet wrapper around `CapTable.transferStock` / TransferStock poller handling — do not invent a parallel transfer protocol or reimplement scaling outside `@tap/units`. +17. **TAP Mongo on 27017 / comes back after Docker Desktop restart**: compose used to publish 27017 with `restart: always`. Host port is **27027**, policy is `unless-stopped`. Update host `DATABASE_URL`. `pnpm docker:down` removes the container; `pnpm docker:mongo` starts only Mongo. ## Debugging - **Logs**: The server logs extensively. Look for emoji prefixes (✅, ❌, ⏳, 💾) -- **Database**: Connect to MongoDB on port 27017 (credentials in `.env`) +- **Database**: Connect to MongoDB on host port **27027** (credentials in `.env`) - **Blockchain**: Use RPC_URL to query contract state with ethers.js or cast - **Event poller**: Runs in-process by default; check console for event processing logs - **Poller block number stalled or far behind head**: fast-forward the per-issuer index with `pnpm poller:fast-forward` (`--issuer `, `--block `, `--dry-run`, `--help`). It sets `last_processed_block` to (near) chain head so the poller stops chasing a backlog and just tracks new blocks — handy on fast chains (Plume) or after the server was offline. Skips events between the old pointer and head, which is fine for a cap table with no real positions yet. diff --git a/app/WARP.md b/app/WARP.md index d2647a29..427421b2 100644 --- a/app/WARP.md +++ b/app/WARP.md @@ -189,7 +189,7 @@ Frontend config lives in `app/.env.local` (git-ignored). All are build-time publ See the root `.env.example` for the canonical list. Keep Mongo `factories` and this factory address aligned. -**Host vs Docker:** Prefer `pnpm app:dev` for product work. If `:3000` is Docker and you see `Can't resolve '@tap/units'`, either rebuild the app image (Dockerfile copies `packages/`) or `docker compose stop app` and use the host dev server. +**Host vs Docker:** Prefer `pnpm app:dev` for product work (`app/.env.local`). Docker app bind-mounts `app/` + `packages/` so source edits hot-reload; rebuild the image only after `package.json` / lockfile / Dockerfile changes. If `:3000` is Docker and you see `Can't resolve '@tap/units'`, `docker compose stop app` and use the host dev server. TAP Mongo is host **27027**. ## Git Workflow diff --git a/docker-compose.yml b/docker-compose.yml index 31e8ebd0..df1806f8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,15 @@ services: mongodb: - image: mongo:latest - restart: always + # Pin major.minor (volume is Mongo 8.2). Do not use mongo:latest. + # Host 27027 so TAP does not steal the default Mongo port other local apps use. + # Inside the compose network the process still listens on 27017. + image: mongo:8.2 + restart: unless-stopped environment: MONGO_INITDB_ROOT_USERNAME: tap MONGO_INITDB_ROOT_PASSWORD: tap ports: - - 27017:27017 + - "${MONGO_PORT:-27027}:27017" volumes: - offchain-db:/data/db healthcheck: @@ -52,6 +55,17 @@ services: NEXT_PUBLIC_FACTORY_ADDRESS: ${NEXT_PUBLIC_FACTORY_ADDRESS:-} NEXT_PUBLIC_CHAIN_ID: ${NEXT_PUBLIC_CHAIN_ID:-${CHAIN_ID:-98866}} NEXT_PUBLIC_OPERATOR_ADDRESS: ${NEXT_PUBLIC_OPERATOR_ADDRESS:-} + # Docker Desktop bind mounts often miss inotify; poll so Next/Turbopack picks up edits. + WATCHPACK_POLLING: "true" + CHOKIDAR_USEPOLLING: "true" + CHOKIDAR_INTERVAL: "1000" + command: ["pnpm", "dev", "--hostname", "0.0.0.0"] + volumes: + # Source mounts: edit app/ or packages/ on the host without rebuilding the image. + # Rebuild (`pnpm docker:build`) is still required after package.json / lockfile / Dockerfile changes. + - ./app:/app/app + - ./packages:/app/packages + - /app/app/node_modules depends_on: mongodb: condition: service_healthy diff --git a/docker/Dockerfile.app b/docker/Dockerfile.app index 2f65b038..1c7fb6dc 100644 --- a/docker/Dockerfile.app +++ b/docker/Dockerfile.app @@ -24,4 +24,6 @@ EXPOSE 3000 # NEXT_PUBLIC_* must be provided at runtime via docker-compose (or build args # for production images). Browser API rewrite should use a host-reachable URL # such as http://localhost:8293 — not the compose DNS name "server". -CMD ["pnpm", "dev"] +# Compose overrides this with --hostname 0.0.0.0 and bind-mounts app/ + packages/ +# so source edits hot-reload without an image rebuild. +CMD ["pnpm", "dev", "--hostname", "0.0.0.0"] diff --git a/docs/src/pages/development/factory-deploy.mdx b/docs/src/pages/development/factory-deploy.mdx index cc1e64a5..17ccf7a8 100644 --- a/docs/src/pages/development/factory-deploy.mdx +++ b/docs/src/pages/development/factory-deploy.mdx @@ -49,7 +49,7 @@ pnpm factory:register --factory 0xYourFactory # implementation is read onchain when omitted ``` -MongoDB Compass is optional for inspection (`mongodb://tap:tap@localhost:27017`, database `mongo`, collection `factories`). Prefer the CLI so the implementation stays live. +MongoDB Compass is optional for inspection (`mongodb://tap:tap@localhost:27027`, database `mongo`, collection `factories`). Prefer the CLI so the implementation stays live. ## Demo / issuer-dev: shared Plume factory diff --git a/docs/src/pages/development/run-server.mdx b/docs/src/pages/development/run-server.mdx index ff4892fd..f1db1bb6 100644 --- a/docs/src/pages/development/run-server.mdx +++ b/docs/src/pages/development/run-server.mdx @@ -23,7 +23,7 @@ pnpm bootstrap # or mongo+server only: SKIP_APP=1 pnpm bootstrap ``` -Rebuild after dependency, contract artifact, or Dockerfile changes: `pnpm docker:build`. +Rebuild after dependency, lockfile, contract artifact, or Dockerfile changes: `pnpm docker:build`. App **source** edits do not need a rebuild — compose bind-mounts `app/` and `packages/` and polls for changes. Wallet work still prefers host `pnpm app:dev` (`app/.env.local`). ### Check the API @@ -51,7 +51,7 @@ Wallet mint/manage needs `app/.env.local` (`NEXT_PUBLIC_*`). Docker app reads ro ```bash pnpm docker:down -docker compose up -d mongodb +pnpm docker:mongo pnpm dev ``` @@ -76,6 +76,7 @@ A fresh Mongo **does not** auto-import every historical issuer on Plume. Use min | `Can't resolve '@tap/units'` on `:3000` | Docker app image must `COPY packages/`; or stop Docker app and run `pnpm app:dev` | | Empty connect modal / no wallets | Install a browser extension wallet (Rabby, MetaMask, etc.) — EIP-6963, no cloud key needed | | `EADDRINUSE` | Port 8293 or 3000 already in use (`lsof -i :3000`) | +| Other app wants Mongo 27017 | TAP publishes **27027**. Host `DATABASE_URL` must use 27027. `pnpm docker:down` if an old container is still on 27017. | | History does not update | Poller running; issuer registered with `deployed_to` | | Frontend API fails | `NEXT_PUBLIC_API_URL=http://localhost:8293` (host-reachable) | | Factory misaligned | Mongo `factories` vs `NEXT_PUBLIC_FACTORY_ADDRESS` | diff --git a/docs/src/pages/development/setup.mdx b/docs/src/pages/development/setup.mdx index 3024923b..1a841133 100644 --- a/docs/src/pages/development/setup.mdx +++ b/docs/src/pages/development/setup.mdx @@ -69,7 +69,7 @@ Bootstrap is idempotent: deps, contract build (`chain/out`), Docker volume, comp | --- | --- | | API | http://localhost:8293 | | Product UI | `pnpm app:dev` → http://localhost:3000/app | -| MongoDB | localhost:27017 | +| MongoDB | localhost:27027 (TAP does not use 27017) | Prefer **host** `pnpm app:dev` for wallet work. Docker app is optional. diff --git a/package.json b/package.json index 69a2bb55..9a548f1a 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "app:test:e2e": "pnpm --filter tap-app test:e2e", "docker:up": "docker compose up -d", "docker:down": "docker compose down", + "docker:mongo": "docker compose up -d mongodb", "docker:logs": "docker compose logs -f", "docker:build": "docker compose up -d --build", "bootstrap": "./scripts/bootstrap-plume.sh", diff --git a/scripts/bootstrap-plume.sh b/scripts/bootstrap-plume.sh index e80390e1..b618c653 100755 --- a/scripts/bootstrap-plume.sh +++ b/scripts/bootstrap-plume.sh @@ -147,7 +147,8 @@ echo "" echo "========================" echo "🎉 Bootstrap complete." echo " Server API: $API_URL" -echo " App (Docker): http://localhost:3000 (optional; needs real NEXT_PUBLIC_* from root .env)" +echo " Mongo (host): localhost:${MONGO_PORT:-27027} (not 27017; Compass: mongodb://tap:tap@localhost:${MONGO_PORT:-27027})" +echo " App (Docker): http://localhost:3000 (optional; source bind-mounted — no rebuild for app/ edits)" echo " Product UI: pnpm app:dev → http://localhost:3000/app (reads app/.env.local)" echo "" diff --git a/scripts/dev.sh b/scripts/dev.sh index 745a2581..926117f3 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -70,11 +70,11 @@ if [ ! -f .env ]; then echo "" fi -# Handle --mongo-only (use existing docker-compose.yml) +# Handle --mongo-only if [ "$MONGO_ONLY" = true ]; then echo "🍃 Starting MongoDB only..." - docker compose up -d - echo "✅ MongoDB running on port 27017" + docker compose up -d mongodb + echo "✅ MongoDB on host port ${MONGO_PORT:-27027} (container 27017)" exit 0 fi @@ -96,7 +96,7 @@ fi # Handle --no-server (for local server development with hot-reload) if [ "$NO_SERVER" = true ]; then echo "🚀 Starting MongoDB and app (run server locally with 'pnpm dev')..." - echo " MongoDB: http://localhost:27017" + echo " MongoDB: localhost:${MONGO_PORT:-27027}" echo " App: http://localhost:3000" echo "" echo "💡 Run 'pnpm dev' in another terminal to start the server" @@ -107,7 +107,7 @@ fi # Start all services echo "🚀 Starting all services (MongoDB, server, app)..." -echo " MongoDB: http://localhost:27017" +echo " MongoDB: localhost:${MONGO_PORT:-27027}" echo " Server: http://localhost:8293" echo " App: http://localhost:3000" echo "" diff --git a/scripts/setup.sh b/scripts/setup.sh index 92a3067c..b88416d0 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -11,7 +11,7 @@ set -e # 4. Sets up Foundry and builds contracts # # After running this script: -# - Start MongoDB: docker compose up -d +# - Start MongoDB: pnpm docker:mongo (host port 27027) # - Start Anvil: anvil (in separate terminal) # - Copy a private key from anvil output to .env # - Run server: pnpm dev @@ -60,7 +60,7 @@ echo "====================================" echo "🎉 Setup complete!" echo "" echo "Next steps:" -echo " 1. Start MongoDB: docker compose up -d" +echo " 1. Start MongoDB: pnpm docker:mongo # host port 27027" echo " 2. Start Anvil: anvil (in new terminal)" echo " 3. Copy a private key from anvil to .env" echo " 4. Run server: pnpm dev" From d0cea2783c008b7704c4d247f814c0b40e3bd092 Mon Sep 17 00:00:00 2001 From: Alex Palmer <24211477+ThatAlexPalmer@users.noreply.github.com> Date: Wed, 19 Aug 2026 20:02:06 -0400 Subject: [PATCH 2/3] chore: drop CLAUDE.md and skip app previews for markdown-only app diffs --- CLAUDE.md | 5 ----- README.md | 2 +- app/vercel.json | 3 +++ 3 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 CLAUDE.md create mode 100644 app/vercel.json diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index e4bc5434..00000000 --- a/CLAUDE.md +++ /dev/null @@ -1,5 +0,0 @@ -# CLAUDE.md - -Same guidance as [`AGENTS.md`](./AGENTS.md). Read that file, then [`WARP.md`](./WARP.md) and [`app/WARP.md`](./app/WARP.md), before changing this repo. - -Do not duplicate setup, factory, or failure-matrix notes here — edit `AGENTS.md` instead. diff --git a/README.md b/README.md index bbf6c6c6..0423d542 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ For AI-assisted / agent development, see: - [`WARP.md`](./WARP.md) — monorepo architecture, commands, patterns, pitfalls - [`app/WARP.md`](./app/WARP.md) — frontend conventions (routes, write path, styled-components) -- [`AGENTS.md`](./AGENTS.md) / [`CLAUDE.md`](./CLAUDE.md) — short pointers to those files +- [`AGENTS.md`](./AGENTS.md) — short pointer to those files - [`CONTRIBUTING.md`](./CONTRIBUTING.md) — branch and PR conventions ## Contributing diff --git a/app/vercel.json b/app/vercel.json new file mode 100644 index 00000000..8535ff59 --- /dev/null +++ b/app/vercel.json @@ -0,0 +1,3 @@ +{ + "ignoreCommand": "git diff --quiet HEAD^ HEAD -- . \":!WARP.md\" \":!README.md\"" +} From 1531bc77ee249853f77548521b97191a92014e07 Mon Sep 17 00:00:00 2001 From: Alex Palmer <24211477+ThatAlexPalmer@users.noreply.github.com> Date: Wed, 19 Aug 2026 20:13:01 -0400 Subject: [PATCH 3/3] fix(docker): use mongo:latest instead of pinning 8.2 --- docker-compose.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index df1806f8..670856cb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,8 @@ services: mongodb: - # Pin major.minor (volume is Mongo 8.2). Do not use mongo:latest. # Host 27027 so TAP does not steal the default Mongo port other local apps use. # Inside the compose network the process still listens on 27017. - image: mongo:8.2 + image: mongo:latest restart: unless-stopped environment: MONGO_INITDB_ROOT_USERNAME: tap