|
| 1 | +# Fusion Framework |
| 2 | + |
| 3 | +Class-based HTTP APIs with one shared Rust core and first-class bindings for **Python**, **Node.js**, and **C#**. Routes, middleware, OpenAPI/Swagger, cache, templates, and background tasks share the same semantics across languages — write once in `fusion-core`, expose through each binding. |
| 4 | + |
| 5 | +| | | |
| 6 | +|---|---| |
| 7 | +| **Docs** | [fusion.cipherunit.xyz](https://fusion.cipherunit.xyz/) | |
| 8 | +| **CLI / scaffolds** | [cipherunits/fusion-tool](https://github.com/cipherunits/fusion-tool) | |
| 9 | +| **License** | [BSD 3-Clause](LICENSE) | |
| 10 | +| **Version** | `2.0.1` | |
| 11 | + |
| 12 | +## Why this repo |
| 13 | + |
| 14 | +Most multi-language frameworks drift: each binding invents its own router rules and OpenAPI shapes. Fusion keeps shared behavior in Rust (`crates/fusion-core`) and thin glue in each language, so `api/[module]/{id}`, versioned Swagger, and middleware chains stay aligned. |
| 15 | + |
| 16 | +## Install (applications) |
| 17 | + |
| 18 | +Use published packages for app projects. Scaffold with Fusion Tool when you want a full project tree: |
| 19 | + |
| 20 | +```bash |
| 21 | +# CLI |
| 22 | +# https://github.com/cipherunits/fusion-tool |
| 23 | +fusion init --lang python --name my-app # or node / csharp |
| 24 | +``` |
| 25 | + |
| 26 | +| Language | Package | |
| 27 | +|----------|---------| |
| 28 | +| Python | `pip install fusion-framework` | |
| 29 | +| Node.js | `npm install fusion-framework` | |
| 30 | +| C# | `dotnet add package Fusion-Framework` | |
| 31 | + |
| 32 | +Binding-specific quick starts live next to the packages: |
| 33 | + |
| 34 | +- [Python](crates/fusion-py/README.md) |
| 35 | +- [Node](crates/fusion-node/README.md) |
| 36 | +- [C#](bindings/csharp/FusionFramework/README.md) |
| 37 | + |
| 38 | +## Repository layout |
| 39 | + |
| 40 | +```text |
| 41 | +crates/fusion-core/ Shared Rust: routing, HTTP, cache, templates, tasks |
| 42 | +crates/fusion-py/ Python (PyO3) + fusion_framework package |
| 43 | +crates/fusion-node/ Node (N-API) package published as fusion-framework |
| 44 | +crates/fusion-ffi/ C ABI used by the C# binding |
| 45 | +bindings/csharp/ Managed C# API (NuGet: Fusion-Framework) |
| 46 | +examples/ Side-by-side demos (.py / .mjs / .cs) |
| 47 | +tests/ Executable tests (not inside installable packages) |
| 48 | +scripts/ Dev install + version bump helpers |
| 49 | +.agents/skills/ Agent skills for contributors working in this repo |
| 50 | +``` |
| 51 | + |
| 52 | +## Develop from source |
| 53 | + |
| 54 | +Prerequisites: Rust (stable), Python 3.9+, Node 18+, .NET SDK matching the C# target (`net10.0`). |
| 55 | + |
| 56 | +From the repo root: |
| 57 | + |
| 58 | +```bash |
| 59 | +./scripts/dev-install-python.sh --create-venv # or --venv .venv |
| 60 | +./scripts/dev-install-node.sh |
| 61 | +./scripts/dev-install-csharp.sh |
| 62 | +# or all three: |
| 63 | +./scripts/dev-install-all.sh |
| 64 | +``` |
| 65 | + |
| 66 | +Details: [scripts/README.md](scripts/README.md). |
| 67 | + |
| 68 | +### Tests |
| 69 | + |
| 70 | +```bash |
| 71 | +./tests/scripts/run-all.sh |
| 72 | +``` |
| 73 | + |
| 74 | +Per binding and layout notes: [tests/README.md](tests/README.md). |
| 75 | + |
| 76 | +### Examples |
| 77 | + |
| 78 | +Runnable samples under `examples/` mirror public APIs across languages (routing, cache, middleware, templates, static files, and more). Prefer adding a trio (`.py` / `.mjs` / `.cs`) when you introduce a new cross-binding feature. |
| 79 | + |
| 80 | +## Contributing |
| 81 | + |
| 82 | +### Cross-binding parity |
| 83 | + |
| 84 | +If a feature is user-facing in one binding (routes, middleware, permissions, settings, Swagger, UI helpers, …), implement it in **Python, Node, and C#** in the same change set unless the change is explicitly scoped. Put shared semantics in `fusion-core` first. |
| 85 | + |
| 86 | +### Commit messages |
| 87 | + |
| 88 | +Use [Conventional Commits](https://www.conventionalcommits.org/): |
| 89 | + |
| 90 | +```text |
| 91 | +<type>(optional-scope): <short summary> |
| 92 | +
|
| 93 | +feat(cache): add get_or_set helper |
| 94 | +fix(node): restore swagger navbar versions |
| 95 | +docs: expand root README install section |
| 96 | +chore(release): bump to 2.0.2 |
| 97 | +``` |
| 98 | + |
| 99 | +Allowed types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`, `release`. |
| 100 | + |
| 101 | +Optional local check (POSIX shell, no npm): |
| 102 | + |
| 103 | +```bash |
| 104 | +git config core.hooksPath .githooks |
| 105 | +``` |
| 106 | + |
| 107 | +That installs [`.githooks/commit-msg`](.githooks/commit-msg). Editor defaults: [`.editorconfig`](.editorconfig). |
| 108 | +### Staging |
| 109 | + |
| 110 | +Stage files by path (`git add path/to/file`). Do not use `git add .` / `git add -A` in this repository. |
| 111 | + |
| 112 | +## Links |
| 113 | + |
| 114 | +- Site & docs: https://fusion.cipherunit.xyz/ |
| 115 | +- Issues: https://github.com/cipherunits/fusion-framework/issues |
| 116 | +- Fusion Tool (CLI): https://github.com/cipherunits/fusion-tool |
| 117 | +- Author: [CipherUnits](https://cipherunit.xyz) |
| 118 | + |
| 119 | +## License |
| 120 | + |
| 121 | +BSD 3-Clause. See [LICENSE](LICENSE). |
0 commit comments