{"id":50453978,"url":"https://github.com/mizcausevic-dev/vapor-saas-billing-engine","last_synced_at":"2026-06-01T01:05:30.784Z","repository":{"id":357465149,"uuid":"1236781446","full_name":"mizcausevic-dev/vapor-saas-billing-engine","owner":"mizcausevic-dev","description":"Swift Vapor billing engine for subscription lifecycle, proration, dunning, and replay-safe webhook idempotency.","archived":false,"fork":false,"pushed_at":"2026-05-28T02:29:03.000Z","size":1396,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-28T04:07:01.187Z","etag":null,"topics":["backend","billing","finance-ops","idempotency","openapi","saas","server-side-swift","subscription-billing","subscriptions","swift","swift-server","vapor","webhooks"],"latest_commit_sha":null,"homepage":"https://kineticgain.com/","language":"Swift","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/mizcausevic-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"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-05-12T15:08:56.000Z","updated_at":"2026-05-17T05:16:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mizcausevic-dev/vapor-saas-billing-engine","commit_stats":null,"previous_names":["mizcausevic-dev/vapor-saas-billing-engine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mizcausevic-dev/vapor-saas-billing-engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizcausevic-dev%2Fvapor-saas-billing-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizcausevic-dev%2Fvapor-saas-billing-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizcausevic-dev%2Fvapor-saas-billing-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizcausevic-dev%2Fvapor-saas-billing-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mizcausevic-dev","download_url":"https://codeload.github.com/mizcausevic-dev/vapor-saas-billing-engine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizcausevic-dev%2Fvapor-saas-billing-engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33755379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["backend","billing","finance-ops","idempotency","openapi","saas","server-side-swift","subscription-billing","subscriptions","swift","swift-server","vapor","webhooks"],"created_at":"2026-06-01T01:05:30.715Z","updated_at":"2026-06-01T01:05:30.777Z","avatar_url":"https://github.com/mizcausevic-dev.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vapor SaaS Billing Engine\r\n\r\nSwift Vapor billing engine for subscription lifecycle, proration, dunning, and webhook idempotency.\r\n\r\n## Why this repo is good\r\n\r\n- It shows server-side Swift on a very commercially legible SaaS problem.\r\n- It focuses on the parts of billing that operators actually care about: upgrades, downgrades, recovery, and replay-safe webhook handling.\r\n- It complements `tenant-access-control-plane`, `payment-event-ledger-eos`, and `knowledge-memory-workbench` without feeling repetitive.\r\n- It includes proof surfaces, tests, CI, and an OpenAPI contract instead of stopping at a code sample.\r\n\r\n## Screenshots\r\n\r\n![Overview](./screenshots/01-overview.png)\r\n![Lifecycle board](./screenshots/02-lifecycle-board.png)\r\n![Webhook proof](./screenshots/03-webhook-proof.png)\r\n![Docs lane](./screenshots/04-docs-lane.png)\r\n\r\n## What it does\r\n\r\n- models SaaS plans, subscription state, invoice posture, and dunning pressure\r\n- simulates Stripe-style webhook delivery with idempotency-key suppression\r\n- exposes a clean API for dashboard summary, subscriptions, invoices, and webhook history\r\n- ships HTML proof routes for overview, lifecycle, verification, and docs\r\n- publishes an OpenAPI JSON contract at `/openapi.json`\r\n\r\n## Local run\r\n\r\n```powershell\r\ncd vapor-saas-billing-engine\r\nswift run\r\n```\r\n\r\nOpen:\r\n\r\n- `http://127.0.0.1:4624/`\r\n- `http://127.0.0.1:4624/lifecycle`\r\n- `http://127.0.0.1:4624/verification`\r\n- `http://127.0.0.1:4624/docs`\r\n\r\nIf the port is busy:\r\n\r\n```powershell\r\n$env:PORT = \"4628\"\r\nswift run\r\n```\r\n\r\n## Validation\r\n\r\n```powershell\r\nswift build\r\nswift test\r\n```\r\n\r\n## Important Windows note\r\n\r\nOn this machine, local Vapor dependency checkout is currently blocked by Windows symlink restrictions in upstream Swift packages. The source code, tests, CI, docs, and proof layer are all in place, but a full local `swift build` here requires either:\r\n\r\n- Windows Developer Mode enabled\r\n- or elevated symlink permissions\r\n\r\nThe GitHub Actions workflow validates the package on environments that can check out those dependencies cleanly.\r\n\r\n## API routes\r\n\r\n- `GET /api/dashboard/summary`\r\n- `GET /api/subscriptions`\r\n- `GET /api/invoices`\r\n- `GET /api/webhooks`\r\n- `GET /api/sample`\r\n- `POST /api/webhooks/stripe`\r\n- `GET /openapi.json`\r\n\r\nExample webhook payload:\r\n\r\n```json\r\n{\r\n  \"eventId\": \"evt_9901\",\r\n  \"type\": \"invoice.payment_failed\",\r\n  \"accountId\": \"acct-lattice\",\r\n  \"amount\": 4200,\r\n  \"idempotencyKey\": \"idemp_evt_9901\"\r\n}\r\n```\r\n\r\n## Repo anatomy\r\n\r\n- [Sources/App/main.swift](./Sources/App/main.swift)\r\n- [Sources/App/BillingStore.swift](./Sources/App/BillingStore.swift)\r\n- [Sources/App/Render.swift](./Sources/App/Render.swift)\r\n- [Sources/App/OpenAPISpec.swift](./Sources/App/OpenAPISpec.swift)\r\n- [docs/architecture.md](./docs/architecture.md)\r\n- [docs/openapi.json](./docs/openapi.json)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizcausevic-dev%2Fvapor-saas-billing-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmizcausevic-dev%2Fvapor-saas-billing-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizcausevic-dev%2Fvapor-saas-billing-engine/lists"}