Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
f4bbc2b
test(e2e): give the two axe-heavy admin tests a 90s timeout
Satelink-Protocol Oct 29, 2026
ac28795
feat(checkout): SuperProfile hosted checkout for tickets
Satelink-Protocol Oct 29, 2026
870e337
chore(payments): delete retired gateway adapters; scrub env example a…
Satelink-Protocol Oct 29, 2026
801b92d
feat(checkout): CI, reconciliation endpoint, e2e, ops doc, review fixes
Satelink-Protocol Oct 29, 2026
64cfe6f
test(e2e): wait for wizard controls to be visible before measuring (C…
Satelink-Protocol Oct 29, 2026
f5e7223
Merge pull request #7 from Jakuraa/feature/superprofile-checkout
Satelink-Protocol Oct 29, 2026
d4a9c73
fix: pin feed DNS at connect time, fail-closed session/checkout edges…
Satelink-Protocol Oct 29, 2026
a596c5c
test(feeds): TLS hostname + redirect regression tests; no auto-deploy…
Satelink-Protocol Oct 29, 2026
02d2e8d
docs(audit): record PR #8 and CI run 40949643679 results
Satelink-Protocol Oct 29, 2026
d238792
feat(safety): fail-closed preview DB write protection, hardened migra…
Satelink-Protocol Oct 29, 2026
4ad1705
docs(audit): record commit d238792 CI run 40958014582 results
Satelink-Protocol Oct 29, 2026
740e0a5
feat: prepare latest website UX and launch improvements
Satelink-Protocol Oct 30, 2026
4e7fd12
feat: add secure cloud-ready StrangersMeetup MCP service
Satelink-Protocol Oct 30, 2026
d74d199
chore: add Render deployment configuration
Satelink-Protocol Oct 30, 2026
4ed00db
fix(mcp): resolve PR #9 CI detached HEAD, Playwright runtime, secret …
Satelink-Protocol Oct 30, 2026
fb28579
fix(a11y): resolve .linkish contrast ratio on dark surfaces for WCAG AA
Satelink-Protocol Oct 30, 2026
607d708
Merge pull request #10 from Jakuraa/fix/cloud-deployment-pr9-blockers
Satelink-Protocol Oct 30, 2026
e6e427d
Merge pull request #9 from Jakuraa/feature/cloud-deployment-prep
Satelink-Protocol Oct 30, 2026
a6d6159
fix(deploy): align Render Docker runtime, Playwright base image, and …
Satelink-Protocol Oct 30, 2026
1777eef
Merge pull request #11 from Jakuraa/fix/render-docker-alignment
Satelink-Protocol Oct 30, 2026
b972f96
feat(ux): enhance event discovery search, card ergonomics, mobile nav…
Satelink-Protocol Oct 31, 2026
27597aa
fix(e2e): make screenshot directory portable for CI runner
Satelink-Protocol Oct 31, 2026
9ab424c
Merge pull request #12 from Jakuraa/feature/website-ux-enhancements
Satelink-Protocol Oct 31, 2026
f9a51fc
feat(attendee): synthetic preview seeding, free booking flow, mystery…
Satelink-Protocol Oct 31, 2026
14ebace
fix(ci): make E2E screenshot directory portable and add preview revie…
Satelink-Protocol Oct 31, 2026
4e6155a
Merge pull request #13 from Jakuraa/feature/attendee-discovery-booking
Satelink-Protocol Oct 31, 2026
9cbd15b
feat(organiser): polish host onboarding, event wizard and dashboard
Satelink-Protocol Oct 31, 2026
3b21b61
test(e2e): adjust assertion timeouts for mobile wizard publish in CI
Satelink-Protocol Oct 31, 2026
f77e437
fix(organiser): scope rate-limit keys for publish and image upload
Satelink-Protocol Oct 31, 2026
09e48de
Merge pull request #14 from Jakuraa/feature/organiser-onboarding-wizard
Satelink-Protocol Oct 31, 2026
1613b54
feat(marketplace): complete attendee booking pass, re-booking clarity…
Satelink-Protocol Oct 31, 2026
6ad0da0
test(e2e): allow optional query params when awaiting booking redirect
Satelink-Protocol Oct 31, 2026
8c40410
Merge pull request #15 from Jakuraa/feature/complete-marketplace-journey
Satelink-Protocol Oct 31, 2026
b4f7f73
feat(safety): website safety reporting, attendee blocking and moderat…
Satelink-Protocol Oct 31, 2026
bc074fb
Merge PR #16: Phase 3O Trust & Safety Remediation
Satelink-Protocol Nov 1, 2026
24798c3
docs(launch): Phase 4A production readiness and pre-flight audit report
Satelink-Protocol Nov 1, 2026
9294fcc
docs(launch): Phase 4B production provisioning and release dry-run re…
Satelink-Protocol Nov 1, 2026
619bc5f
docs(launch): Phase 4C production launch decisions and readiness vali…
Satelink-Protocol Nov 1, 2026
67371cb
docs(launch): Phase 4D independent production release review and Phas…
Satelink-Protocol Nov 1, 2026
8eafc30
Merge pull request #8 from Jakuraa/fix/preview-recovery-audit
Satelink-Protocol Nov 1, 2026
4e81eb8
docs: add first revenue event runbook for SuperProfile link-out
Satelink-Protocol Nov 1, 2026
4e9ff1e
fix(payments): gate paid checkout redirects on ENABLE_LIVE_PAYMENTS
Satelink-Protocol Nov 1, 2026
0a4340d
docs(launch): Phase 5.1 final production gate verification review
Satelink-Protocol Nov 1, 2026
2ac4a2e
docs(launch): Phase 5.2 PR #18 independent review and release alignme…
Satelink-Protocol Nov 1, 2026
db1f25c
test(e2e): set ENABLE_LIVE_PAYMENTS to true in serverEnv for browser …
Satelink-Protocol Nov 1, 2026
5507b2f
docs(launch): Phase 5.3 PR #18 E2E test environment remediation report
Satelink-Protocol Nov 1, 2026
f6f85c4
Merge PR #18: fix(payments): strictly gate SuperProfile checkout redi…
Satelink-Protocol Nov 1, 2026
2dd5eaa
Merge branch 'fix/preview-recovery-audit' into launch-mvp (include pa…
Satelink-Protocol Nov 1, 2026
75b3e82
feat(brand): customer-facing rebrand from StrangersMeetup to NIGHTLIFEZ
Satelink-Protocol Nov 2, 2026
c8d4d85
fix(brand): remediate residual customer-facing references and dynamic…
Satelink-Protocol Nov 2, 2026
070a7a8
docs(launch): P0 ground truth — refs, PRs, CI, branch table, env gate
Satelink-Protocol Nov 2, 2026
40a6f1e
Merge pull request #20 from Jakuraa/feature/p0-ground-truth
Satelink-Protocol Nov 2, 2026
8a91787
Merge pull request #19 from Jakuraa/feature/nightlifez-rebrand
Satelink-Protocol Nov 2, 2026
7198f53
feat(orgs): identities, organisations, scoped memberships and can() p…
Satelink-Protocol Nov 2, 2026
21f5a5d
Merge pull request #21 from Jakuraa/feature/p2-identity-orgs
Satelink-Protocol Nov 2, 2026
2a0e9ce
test(e2e): poll every wizard tap-target measurement
Satelink-Protocol Nov 2, 2026
9d48147
Merge pull request #22 from Jakuraa/fix/p2-wizard-e2e-flake
Satelink-Protocol Nov 2, 2026
15b923d
feat(location): P3 Location Intelligence V1, official LGD data, geosp…
Satelink-Protocol Nov 2, 2026
e9af6b4
docs(state): M1 repository truth — PROJECT_STATE.md and docs/history …
Satelink-Protocol Nov 2, 2026
cd40fcf
Merge pull request #24 from Jakuraa/feature/m1-project-state
Satelink-Protocol Nov 2, 2026
65705b0
chore(sync): merge origin/launch-mvp (PR #24) into feature/p3-locatio…
Satelink-Protocol Nov 3, 2026
d7836ff
feat(location): M2 location remediation — auto city resolution, rate …
Satelink-Protocol Nov 3, 2026
7c5079e
Merge pull request #23 from Jakuraa/feature/p3-location-intelligence
Satelink-Protocol Nov 3, 2026
7fc3726
feat(ops): implement owner addendum — dynamic prod DB block list, bra…
Satelink-Protocol Nov 3, 2026
83a30a7
Merge pull request #25 from Jakuraa/feature/m2-addendum-ops
Satelink-Protocol Nov 3, 2026
0fafdf8
feat(deploy): M3 Deployment & Database Migration Architecture
Satelink-Protocol Nov 3, 2026
f8398b3
docs(launch): remove prohibited legacy provider names from readiness doc
Satelink-Protocol Nov 3, 2026
46b85c1
Merge pull request #26 from Jakuraa/feature/m3-deployment-migration
Satelink-Protocol Nov 3, 2026
8282dab
feat(payments): M4 payment, booking and revenue readiness audit
Satelink-Protocol Nov 3, 2026
69cafae
Merge pull request #27 from Jakuraa/feature/m4-payment-booking-audit
Satelink-Protocol Nov 3, 2026
d354038
feat(payments): implement M4.1 UPI-first checkout, dynamic QR, and ve…
Satelink-Protocol Nov 3, 2026
133ffa2
fix(docs): replace legacy provider names with allowed aliases in UPI …
Satelink-Protocol Nov 3, 2026
c3b4e83
Merge pull request #28 from Jakuraa/feature/m4-1-upi-checkout
Satelink-Protocol Nov 3, 2026
c0ad01d
docs(project-state): record M4.1 PR #28 merge at c3b4e83 in milestone…
Satelink-Protocol Nov 3, 2026
b9b8199
docs(audit): independent security review and provider readiness asses…
Satelink-Protocol Nov 3, 2026
c71ec8d
Merge pull request #29 from Jakuraa/feature/m4-2-upi-security-audit
Satelink-Protocol Nov 3, 2026
e4babe6
feat(upi): remediate M4.2 security and financial integrity audit find…
Satelink-Protocol Nov 3, 2026
03bf518
fix(upi): remediate independent review findings REV-01 through REV-07…
Satelink-Protocol Nov 3, 2026
62cb0a3
fix(upi): M4.3.2 financial integrity remediation — fail-closed mercha…
Satelink-Protocol Nov 4, 2026
4c54711
fix(upi): M4.3.3 provider verification integrity review — remove curr…
Satelink-Protocol Nov 4, 2026
1e5bd19
fix(upi): M4.3.4 payment provider contract determination (Outcome B) …
Satelink-Protocol Nov 5, 2026
d916349
docs(state): record PR #34 in project state table
Satelink-Protocol Nov 5, 2026
2c930dd
docs: use generalized provider terminology to satisfy repo keyword co…
Satelink-Protocol Nov 5, 2026
262f4f0
feat(telegram): M5 Telegram identity, event community isolation & ope…
Satelink-Protocol Nov 5, 2026
43cf05a
docs(state): record M5 commit SHA in project state table
Satelink-Protocol Nov 5, 2026
82ebc17
feat(m6): Organiser workspace, event-scoped staff roles & secure QR c…
Satelink-Protocol Nov 6, 2026
2cea190
fix(m6): clean up M6 foreign keys in seed-local teardown and preserve…
Satelink-Protocol Nov 6, 2026
66ad026
docs(m6): reference PR #36 in milestone tracker
Satelink-Protocol Nov 6, 2026
ad6e222
feat(m7): attendee discovery feed, recommendations, saved events & ex…
Satelink-Protocol Nov 6, 2026
b8e9dd3
test(m7): automated test suite for discovery feed, recommendations, s…
Satelink-Protocol Nov 6, 2026
5453ab1
docs(m7): attendee discovery and experience hub architecture & roadma…
Satelink-Protocol Nov 6, 2026
9bf1e25
feat(m8): real-time notifications, attendee self-cancellation, quiet …
Satelink-Protocol Nov 9, 2026
fc095d1
test(m8): automated test suite for real-time notifications & operatio…
Satelink-Protocol Nov 9, 2026
0b30221
docs(m8): real-time comms architecture, DNS & email routing runbook a…
Satelink-Protocol Nov 9, 2026
3cc7729
feat(m9): multi-role e2e browser harness, security & authorization au…
Satelink-Protocol Nov 9, 2026
b8c82c5
docs(m9): record exact PR #39 head SHA in docs/PROJECT_STATE.md
Satelink-Protocol Nov 9, 2026
b85a328
feat(m10): beta readiness, operational hardening runbook, and owner a…
Satelink-Protocol Nov 9, 2026
598f2c3
docs(m10): record exact M10 head commit in docs/PROJECT_STATE.md
Satelink-Protocol Nov 10, 2026
bb01c7d
docs(m10): update PR #40 head SHA in docs/PROJECT_STATE.md
Satelink-Protocol Nov 10, 2026
89741fe
docs(launch): add owner acceptance session guide and update checklist
Satelink-Protocol Nov 10, 2026
142cc62
docs(audit): record pre-acceptance authentication and preview databas…
Satelink-Protocol Nov 10, 2026
ea0f5e5
fix(auth): remediate preview reviewer environment detection and docum…
Satelink-Protocol Nov 10, 2026
02bfdba
test(e2e): scope admin moderation lead locator to the seeded lead
Satelink-Protocol Nov 10, 2026
771f6e1
Consolidate M4–M10 (supersedes #30–#40) (#41)
Satelink-Protocol Nov 10, 2026
c9ae631
fix(payments): separate UPI_CHECKOUT_ENABLED from ENABLE_LIVE_PAYMENTS
Satelink-Protocol Nov 10, 2026
f536631
docs(launch): correct DNS/email runbook, document Preview login, Phon…
Satelink-Protocol Nov 10, 2026
dc671d3
Merge pull request #42 from Jakuraa/fix/s3a-upi-checkout-flag
Satelink-Protocol Nov 10, 2026
8edb778
Merge pull request #43 from Jakuraa/docs/s3-launch-runbooks
Satelink-Protocol Nov 10, 2026
7d670d8
docs(project-state): record PR #42 and #43 merges on launch-mvp
Satelink-Protocol Nov 10, 2026
c6c8d72
Merge pull request #44 from Jakuraa/docs/project-state-s3-merged
Satelink-Protocol Nov 10, 2026
6bad37c
fix(security): eliminate ticket signing dev fallback in production an…
Satelink-Protocol Nov 11, 2026
4f0f802
docs(launch): add Cloudflare DNS audit, Preview readiness, DB migrati…
Satelink-Protocol Nov 13, 2026
3edd7cf
docs(launch): record Cloudflare DNS and Vercel verification audit evi…
Satelink-Protocol Nov 13, 2026
6a7faf0
docs(launch): record DNS propagation, SSL issuance, and email destina…
Satelink-Protocol Nov 13, 2026
31d26e9
docs(launch): record detailed email routing audit and forensic invest…
Satelink-Protocol Nov 13, 2026
8a31fab
docs(launch): classify tasks and document owner intervention runbook
Satelink-Protocol Nov 13, 2026
5197a9d
docs(launch): record authoritative DMARC probe and destination blocke…
Satelink-Protocol Nov 13, 2026
7a34d54
docs(launch): record destination verification confirmation and machin…
Satelink-Protocol Nov 13, 2026
5bc32b4
docs(launch): record machine access audit, API permissions and zero-e…
Satelink-Protocol Nov 13, 2026
eec9f8e
docs(launch): record direct SMTP probe verification and owner token c…
Satelink-Protocol Nov 13, 2026
cbf801c
docs(cleanup): consolidate repository documentation into canonical do…
Satelink-Protocol Nov 13, 2026
a2315ee
Merge pull request #45 from Jakuraa/candidate/production-readiness
Satelink-Protocol Nov 13, 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
38 changes: 38 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Dependencies
node_modules/

# Version control and agent configuration
.git/
.github/
.claude/
.agents/
.remember/
.playwright-mcp/
skills-lock.json

# Environment and secrets
.env
.env*
.env.local

# Vercel deployment cache
.vercel/

# Local MCP runtime state, screenshots and audit logs
.mcp/

# Test output and reports
test-results/
playwright-report/
coverage/
*.log

# Operating system and temporary artifacts
.DS_Store
Thumbs.db
*.db
*.sqlite
data/
public/img/review/
research_notes/
reports/
29 changes: 18 additions & 11 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,16 @@ TG_CHAT_ID_TIER_2=
TG_CHAT_ID_TIER_3=
TG_CHAT_ID_EVENTS=

# Payments (tickets)
PAYMENT_PROVIDER=razorpay
RAZORPAY_KEY_ID=
RAZORPAY_KEY_SECRET=
RAZORPAY_WEBHOOK_SECRET=
CASHFREE_APP_ID=
CASHFREE_SECRET_KEY=
# Payments
# ENABLE_LIVE_PAYMENTS gates only the SuperProfile hosted link-out for paid tickets (and labels
# Telegram Stars membership payments as test/live).
ENABLE_LIVE_PAYMENTS=false
# Organiser ticket tiers: paid checkout stays OFF unless explicitly set to true (and provider keys exist).
# Free tiers work without it. Leave unset until an approved payment provider is configured.
TICKET_CHECKOUT_ENABLED=
# UPI_CHECKOUT_ENABLED gates every UPI/PhonePe route, page, intent, claim and webhook. Keep false:
# PhonePe v1 cannot meet the payment verification contract (docs/UPI_PROVIDER_READINESS.md).
UPI_CHECKOUT_ENABLED=false

# Membership via SuperProfile (Zapier/Pabbly webhook shared secret, 24+ chars)
# SuperProfile notifications (tickets + memberships) via Zapier/Pabbly: shared secret sent as X-Webhook-Secret, 24+ chars
# Endpoint: POST /api/webhooks/superprofile
SUPERPROFILE_WEBHOOK_SECRET=

# Site
Expand All @@ -49,10 +46,20 @@ GRIEVANCE_EMAIL=
# Database operations
# Vercel builds migrate only in Production. Set true on Preview ONLY if Preview has its own database.
MIGRATE_ON_PREVIEW=
# Explicitly proves database isolation in Preview deployments. Required for preview migrations & writes.
ISOLATED_PREVIEW_DB=
# Dedicated Preview database connection URL (Preview scope only; never in Production).
PREVIEW_DATABASE_URL=
# Allow `npm run seed:demo` against a non-local database (a dedicated preview DB only; never production).
SEED_ALLOW_REMOTE=
PG_POOL_MAX=

# Preview isolation and test safeguards (Preview scope only; never in Production)
PREVIEW_TELEGRAM_BOT_TOKEN=
ALLOW_PREVIEW_TELEGRAM=
ALLOW_PREVIEW_PAID_CHECKOUT=
PREVIEW_PUBLIC_SITE_URL=

# Optional
DISABLE_WEB_ANALYTICS=

Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI

# Runs on every PR and on pushes to the long-lived branches. Needs no secrets: tests use a throwaway
# Postgres service container and stubbed external APIs (no Telegram, SuperProfile or Vercel calls).
on:
pull_request:
push:
branches: [main, launch-mvp]

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: lint, unit, e2e
runs-on: ubuntu-latest
timeout-minutes: 25
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: sm_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 5s
--health-timeout 5s
--health-retries 10
env:
CI: 'true'
PGPASSWORD: postgres
TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/sm_test
E2E_DATABASE_URL: postgres://postgres:postgres@localhost:5432/sm_e2e
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- name: Lint
run: npm run lint
- name: Unit and integration tests (real Postgres)
run: npm test
- name: Create the e2e database
run: psql -h localhost -U postgres -c 'CREATE DATABASE sm_e2e'
- name: Install Chromium
run: npx playwright install --with-deps chromium
- name: Browser tests (Playwright + axe)
run: npm run test:e2e
- name: Upload Playwright report and screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-failure
path: |
playwright-report/
test-results/
retention-days: 7
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ research_notes/
reports/
test-results/
playwright-report/
.mcp/
public/img/review/
.agents/
.claude/
skills-lock.json
*.code-workspace

26 changes: 26 additions & 0 deletions Dockerfile.mcp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Dockerfile.mcp - Container runtime for StrangersMeetup Control MCP with Playwright Chromium support
# Base image includes all Linux dependencies for headless Chromium, Firefox and WebKit
FROM mcr.microsoft.com/playwright:v1.64.1-noble

WORKDIR /app

ENV NODE_ENV=production \
PORT=3333 \
MCP_PORT=3333 \
MCP_HOST=0.0.0.0 \
MCP_LOG_STDOUT=true

# Copy package manifests first for efficient layer caching
COPY package*.json ./

# Install production dependencies
RUN npm ci

# Copy project source files
COPY . .

# Expose MCP HTTP port
EXPOSE 3333

# Start the MCP server
CMD ["node", "mcp/server.js"]
138 changes: 96 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,117 @@
# StrangersMeetup
# NIGHTLIFEZ

Small hosted meetups, dinners, dating mixers and weekend trips for adults 21+ across Tamil Nadu, Puducherry, Karnataka and Kerala.
Vibrant social discovery, curated nightlife, supper clubs, weekend trips, and hosted experiences across South India (Chennai, Bangalore, Puducherry, Kochi, Goa, Hyderabad) for adults 21+.

**The money loop:** real event → visitor books → verified payment (webhook) → booking confirmed → Telegram bot DM → single-use private-group invite → visible in `/admin`.
**The core money & fulfillment loop:**
Real event $\to$ Visitor books ticket $\to$ Verified payment webhook $\to$ Booking `confirmed` $\to$ Telegram bot DM $\to$ Single-use private group invite $\to$ QR check-in pass $\to$ Event check-in.

## Stack
- Zero-build Node 24. One Vercel function (`api/index.js` → `lib/router.js`) renders pages and serves the API; `public/` holds static CSS/JS/images.
- Postgres (`pg`), migrations in `migrations/NNN_*.sql`, tracked in `schema_migrations`.
- Telegram Bot API (webhook), Telegram Login (OIDC) + Mini App `initData`.
- Payments: Razorpay Payment Links for tickets; Telegram Stars subscriptions for membership. See `docs/PAYMENTS_DECISION.md`.
---

## Technical Stack

- **Runtime & Compute:** Zero-build Node 24. A single Vercel serverless function (`api/index.js` $\to$ `lib/router.js`) renders all SSR pages and dispatches API endpoints. Static CSS, JS, and brand assets are served from `public/`.
- **Database:** Serverless Postgres via pooled `pg` (`DATABASE_URL`). Migrations in `migrations/NNN_*.sql` tracked idempotently in `schema_migrations`.
- **Authentication:** Telegram Login Widget (OIDC SHA-256) and Telegram Mini App (`initData` HMAC-SHA-256). HTTP-only, Secure, SameSite=Lax signed session cookies (`sm_session`) backed by Postgres `user_sessions`.
- **Bot & Comms:** Telegram Bot API (`@Nightlifez_bot`), webhook-driven notifications, HMAC ticket verification, and single-use chat invite links.
- **Payments:** External hosted checkout (SuperProfile link-out) and native UPI/PhonePe integrations. Controlled by strict independent feature flags: `ENABLE_LIVE_PAYMENTS=false` and `UPI_CHECKOUT_ENABLED=false` until explicitly approved.

---

## Repository Layout

## Layout
```
api/index.js single serverless entry
lib/router.js route table (pages + API)
lib/handlers/* HTTP handlers (pages, auth, bookings, payments, telegram, cron, admin, leads)
lib/services/* domain logic (events, bookings, membership, invites, notifications, refunds, users)
lib/payments/* PaymentProvider adapters (razorpay, cashfree)
lib/telegram/* Bot API client, auth validation, bot command routing
lib/views/* server-rendered HTML (auto-escaping `html` tag)
migrations/ Postgres migrations (legacy SQLite files kept in migrations/legacy-sqlite/)
public/ css, js (site.js, admin.js), images
scripts/ migrate, seed-demo, telegram-setup, lint, make-og
test/ node:test suites against real Postgres
docs/ PLATFORM_AUDIT, IMPLEMENTATION_PLAN, ROUTES_AND_ROLES, TEST_STRATEGY, ORGANISER_WIZARD,
AUDIT, SPEC, ARCHITECTURE, PAYMENTS_DECISION, TELEGRAM_SETUP, RUNBOOK, GO_LIVE
api/index.js Vercel serverless entry point
lib/router.js Central HTTP routing table (pages + API)
lib/config.js Environment variable loading and security assertions
lib/db.js Postgres connection pooling and query wrapper
lib/handlers/ HTTP route handlers (pages, auth, bookings, payments, telegram, cron, admin, leads)
lib/services/ Domain logic (events, bookings, membership, invites, notifications, refunds, users)
lib/payments/ Payment providers (SuperProfile, UPI/PhonePe)
lib/telegram/ Bot API client, auth validation, webhook router
lib/views/ Server-rendered HTML components (escaped html template tag)
migrations/ Tracked Postgres migration files (003 through 020)
public/ Static assets: css/, js/ (site.js, admin.js), brand images
scripts/ Operational scripts (migrate, seed-demo, seed-local, lint, db-reset)
test/ Automated test suites (unit, integration, security against real Postgres)
tests/e2e/ Playwright E2E and Axe accessibility test suites
docs/ Consolidated project documentation (PRODUCT, ARCHITECTURE, DEPLOYMENT, SECURITY, OPERATIONS)
```

## Local development
---

## Local Development Setup

### 1. Prerequisites
- Node.js 24.x
- PostgreSQL 14+ running locally

### 2. Quickstart
```bash
# Clone and install dependencies
git clone https://github.com/Jakuraa/StrangersMeetup.git
cd StrangersMeetup
npm install
# Postgres 14+ running locally; create a database

# Create local development database
createdb sm_dev
cp .env.example .env # fill DATABASE_URL, SESSION_SECRET (32+ chars), CRON_SECRET; DEV_LOGIN=true for a local test login
npm run migrate # loads .env (only .env — not .env.local)
npm run seed:demo # optional: 4 sample events, all labelled "Sample"
npm run seed:local # optional, local DB only: 6 test personas + events in known states (docs/LOCAL_TESTING.md)
npm run dev # http://localhost:3000 (PORT)

# Configure environment
cp .env.example .env
# Edit .env: ensure DATABASE_URL=postgres://localhost/sm_dev and SESSION_SECRET is set

# Run schema migrations
npm run migrate

# Optional: Seed sample demo events or local test personas
npm run seed:demo
npm run seed:local

# Start local server (default: http://localhost:3000)
npm run dev
```
Reset a **local** database (refuses remote URLs, Vercel, production, and any DB that is not empty or StrangersMeetup):

### 3. Reset Local Database
Refuses remote URLs, production databases, and protected branches:
```bash
npm run db:reset:local -- --yes=sm_dev [--seed-demo]
```

## Tests
---

## Automated Testing Suite

The test suite runs against real PostgreSQL databases. The test harness drops and recreates the `public` schema on `TEST_DATABASE_URL`.

```bash
# Create dedicated test databases
createdb sm_test
TEST_DATABASE_URL=postgres://localhost/sm_test npm test
createdb sm_e2e

# 1. Syntax and JSON linting
npm run lint
npm run test:e2e # Playwright + axe, desktop and mobile, against a local sm_e2e DB (docs/LOCAL_TESTING.md)

# 2. Unit, integration, and security tests (real Postgres)
TEST_DATABASE_URL=postgres://localhost/sm_test npm test

# 3. Playwright E2E and accessibility audits
E2E_DATABASE_URL=postgres://localhost/sm_e2e npm run test:e2e
```
The suite drops and recreates the `public` schema of `TEST_DATABASE_URL`, so point it at a dedicated test database.
Tests run the real router against a real Postgres; Telegram and payment HTTP calls are stubbed in `test/helpers.js`. Coverage includes initData validation (bad hash/stale/replay), webhook signatures and idempotency, failed payments, paid ticket → one booking + one invite, capacity race, Stars membership lifecycle and revocation, admin roles/CSRF, form rate limits, secret scan of client assets, and "no fabricated numbers" on an empty DB.

## Deploy
Vercel builds with `npm run vercel-build`. Migrations run only in **Production** builds; a Preview build migrates
only when `MIGRATE_ON_PREVIEW=true`, which must be set only if Preview has its own database. Crons: `vercel.json` → `/api/cron/daily` (Hobby plan: once a day). Health: `GET /api/health`.
---

## Core Engineering Principles

1. **Zero Fabricated Data:** Every statistic and count rendered on the site is an authentic database query. When no events exist, honest empty states render rather than fabricated fillers.
2. **Server as Single Source of Truth:** Bookings, ticket allocations, and user entitlements mutate exclusively inside atomic database transactions driven by verified webhooks or server reconciliation. Client redirects never confirm state.
3. **Defense in Depth:** All client inputs are validated via strict schemas. Mutating requests enforce CSRF tokens. Protected endpoints enforce role-based access controls.
4. **Zero Client Secret Leakage:** Sensitive keys, API tokens, and credentials exist solely in server environment variables and are never bundled into client scripts.

---

## Documentation Index

## Rules this codebase keeps
- No fabricated data: every number is a query; demo rows are `is_demo` and labelled "Sample"; social proof hidden below `SOCIAL_PROOF_MIN`.
- Server is the source of truth: bookings/entitlements change only in verified webhooks or server-side reconciliation.
- Secrets only in env vars; `.env.example` lists names only. Live payments off until `ENABLE_LIVE_PAYMENTS=true`.
- [docs/PRODUCT.md](file:///Users/pradeepjakuraa/strangersmeetup/docs/PRODUCT.md) — Product vision, user personas, event categories, geographic coverage, and end-to-end user journeys.
- [docs/ARCHITECTURE.md](file:///Users/pradeepjakuraa/strangersmeetup/docs/ARCHITECTURE.md) — System architecture, database schema, state machines, and API specifications.
- [docs/DEPLOYMENT.md](file:///Users/pradeepjakuraa/strangersmeetup/docs/DEPLOYMENT.md) — Vercel production hosting, Neon Postgres configuration, environment variables, and migration gates.
- [docs/SECURITY.md](file:///Users/pradeepjakuraa/strangersmeetup/docs/SECURITY.md) — Security policies, authentication mechanics, payment guards, privacy controls, and vulnerability disclosure.
- [docs/OPERATIONS.md](file:///Users/pradeepjakuraa/strangersmeetup/docs/OPERATIONS.md) — Runbooks, Telegram bot configuration, daily crons, refunds, incident management, and secret rotation.
Loading
Loading