The first reorder implementation encoded list position directly in the moderation label's `created_at` and republished the same axis label with a chosen timestamp. That fights the fold's newest-event-per-(coord,axis) rule the moment a moderator tries to lower a campaign's position: the new label has an older `created_at` than the existing one and the fold rejects it. The relay accepts the publish, but every subsequent read folds back to the higher-`created_at` predecessor and the move appears to revert. Move-up worked (its new `created_at` was strictly newer); move-down, drag-down, and any drag-to-midpoint that landed below an existing neighbor silently no-op'd. Anything dragged into the middle of an already-old list also picked a past timestamp that some relays reject for being too far behind "now". The fix decouples sort key from event recency: - Reorder publishes always use `created_at = now`, so the fold's newest-wins rule always picks them up. - The chosen position is encoded as a `["rank", "<integer>"]` tag on the label. - `foldModerationLabels` extracts the rank with a `created_at` fallback, so labels published before this change (and any normal approve / hide / feature actions that don't carry a rank) still sort by `created_at` exactly as they used to. Ranks are sourced from `Date.now() * 1000` (microseconds since epoch), so: - Fresh "feature" / "approve" publishes always sit above legacy labels whose effective rank is a seconds-since-epoch value. - Midpoint inserts have ~1000x headroom per second of inter-rank gap, comfortably enough for thousands of reorders before any renumbering would matter. - Headroom against `Number.MAX_SAFE_INTEGER` is ~150 years. Callers downstream (CampaignsPage, CampaignsDiscoverySection, PledgesDiscoverySection, useFeaturedOrganizations) still consume `featuredOrder` / `approvedOrder` as `Map<coord, number>` sorted descending — the map names and shapes are unchanged, only the value computation is now "rank ?? created_at" instead of "created_at". NIP.md updated to document the rank tag, the fallback semantics, and the reorder operations in terms of ranks.
Agora
Power to the people.
Agora is a Nostr client focused on community ownership, expressive identity, and censorship resistance. This repository (agora-3) is the Agora-branded app built from the Ditto codebase.
What This Repo Is
- Agora product identity (name, theme, assets, native IDs)
- Ditto-derived implementation with broad Nostr feature coverage
- Configurable deployment defaults via
agora.json
Features
- Community-first social client: notes, articles, comments, reposts, reactions, and rich event rendering
- Theming system: built-in presets + custom color/font/background themes that can be shared as events
- Lightning support: zaps with Nostr Wallet Connect and WebLN
- Private messaging: NIP-04 and NIP-17 direct messages
- Mobile app shell: Capacitor-powered Android/iOS wrappers
- Self-hostable: static web build + configurable relay and upload infrastructure
Getting Started
Prerequisites
- Node.js 22+
- npm 10.9.4+
Development
git clone https://gitlab.com/soapbox-pub/agora-3.git
cd agora-3
npm install
npm run dev
Development server: http://localhost:8080
Docker Getting Started
Use Docker Compose when you want the nginx reverse-proxy stack (necessary if you want decryptable media in messages - kind 15s of NIP 17):
git clone https://gitlab.com/soapbox-pub/agora-3.git
cd agora-3
cp .env.example .env
docker compose up --build
Proxy URL: http://localhost:8083
This starts:
viteservice on the internal Docker network (vite:8080)webservice (nginx) on host port8082, proxying to Vite with websocket support
Stop stack:
docker compose down
Production-style container build:
docker compose -f docker-compose.prod.yml up --build
Build
npm run build
Build output: dist/
Validate
npm test
This runs type-checking, linting, unit tests, and production build checks.
Configuration
Build-time config is read from agora.json (gitignored by default so each deployment can provide its own values).
{
"theme": "dark",
"relayMetadata": {
"relays": [
{ "url": "wss://relay.ditto.pub", "read": true, "write": true },
{ "url": "wss://relay.primal.net", "read": true, "write": true },
{ "url": "wss://relay.damus.io", "read": true, "write": true }
]
},
"blossomServers": [
"https://blossom.ditto.pub",
"https://blossom.primal.net/"
]
}
Configuration priority (highest first):
- User settings (local storage)
- Build config (
agora.json) - Hardcoded app defaults
Use a custom config path:
CONFIG_FILE=./my-config.json npm run build
Deployment
Agora builds to static files and can be deployed to any static host.
- GitLab/GitHub Pages
- Netlify/Vercel
- VPS or any web server with SPA routing fallback
For Android:
npm run build
npx cap sync
npx cap open android
Tech Stack
| Layer | Technology |
|---|---|
| Framework | React 18 |
| Build | Vite |
| Language | TypeScript |
| Styling | TailwindCSS 3 + shadcn/ui |
| Routing | React Router |
| Data | TanStack Query |
| Nostr | Nostrify + nostr-tools |
| Mobile | Capacitor |
| Testing | Vitest + React Testing Library |
Contributing
Read CONTRIBUTING.md before opening a merge request.