{"id":13501287,"url":"https://github.com/tetra-framework/tetra","last_synced_at":"2026-03-17T16:12:07.824Z","repository":{"id":37191460,"uuid":"487588681","full_name":"tetra-framework/tetra","owner":"tetra-framework","description":"Tetra - A full stack component framework for Django using Alpine.js","archived":false,"fork":false,"pushed_at":"2026-01-26T22:02:29.000Z","size":1520,"stargazers_count":611,"open_issues_count":3,"forks_count":22,"subscribers_count":16,"default_branch":"main","last_synced_at":"2026-01-27T09:31:15.543Z","etag":null,"topics":["alpinejs","django","full-stack","python"],"latest_commit_sha":null,"homepage":"https://www.tetraframework.com","language":"Python","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/tetra-framework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-05-01T16:39:31.000Z","updated_at":"2026-01-26T22:02:01.000Z","dependencies_parsed_at":"2024-01-14T03:47:59.005Z","dependency_job_id":"3c223775-a39f-4254-9a1f-da0eb6a4b12b","html_url":"https://github.com/tetra-framework/tetra","commit_stats":{"total_commits":90,"total_committers":4,"mean_commits":22.5,"dds":0.2666666666666667,"last_synced_commit":"3864e452fb8fb3a84fc662a686cd434b32fa5f07"},"previous_names":["tetra-framework/tetra","samwillis/tetra"],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/tetra-framework/tetra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetra-framework%2Ftetra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetra-framework%2Ftetra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetra-framework%2Ftetra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetra-framework%2Ftetra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tetra-framework","download_url":"https://codeload.github.com/tetra-framework/tetra/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetra-framework%2Ftetra/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"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":["alpinejs","django","full-stack","python"],"created_at":"2024-07-31T22:01:31.661Z","updated_at":"2026-02-18T21:02:55.294Z","avatar_url":"https://github.com/tetra-framework.png","language":"Python","readme":"# Tetra\n\nFull stack component framework for [Django](http://djangoproject.com) using [Alpine.js](https://alpinejs.dev)\n\nTetra is a new full stack component framework for Django, bridging the gap between your server logic and front end presentation. It uses a public shared state and a resumable server state to enable inplace updates for components. It also encapsulates your Python, HTML, JavaScript and CSS into one file or directory for proximity of related concerns.\n\n\n## Documentation\n\nToo much for a README. There's a [Documentation](https://tetra.readthedocs.org) page. \n\nThere is also a shortcut to some [examples](https://www.tetraframework.com/examples/).\n\n## Installation\n\nAs usual:\n```\nuv pip install tetra\n```\n\nBut wait, this isn't all. Tetra needs some customization in your Django project. \n\nRead more at [Installation docs](https:/www.tetraframework.com/installation.md)\n\n## Short Overview\n\nFor the impatient: here's a short example video that shows what Tetra is capable of:\n\n\nhttps://github.com/user-attachments/assets/137c53af-1fc2-48c5-9c53-a007fbad7874\n\n\n\nThis is done using simple and concise code in one component, rendered in your template with just `{% InfoCard / %}`. No page reload needed.\n\n```python\nfrom tetra import Component, public\n\nclass InfoCard(Component):\n    title: str = \"I'm so excited!\"\n    content: str = \"We got some news for you.\"\n    name: str = public(\"\")\n\n    @public\n    def close(self):\n        self.client._removeComponent()\n\n    @public\n    def done(self):\n        print(\"User clicked on OK, username:\", self.name)\n        self.content = f\"Hi { self.name }! No further news.\"\n\n    template = \"\"\"\n    \u003cdiv class=\"card text-white bg-secondary mb-3\" style=\"max-width: 18rem;\"\u003e\n      \u003cdiv class=\"card-header d-flex justify-content-between\"\u003e\n        \u003ch3\u003eInformation\u003c/h3\u003e\n        \u003cbutton class=\"btn btn-sm btn-warning\" @click=\"_removeComponent(\n        )\"\u003e\u003ci class=\"fa fa-x\"\u003e\u003c/i\u003e\u003c/button\u003e\n      \u003c/div\u003e\n      \n      \u003cdiv class=\"card-body\"\u003e\n        \u003ch5 class=\"card-title\"\u003e{{ title }}\u003c/h5\u003e\n        \u003cp class=\"card-text\"\u003e\n          {{ content }}\n        \u003c/p\u003e\n        \u003cp x-show=\"!name\"\u003e\n          Enter your name below!\n        \u003c/p\u003e\n        \u003cp x-show=\"name\"\u003e\n            Thanks, {% livevar name %}\n        \u003c/p\u003e\n        \u003cdiv class=\"input-group mb-3\"\u003e\n\n          \u003cinput \n            type=\"text\" \n            class=\"form-control\" \n            placeholder=\"Your name\" \n            @keyup.enter=\"done()\"\n            x-model=\"name\"\u003e\n        \u003c/div\u003e\n        \u003cbutton \n            class=\"btn btn-primary\" \n            @click=\"done()\" \n            :disabled=\"name == ''\"\u003e\n            Ok\n        \u003c/button\u003e\n      \u003c/div\u003e\n      \n    \u003c/div\u003e\n    \"\"\"\n```\n\n## What does Tetra do exactly?\n\nDjango on the backend, Alpine.js in the browser\n: Tetra combines the power of Django with Alpine.js to make development easier and quicker.\n\nComponent encapsulation\n: Each component combines its Python, HTML, CSS and JavaScript in one place for proximity of related code.\n\nResumable server state\n: The components' full server state is saved between public method calls. This state is encrypted for security.\n\nPublic server methods\n: Methods can be made public, allowing you to easily call them from JS on the front end, resuming the component's state.\n\nShared public state\n: Attributes can be decorated to indicate they should be available in the browser as Alpine.js data objects.\n\nServer \"watcher\" methods\n: Public methods can be instructed to watch a public attribute, enabling reactive re-rendering on the server.\n\nInplace updating from the server\n: Server methods can update the rendered component in place. Powered by the Alpine.js morph plugin.\n\nComponent library packaging\n: Every component belongs to a \"library\"; their JS \u0026 CSS is packed together for quicker browser downloads.\n\nComponents with overridable slots\n: Components can have multiple {% slot(s) %} which can be overridden when used.\n\nJS/CSS builds using [esbuild](https://esbuild.github.io)\n: Both for development (built into runserver) and production your JS \u0026 CSS is built with esbuild.\n\nAutomatic Js Source Maps\n: Source maps are generated during development so that you can track down errors to the original Python files.\n\nSyntax highlighting with type annotations\n: Tetra uses type annotations to syntax highlight your JS, CSS \u0026 HTML in your Python files with a [VS Code plugin](https://github.com/samwillis/python-inline-source/tree/main/vscode-python-inline-source)\n\nForms\n: `FormComponent`s can act as simple replacements for Django's FormView, but due to Tetra's dynamic nature, a field can e.g. change its value or disappear depending on other fields' values.\n","funding_links":[],"categories":["Python","Front-end frameworks"],"sub_categories":["More"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetra-framework%2Ftetra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftetra-framework%2Ftetra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetra-framework%2Ftetra/lists"}