{"id":50136329,"url":"https://github.com/bivex/paywall-iap","last_synced_at":"2026-05-23T22:03:39.920Z","repository":{"id":341256826,"uuid":"1169447645","full_name":"bivex/paywall-iap","owner":"bivex","description":"Build a standalone In-App Purchase system for iOS and Android with Go backend API, React Native mobile app, PostgreSQL, Redis, and full subscription/revenue management.","archived":false,"fork":false,"pushed_at":"2026-03-17T06:12:51.000Z","size":46746,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-17T21:26:07.188Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bivex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":"AUDIT.md","citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-28T17:47:09.000Z","updated_at":"2026-03-17T06:12:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bivex/paywall-iap","commit_stats":null,"previous_names":["bivex/paywall-iap"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bivex/paywall-iap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bivex%2Fpaywall-iap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bivex%2Fpaywall-iap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bivex%2Fpaywall-iap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bivex%2Fpaywall-iap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bivex","download_url":"https://codeload.github.com/bivex/paywall-iap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bivex%2Fpaywall-iap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33413624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T18:09:33.147Z","status":"ssl_error","status_checked_at":"2026-05-23T18:09:31.380Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-23T22:03:39.010Z","updated_at":"2026-05-23T22:03:39.903Z","avatar_url":"https://github.com/bivex.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Paywall System\n\nIn-App Purchase system for iOS and Android with Go backend, Next.js admin dashboard, PostgreSQL, and Redis.\n\n## 🚀 Quick Start\n\n```bash\n# Start full stack (API + Worker + DB + Redis + Migrator)\ndocker compose -f infra/docker-compose/docker-compose.latency-optimized.yml up -d --build\n\n# Start frontend (dev mode — hot reload)\ncd frontend \u0026\u0026 docker compose -f docker-compose.dev.yml up -d --build\n\n# Or frontend production build\ncd frontend \u0026\u0026 docker compose up -d --build\n```\n\n## 🔐 Admin Panel\n\n**URL:** http://localhost:3000\n\n| Field | Value |\n|-------|-------|\n| Email | `admin@paywall.local` |\n| Password | `admin12345` |\n| Role | `superadmin` |\n\n\u003e ⚠️ Change the password before deploying to production.\n\n## 🧭 What is live in the system right now\n\nThe current local stack already includes working, database-backed admin flows for:\n\n- dashboard overview with KPI cards, trend charts, audit log, and webhook health\n- user list and User 360-style admin navigation\n- revenue ops center with dunning and webhook operations views\n- pricing tier management and paywall creation workflows\n- A/B tests / experiment studio backed by `ab_tests`, `ab_test_arms`, and live aggregate stats\n- lightweight frontend JS error capture via the local `js-error-collector`\n\n## 🖼️ Live Screenshots\n\nCaptured from the running local environment with MCP Playwright.\n\n| Login | Dashboard Overview |\n|---|---|\n| ![Login screen](docs/screenshots/login.png) | ![Dashboard overview](docs/screenshots/dashboard-overview.png) |\n\n| Users | Revenue Ops |\n|---|---|\n| ![Users page](docs/screenshots/users.png) | ![Revenue ops page](docs/screenshots/revenue-ops.png) |\n\n| Pricing Tiers | A/B Tests |\n|---|---|\n| ![Pricing tiers page](docs/screenshots/pricing-tiers.png) | ![A/B tests page](docs/screenshots/ab-tests.png) |\n\n| Paywall Creator |\n|---|\n| ![Paywall creator page](docs/screenshots/paywall-creator.png) |\n\n### Seed first admin (new DB)\n\n```bash\n# Via script (works with Docker DB)\nDB_CONTAINER=docker-compose-db-1 ./scripts/seed_admin.sh admin@paywall.local admin12345\n\n# Or via Go command\ncd backend \u0026\u0026 go run ./cmd/seed --email=admin@paywall.local --password=admin12345\n\n# Or via Makefile\ncd backend \u0026\u0026 make seed-admin EMAIL=admin@paywall.local PASSWORD=admin12345\n```\n\n### Seed full cold-start test data\n\n```bash\n# Docker DB/container mode\nDB_CONTAINER=docker-compose-db-1 ./scripts/seed_all_test_data.sh\n\n# Direct Postgres mode\nDATABASE_URL=postgresql://postgres:postgres@localhost:5432/iap_db ./scripts/seed_all_test_data.sh\n```\n\nThis seeds:\n\n- admin credentials\n- pricing tiers\n- realistic dashboard revenue fixtures\n- deterministic experiment/bandit fixtures for A/B Tests, Studio, Delayed Feedback, Sliding Window, and Multi-Objective pages\n\n### Auth flow\n\n```\nBrowser → POST /auth/v1/login (Next.js server action)\n        → POST /v1/admin/auth/login (Go API, bcrypt verify)\n        → JWT access token (15 min) + refresh token (30 days)\n        → httpOnly cookies set\n        → redirect /dashboard/default\n\n/dashboard/* without cookie → proxy.ts → redirect /auth/v1/login\n```\n\n## 🏗️ Services\n\n| Service | Port | Description |\n|---------|------|-------------|\n| Frontend | `3000` | Next.js 16 admin dashboard |\n| API | `8081` | Go/Gin REST API exposed from local Docker compose |\n| PostgreSQL | `5432` | Main database |\n| Redis | `6379` | Cache + JWT blocklist |\n| Google Billing Mock | `8090` | Local Google Play billing verifier mock |\n| Apple IAP Mock | `9090` | Local Apple receipt/webhook mock |\n| JS Error Collector | `8088` | Minimal frontend error intake that stores NDJSON logs |\n\n## 🗄️ Database\n\nMigrations are applied automatically by the `migrator` container on startup.\n\n```bash\n# Apply migrations manually (if needed)\nfor i in backend/migrations/*.up.sql; do\n  docker exec docker-compose-db-1 psql -U postgres -d iap_db \u003c \"$i\"\ndone\n```\n\n## 🐳 Docker Images\n\n| Service | Compressed | Efficiency |\n|---------|-----------|------------|\n| API | 14.5 MB | 99% |\n| Worker | 11.8 MB | 99% |\n| Migrator | 6.9 MB | 98% |\n| Frontend (prod) | 83.8 MB | 99.98% |\n| Frontend (dev) | 460 MB | 100% |\n\n**Build images:**\n```bash\ndocker build -t paywall-iap-api:latest     -f infra/docker/api/Dockerfile .\ndocker build -t paywall-iap-worker:latest  -f infra/docker/worker/Dockerfile .\ndocker build -t paywall-iap-migrator:latest -f infra/docker/migrator/Dockerfile .\n```\n\n## ⚡ Performance\n\n```bash\n# Latency-optimized stack (BBR, TCP tuning, PG async commit)\ndocker compose -f infra/docker-compose/docker-compose.latency-optimized.yml up -d\n```\n\nSee [Latency Optimization Guide](docs/operations/latency-optimization.md) for details.\n\n## 🌐 Production Deploy\n\nSet these env vars before deploying:\n```bash\nHTTPS=true          # enables Secure flag on cookies\nBACKEND_URL=http://api:8080   # internal Docker network\nNEXT_PUBLIC_API_URL=https://your-domain.com\n```\n\n## 📚 Documentation\n\n- [API Specification](docs/api/openapi.yaml)\n- [Database Schema](docs/database/schema-erd.md)\n- [Deployment](docs/runbooks/deploy-procedure.md)\n- [Latency Optimization](docs/operations/latency-optimization.md)\n- [Wireframes](docs/Wireframes_Rethink.md)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbivex%2Fpaywall-iap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbivex%2Fpaywall-iap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbivex%2Fpaywall-iap/lists"}