Skip to content

Repository files navigation

@artisansdk/architect

npm version CI License: MIT Docs

A Laravel-inspired application container for frontend apps: a shared dependency-injection container, service providers with a register → boot → destroy lifecycle, and thin useService(...) runtime adapters for React, Solid, Svelte, and Vue.

It doesn't replace your framework's state tools — it gives you one structured place to register services and application infrastructure, then resolve them from components and startup code instead of ad hoc singleton modules.

bun add @artisansdk/architect
import "reflect-metadata";
import { Application, ServiceProvider, ContainerContract as Container } from "@artisansdk/architect";
import { ContextProvider, useService } from "@artisansdk/architect/react";
import ReactDOM from "react-dom/client";

class Counter {
  protected count = 0;
  increment() { return ++this.count; }
  current() { return this.count; }
}

class CounterProvider extends ServiceProvider {
  register(container: Container) {
    container.singleton(Counter, Counter);
  }
}

function App() {
  const counter = useService(Counter);
  return <button onClick={() => counter.increment()}>Count: {counter.current()}</button>;
}

const application = Application.configure({ config: { app: { name: "Demo" } } })
  .withProviders([new CounterProvider()]);

ReactDOM.createRoot(document.getElementById("root")!).render(
  <ContextProvider application={application}><App /></ContextProvider>
);

Documentation

Full guides and API reference: artisansdk.github.io/architect

Examples

Runnable framework examples live under examples/ (react, solid, svelte, vue):

cd examples/react
bun install
bun run dev

Development

bun test
bun run fix

Licensing

Copyright (c) 2026 Artisan Made, Co and Joseph Raub

This package is released under the MIT license. Please see the LICENSE file distributed with every copy of the code for commercial licensing terms.

About

A Laravel inspired package for reactive frontends.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages