diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index 66ee795f..508d642e 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -32,6 +32,9 @@ jobs: - name: Install dependencies run: npm ci + - name: Run lint check + run: npm run lint:check + - name: Build run: npm run build diff --git a/Backend/README.md b/Backend/README.md index a8d637bf..081b2ff3 100644 --- a/Backend/README.md +++ b/Backend/README.md @@ -18,7 +18,7 @@ The backend API and on-chain indexer for GistPin. This service is the bridge bet | Language | TypeScript | | Runtime | Node.js >= 20 | | Framework | NestJS | -| Database | PostgreSQL 15 + PostGIS extension | +| Database | PostgreSQL 16 + PostGIS extension | | ORM / Query | TypeORM (with PostGIS support) | | Blockchain | Stellar Horizon + Soroban RPC | | Storage bridge | IPFS via Pinata (or self-hosted node) | @@ -67,7 +67,7 @@ Backend/ ## Prerequisites - **Node.js** >= 20 — [nodejs.org](https://nodejs.org) -- **PostgreSQL 15** with the **PostGIS extension** +- **PostgreSQL 16** with the **PostGIS extension** - **npm** (comes with Node.js) > **Why PostGIS?** The core feature of GistPin is querying gists by distance — *"show me everything within 500m of these coordinates."* PostGIS adds a spatial index that makes this instant, even at scale. @@ -95,14 +95,14 @@ docker run -d \ -e POSTGRES_PASSWORD=gist \ -e POSTGRES_DB=gist \ -p 5432:5432 \ - postgis/postgis:15-3.3 + postgis/postgis:16-3.4 ``` **Option B — Homebrew (macOS)** ```bash -brew install postgresql@15 postgis -brew services start postgresql@15 +brew install postgresql@16 postgis +brew services start postgresql@16 psql -U postgres -c "CREATE USER gist WITH PASSWORD 'gist';" psql -U postgres -c "CREATE DATABASE gist OWNER gist;" psql -U gist -d gist -c "CREATE EXTENSION postgis;" diff --git a/README.md b/README.md index b08aadca..0b6f8696 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ GistPin is an early-stage, actively developed open-source project. Here's an hon | Layer | Status | Notes | |---|---|---| -| **Smart contract** (`contracts/`) | ✅ MVP implemented & tested | `GistRegistry` — post, get, and list gists by location cell. Anonymous posting supported. | -| **Backend API** (`Backend/`) | ✅ Largely implemented | NestJS + PostGIS geo queries, IPFS pinning, Soroban client (with dev mock mode), rate limiting, metrics, e2e tests. | +| **Smart contract** (`contracts/`) | ✅ MVP implemented, tested & deployed on testnet | `GistRegistry` — 13 functions including post, get, list, edit, delete, hide, unhide, remove, report, expiry, cooldown. [Testnet contract](https://stellar.expert/explorer/testnet/contract/CCOVX5S3SYHVKUKM3NUXLH6COIYLV5BL3XD6HPFLLR4VLQEQGINJMDRV). | +| **Backend API** (`Backend/`) | ✅ Largely implemented | NestJS + PostGIS geo queries, IPFS pinning, Soroban client (with dev mock mode), rate limiting, metrics, e2e tests, indexer, stats endpoints. | | **Frontend** (`Frontend/`) | 🚧 UI prototype | Map + posting UI built, but currently runs on **mock data** — not yet wired to the backend, no wallet integration yet. | | **End-to-end flow** | ❌ Not yet connected | Frontend ↔ Backend ↔ Contract are each functional in isolation; connecting them is the current priority. | diff --git a/ROADMAP.md b/ROADMAP.md index a123bc62..dd87dd01 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -13,11 +13,11 @@ Wave 1: Contract ──► Wave 2: Backend ──► Wave 3: Frontend --- -## 🌊 Wave 1 — Contract ✅ **COMPLETE** (except live deploy) +## 🌊 Wave 1 — Contract ✅ **COMPLETE** **Goal:** A production-ready, fully tested `GistRegistry` exposing a documented interface + event schema for the backend (Wave 2) to integrate against. -**Status:** All feature code written and **unit-tested (26 tests passing)**, merged to `main`. The one remaining item — the actual **testnet deploy** — is tracked in Wave 2 as [#1022](https://github.com/PinSpace-Org/GistPin/issues/1022) (it needs a funded keypair) and also gates the WASM release-build verification. +**Status:** All feature code written and **unit-tested (26 tests passing)**, merged to `main`, and deployed on testnet. See the [Deployments table](contracts/README.md) for the testnet contract ID. - [x] Cleanup — removed stray `vault.rs`/`multi.rs`/`ops.rs`/`rollback.rs` ([#864](https://github.com/PinSpace-Org/GistPin/issues/864)) - [x] Canonical `gist_posted` event ([#873](https://github.com/PinSpace-Org/GistPin/issues/873)) + 6 more (edited/deleted/hidden/unhidden/removed/reported) @@ -29,7 +29,7 @@ Wave 1: Contract ──► Wave 2: Backend ──► Wave 3: Frontend - [x] Author `edit_gist`/`delete_gist`; anonymous gists immutable ([#879](https://github.com/PinSpace-Org/GistPin/issues/879)) - [x] 26 tests covering every rule + rejection path ([#880](https://github.com/PinSpace-Org/GistPin/issues/880)) - [x] Deploy script + full ABI/event/error spec in `contracts/README.md` ([#881](https://github.com/PinSpace-Org/GistPin/issues/881)) -- [ ] **Live testnet deploy + WASM build verified** → moved to Wave 2 [#1022](https://github.com/PinSpace-Org/GistPin/issues/1022) +- [x] **Live testnet deploy + WASM build verified** — deployed to testnet (contract ID: CCOVX5S3SYHVKUKM3NUXLH6COIYLV5BL3XD6HPFLLR4VLQEQGINJMDRV) Tipping / staking (incentives) are intentionally deferred to a later wave. @@ -43,18 +43,21 @@ Tipping / staking (incentives) are intentionally deferred to a later wave. **Key decision — signed posts (option A / wallet-direct):** the backend only ever submits **anonymous** posts and **reports**; all `require_auth` writes (signed posts, edit/delete, moderation) are signed and submitted by the user's/moderator's **wallet** (Wave 3) and reach the backend via the **indexer**. -Tracked issues (build order): - -- [ ] [#1022](https://github.com/PinSpace-Org/GistPin/issues/1022) — **Deploy to testnet + verify WASM build** *(gate; needs a funded keypair)* -- [ ] [#1023](https://github.com/PinSpace-Org/GistPin/issues/1023) — Update `soroban.service.ts` to the new ABI -- [ ] [#1024](https://github.com/PinSpace-Org/GistPin/issues/1024) — Exit mock mode; connect to the deployed contract -- [ ] [#1025](https://github.com/PinSpace-Org/GistPin/issues/1025) — Wire the indexer → Postgres (all 7 events) -- [ ] [#1026](https://github.com/PinSpace-Org/GistPin/issues/1026) — Reflect `hidden`/expiry in the DB + query filtering -- [ ] [#1027](https://github.com/PinSpace-Org/GistPin/issues/1027) — Read + report endpoints; surface moderation/expiry state -- [ ] [#1028](https://github.com/PinSpace-Org/GistPin/issues/1028) — Write path anonymous-only (no unverified authorship) -- [ ] [#1029](https://github.com/PinSpace-Org/GistPin/issues/1029) — API auth model *(default: open for MVP)* -- [ ] [#1030](https://github.com/PinSpace-Org/GistPin/issues/1030) — Integration tests against the real contract path -- [ ] [#1031](https://github.com/PinSpace-Org/GistPin/issues/1031) — Contracts CI + frontend build check *(do early)* +Completed items (closed by #1032–#1043): +- [x] [#1032](https://github.com/PinSpace-Org/GistPin/issues/1032) — Deploy to testnet + verify WASM build +- [x] [#1033](https://github.com/PinSpace-Org/GistPin/issues/1033) — Update `soroban.service.ts` to the new ABI +- [x] [#1034](https://github.com/PinSpace-Org/GistPin/issues/1034) — Exit mock mode; connect to the deployed contract +- [x] [#1035](https://github.com/PinSpace-Org/GistPin/issues/1035) — Wire the indexer → Postgres (all 7 events) +- [x] [#1036](https://github.com/PinSpace-Org/GistPin/issues/1036) — Reflect `hidden`/expiry in the DB + query filtering +- [x] [#1037](https://github.com/PinSpace-Org/GistPin/issues/1037) — Read + report endpoints; surface moderation/expiry state + +Remaining items: +- [ ] [#1038](https://github.com/PinSpace-Org/GistPin/issues/1038) — Write path anonymous-only (no unverified authorship) +- [ ] [#1039](https://github.com/PinSpace-Org/GistPin/issues/1039) — API auth model *(default: open for MVP)* +- [ ] [#1040](https://github.com/PinSpace-Org/GistPin/issues/1040) — Integration tests against the real contract path +- [ ] [#1041](https://github.com/PinSpace-Org/GistPin/issues/1041) — Backend stats endpoints (overview, timeseries, moderation, events) +- [ ] [#1042](https://github.com/PinSpace-Org/GistPin/issues/1042) — Analytics dashboard app +- [ ] [#1043](https://github.com/PinSpace-Org/GistPin/issues/1043) — Contracts CI + frontend build check *(do early)* --- @@ -88,5 +91,5 @@ Tracked issues (build order): --- -*This roadmap tracks direction, not commitments. Concrete work lives in [GitHub issues](https://github.com/PinSpace-Org/GistPin/issues). Done so far: fixes #860–#873 and Wave 1 contract #874–#881 (all merged). In progress: Wave 2 #1022–#1031.* +*This roadmap tracks direction, not commitments. Concrete work lives in [GitHub issues](https://github.com/PinSpace-Org/GistPin/issues). Done so far: fixes #860–#873 and Wave 1 contract #874–#881 (all merged, deployed to testnet). In progress: Wave 2 #1032–#1043.*