Sign in

    aitne

    A lightweight and high-performance reactive web framework.

    web
    reactive
    framework
    fine-grained
    Download zip
    Author
    Version
    0.4.8
    License
    MIT
    Last updated
    3 months ago
    Downloads
    142

    #Aitne

    Aitne Banner

    A lightweight and high-performance web framework with fine-grained reactivity. Inspired by leptos and solidjs. Support MBX (JSX-like) format to develop.

    #Getting Started

    #Installing CLI

    macOS/Linux:
    curl -fsSL https://raw.githubusercontent.com/Arcelyth/aitne/main/scripts/install.sh | bash

    aitne CLI depends on async library which not support Windows now

    #Initializing

    aitne init your_project cd your_project

    Build your project:
    aitne build

    #Running

    aitne run

    This will start a web server on http://localhost:8000 by default which depends on eirene.toml config file.

    #Examples

    Todo list:
    ///|
    fn todo_app() -> &View {
    let (input_val, set_input_val) = @reactive.create_signal("")
    let (todo, set_todo) = @reactive.create_signal(["Example."])

    let add_item = _ => {
    let text = input_val.get()
    if text != "" {
    set_todo.set(todo.get() + [text])
    }
    set_input_val.set("")
    }

    let remove_item = item => {
    let new_list = todo.get().filter(fn(t) { t != item })
    set_todo.set(new_list)
    }

    div().children([
    h1().children([text("Todo List")]),
    div().children([text_dyn(fn() { todo.get().length().to_string() })]),
    div().children([
    input()
    .attr("type", "text")
    .value(input_val)
    .on(Input, ev => set_input_val.set(@ffi.event_target_value(ev))),
    button().on(Click, add_item).children([text("Add")]),
    ]),
    ul().children([
    for_node(() => todo.get(), item => { return item }, item => {
    li().children([
    text(item),
    button().on(Click, _ => remove_item(item)).children([text("Delete")]),
    ])
    }),
    ]),
    ])
    }

    #MBX Format (JSX-like)

    Simple router usage in MBX format:
    ///| pub fn app() -> &View { <Router base="/"> <Routes fallback={() => <NotFound />}> <Route path="/" view={() => <Home />} /> <ParentRoute path="/users" view={() => <UsersPage />}> <Route path="/:id" view={() => <UserDetailPage />}/> </ParentRoute> <ParentRoute path="/t" view={() => <TryPage />}> <Route path="/t1" view={() => <TryPage />} /> </ParentRoute> </Routes> </Router> } ///| fn main { let _ = @dom.mount_to_body(() => <App />) }

    #Editor Support

    #Eirene

    Eirene is a simple web server built in MoonBit, specifically designed to serve static assets and handle Single Page Application (SPA) routing fallbacks for the Aitne ecosystem. An example 'eirene.toml' config file:
    [app] name = "examples" mode = "development" entry_html = "index.html" [build] target = "js" src_dir = "src" out_dir = "." [server] host = "127.0.0.1" port = 8000

    #Learn more

    This library still work in progress, not production ready!

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io