{"id":13468851,"url":"https://github.com/sparckles/starfyre","last_synced_at":"2025-05-15T01:08:44.490Z","repository":{"id":65117117,"uuid":"582078077","full_name":"sparckles/starfyre","owner":"sparckles","description":"A reactive, WASM based SSR Python Web Framework for Front-End Applications","archived":false,"fork":false,"pushed_at":"2025-05-05T17:52:02.000Z","size":12408,"stargazers_count":561,"open_issues_count":52,"forks_count":23,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-05T19:00:52.828Z","etag":null,"topics":["frontend","hacktoberfest","pyscript","python","python3","wasm","web"],"latest_commit_sha":null,"homepage":"http://sparckles.cloud/starfyre/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sparckles.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2022-12-25T15:24:55.000Z","updated_at":"2025-04-29T11:48:48.000Z","dependencies_parsed_at":"2023-11-20T20:31:04.285Z","dependency_job_id":"85df7859-8ed8-4a55-91a6-ed059569068e","html_url":"https://github.com/sparckles/starfyre","commit_stats":null,"previous_names":["sparckles/starfyre","sansyrox/starfyre"],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparckles%2Fstarfyre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparckles%2Fstarfyre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparckles%2Fstarfyre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparckles%2Fstarfyre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sparckles","download_url":"https://codeload.github.com/sparckles/starfyre/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254254042,"owners_count":22039792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["frontend","hacktoberfest","pyscript","python","python3","wasm","web"],"created_at":"2024-07-31T15:01:20.391Z","updated_at":"2025-05-15T01:08:39.483Z","avatar_url":"https://github.com/sparckles.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Starfyre Logo\" src=\"https://user-images.githubusercontent.com/29942790/221331176-609e156a-3896-4c1a-9386-7bf595dfb879.png\" width=\"350\" /\u003e\n\u003c/p\u003e\n\n[![Discord](https://img.shields.io/discord/1080951642070978651?label=discord\u0026logo=discord\u0026logoColor=white\u0026style=for-the-badge\u0026color=blue)](https://discord.gg/ThQcpvJMZ6)\n[![Downloads](https://static.pepy.tech/badge/starfyre)](https://pepy.tech/project/starfyre)\n\n\n# Starfyre ⭐🔥\n\n## Introduction:\n\nStarfyre is a library that allows you to build reactive frontends using only Python. With Starfyre, you can create interactive, real-time applications with minimal effort. Simply define your frontend as a collection of observables and reactive functions, and let Starfyre handle the rest. Starfyre is based on Pyscript for client side functions and uses the concept of `pyxides` when structuring code.\n\n- pyxide - translates to a container. Every component is a container. It can contain other components or HTML elements.\n\n\n\n\n## 📦 Installation:\n\n```\npip install starfyre\n```\n\nA sample project is hosted on [GitHub](https://github.com/sansyrox/first-starfyre-app/).\n\n## 🚀 Sample App\n\nTo create an application\n\n```bash\nstarfyre --create=\"my-app\"\n```\n\nIt will use the [create-starfyre-app](https://github.com/sparckles/create-starfyre-app) as the template to create a new project.\n\n## IDE/Editor Plugins\n- [vim-starfyre](https://github.com/sparckles/vim-starfyre) : A Vim plugin for syntax highlighting Starfyre files. \n- [vscode-starfyre](https://marketplace.visualstudio.com/items?itemName=SanskarJethi.starfyre) : A VSCode extension for syntax highlighting Starfyre files. \n\n### A simple component\n`my-app/pages/__init__.fyre`\n\n```python\nimport \"../styles/index.css\"\n\ndef message():\n  return \"World\"\n\n---client\nfrom starfyre import js\n\ndef handle_click():\n  js.console.log(\"Hello World\")\n---\n\n\u003cpyxide\u003e\n  \u003cdiv onclick={handle_click()}\u003e\n    Hello, {message()}\n  \u003c/div\u003e\n\u003c/pyxide\u003e\n\n```\n\n### Using Components\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand\u003c/summary\u003e\n\n`my-app/pages/__init__.fyre`\n\n```python\nimport \"../styles/index.css\"\nfrom @.components.custom_component import custom_component\n# @ is the alias for the source directory. e.g. my-app in our case\n\n\u003cpyxide\u003e\n \u003ccustom_component\u003e\u003c/custom_component\u003e\n\u003c/pyxide\u003e\n```\n\n`my-app/src/components/custom_component.fyre`\n\n```python\n\n\u003cpyxide\u003e\n  \u003cdiv\u003e This is a custom component \u003c/div\u003e\n\u003c/pyxide\u003e\n```\n\u003c/details\u003e\n\n### State Management\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand\u003c/summary\u003e\n\nSignals are super early at this moment. You need to have the word \"signal\" when declaring a variable. e.g. get_signal, set_signal, use_signal. And use_signal and get_signal can't be evaluated on the client, i.e. can't have `{use_signal()+1}`. This will be fixed with a better serialization.\n\n`my-app/pages/__init__.fyre`\n\n```python\n\n---client\n\n[get_signal, set_signal, use_signal] = create_signal(\"Hello World\")\n\ndef handle_click():\n  set_signal(\"Goodbye World\")\n---\n\n\u003cpyxide\u003e\n  \u003cdiv onclick={handle_click}\u003e\n    {use_signal()}\n  \u003c/div\u003e\n\u003c/pyxide\u003e\n\n```\n\u003c/details\u003e\n\n### Routing\n\u003cdetails\u003e\n\u003csummary\u003eFile based Routing\u003c/summary\u003e\n\nStarfyre supports file based routing.\n\n```bash\nmy-app\n├── pages\n│   ├── __init__.fyre\n│   ├── about.fyre\n│   └── nav.fyre\n```\n\n\u003c/details\u003e\n\n### Styling\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand\u003c/summary\u003e\n\nStarfyre supports CSS and file based css.\n\n```python\nimport \"../styles/index.css\"\n\n\u003cstyle\u003e\n.component {\n/* CSS here */\n}\n\n\u003c/style\u003e\n\n\u003cpyxide\u003e\n  \u003cdiv class=\"component\"\u003e Hello World \u003c/div\u003e\n\u003c/pyxide\u003e\n```\n\u003c/details\u003e\n\n### Dependencies\n\nYou need to have a `starfyre_config.toml` file in your project root directory. This file is used to specify the dependencies for your project. The dependencies are specified in the following format:\n\n```toml\n\npyxide_packages = [] # for client side packages\nserver_packages = [] # for server side packages\n\n[js_modules]\nis_odd = \"https://cdn.jsdelivr.net/npm/is-odd@3.0.1/+esm\"\nFireworks = \"https://cdn.jsdelivr.net/npm/fireworks-js@2.10.7/+esm\"\n```\n\nYou can specify the dependencies using the following commands:\n\n```bash\nstarfyre --add-pyxide-package=\"package-name\"\nstarfyre --add-server-package=\"package-name\"\nstarfyre --add-js-module=\"module-name\" --as=\"alias\"\n```\n\n\n## 🚀 Sample CLI usage\n\n```bash\nUsage: python -m starfyre [OPTIONS]\n\n  Command-line interface to compile and build a Starfyre project.\n\n  Args:\n\n      path (str): Path to the project directory.\n\n      build (bool): Whether to start the build package.\n\n      create (str): Name of the project to create.\n\n      serve (bool): Whether to serve the project.\n\nOptions:\n  --path TEXT    Path to the project. Requires --build.\n  --build        Compile and build package. Requires --path.\n  --create TEXT  Create a new project. Requires a project name.\n  --serve        Serve the project. Requires --path.\n  --help         Show this message and exit.\n```\n\n## 🗒️ How to contribute\n\n### 🏁 Get started\nPlease read the code of conduct and go through CONTRIBUTING.md before contributing to Starfyre. Feel free to open an issue for any clarifications or suggestions.\n\nIf you're feeling curious. You can take a look at a more detailed architecture here.\n\nIf you still need help to get started, feel free to reach out on our community discord.\n\n\n## ⚙️  Developing Locally\n\n1. Fork this [repo](https://github.com/sparckles/starfyre)\n2. Clone this repo - `git clone https://github.com/sparckles/starfyre`\n3. Go in to the starfyre directory - `cd starfyre`\n4. Download poetry `curl -sSL https://install.python-poetry.org/ | python3 -`\n5. Install the dependencies `poetry install`\n6. Activate poetry virtual environment `poetry shell`\n7. Run the script `./build.sh`. This command will run the build process in starfyre against the test application in `test-application` directory.\n  - The `build.sh` file is a simple script that runs two commands sequentially.\n    - `python -m starfyre --build=True --path=\"test_application/\"`\n        - The `path` variable here is the path to our application.\n        - The `build` directory is basically a python package that contains all the compiled files. We use the `--build` flag to run that package.\n\n8. You can find a small test application in the `test_application` directory.\n9. Navigate to `cd test_application/dist`.\n10. Open `index.html` in your browser to see the output.\n\n\n## Feedback\n\nFeel free to open an issue and let me know what you think of it. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsparckles%2Fstarfyre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsparckles%2Fstarfyre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsparckles%2Fstarfyre/lists"}