{"id":40743363,"url":"https://github.com/bottledcode/swytch-framework","last_synced_at":"2026-01-21T15:30:51.491Z","repository":{"id":65956534,"uuid":"603357850","full_name":"bottledcode/swytch-framework","owner":"bottledcode","description":"The Smart PHP Framework","archived":false,"fork":false,"pushed_at":"2024-01-13T22:13:10.000Z","size":614,"stargazers_count":21,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-26T17:02:15.057Z","etag":null,"topics":["framework","php","php-framework"],"latest_commit_sha":null,"homepage":"https://framework.getswytch.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bottledcode.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-02-18T09:07:43.000Z","updated_at":"2025-03-28T11:53:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"ee0d9691-fc03-4ab4-b10f-9292597bcf55","html_url":"https://github.com/bottledcode/swytch-framework","commit_stats":{"total_commits":232,"total_committers":1,"mean_commits":232.0,"dds":0.0,"last_synced_commit":"2b841232c2c5b578a207e453beb7a247d26adb2d"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/bottledcode/swytch-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bottledcode%2Fswytch-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bottledcode%2Fswytch-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bottledcode%2Fswytch-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bottledcode%2Fswytch-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bottledcode","download_url":"https://codeload.github.com/bottledcode/swytch-framework/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bottledcode%2Fswytch-framework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28635794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T15:01:31.228Z","status":"ssl_error","status_checked_at":"2026-01-21T14:42:58.942Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["framework","php","php-framework"],"created_at":"2026-01-21T15:30:51.427Z","updated_at":"2026-01-21T15:30:51.483Z","avatar_url":"https://github.com/bottledcode.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swytch Framework\n\nThe Swytch Framework is a new, fledgling, but powerful framework allowing you to write HTML inline with your application\nlogic, including API endpoints. It is built on top of [htmx](https://htmx.org/) for the browser-side heavy-lifting,\nand a custom, streaming HTML5 parser, to handle the HTML and escaping.\n\nFeatures:\n\n- Write HTML inline with your PHP code, relying on context-aware escaping.\n- Keep you API logic near the HTML that uses it.\n- Application routing via HTML (similar to ReactRouter).\n- Automatic CSRF protection.\n- Context-Aware escaping.\n- Automatic HTML5 validation.\n- Authorization and authentication aware routing and rendering.\n- Browser cache control.\n- Builtin support for translations.\n\n\u003e NOTE:\n\u003e This is currently pre-production software and is not recommended for production use.\n\n## Example Apps\n\nThe following are some example apps using the Swytch Framework:\n\n### [Once](https://github.com/bottledcode/once)\n\nCheck it out live on [once.getswytch.com](https://once.getswytch.com/). This is a secret message app.\n\n### [Authentication](https://github.com/bottledcode/swytch-auth)\n\nThis app provides a simple authentication system by emailing passwords. It provides Kubernetes ingress authentication.\n\n## Example Component\n\n```php\n#[\\Bottledcode\\SwytchFramework\\Template\\Attributes\\Component('example')]\nclass ExampleComponent {\n    use \\Bottledcode\\SwytchFramework\\Template\\Traits\\RegularPHP;\n    use \\Bottledcode\\SwytchFramework\\Template\\Traits\\Htmx;\n    \n    #[\\Bottledcode\\SwytchFramework\\Router\\Attributes\\Route(\\Bottledcode\\SwytchFramework\\Router\\Method::POST, '/api/number')]\n    public function getNumber(string $name, string $number): int {\n        return $this-\u003erender($name, random_int(0, 100));\n    }\n    \n    public function render(string $name, int $number = null): string {\n        $this-\u003ebegin();\n        ?\u003e\n        \u003cdiv\u003e\n            \u003ch1\u003eHello, {\u003c?= $name ?\u003e}\u003c/h1\u003e\n            \u003cform hx-post=\"/api/number\"\u003e\n                \u003c!-- CSRF protection is automatically added to forms --\u003e\n                \u003cinput type='hidden' name='name' value={\u003c?= $name ?\u003e} /\u003e\n                \u003cp\u003eHere is a random number: {\u003c?= $number ?\u003e}\u003c/p\u003e\n                \u003cbutton type=\"submit\"\u003eGenerate a new random number\u003c/button\u003e\n            \u003c/form\u003e\n        \u003c/div\u003e\n        \u003c?php\n        return $this-\u003eend();\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbottledcode%2Fswytch-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbottledcode%2Fswytch-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbottledcode%2Fswytch-framework/lists"}