foldkit  by foldkit

Frontend framework for correctness and AI interaction

Created 11 months ago
318 stars

Top 84.9% on SourcePulse

GitHubView on GitHub
Project Summary

Frontend applications built with a strong emphasis on correctness and architectural consistency. It targets developers seeking a predictable, scalable pattern that avoids complexity creep, enabling them to build products with confidence. The framework offers a unified approach to state management and side effects, making it easier to reason about application behavior.

How It Works

Built on Effect and architected similarly to Elm, Foldkit is written in TypeScript. It enforces a singular pattern: one model, one update function, and one way to manage state and side effects, explicitly eschewing hooks and local state. Side effects are treated as values returned to the runtime, ensuring predictable execution and simplifying debugging. This architecture promotes a clear, declarative flow for application logic.

Quick Start & Requirements

The recommended way to start a new project is using npx create-foldkit-app@latest <AppName>. This command scaffolds a project with Tailwind CSS, TypeScript, ESLint, Prettier, and a Vite plugin for state-preserving HMR. Official documentation, examples, and a Discord community are available for guidance.

Highlighted Details

  • Effect Integration: Applications are fundamentally Effect programs, managing side effects as values.
  • Elm-like Architecture: Enforces a single source of truth for state and a pure update function.
  • No Hooks/Local State: Eliminates common sources of complexity and hidden mutations.
  • Type-Safe Routing: Bidirectional routing built with parser combinators.
  • Comprehensive Features: Includes managed resources, submodels, accessible UI components, field validation, virtual DOM (Snabbdom), and built-in DevTools with time-travel capabilities.
  • AI-Friendly: The explicit architecture makes code easier for both humans and LLMs to reason about, generate, and review.
  • Robust Testing: Offers Story Testing for unit-level logic and Scene Testing for user-driven interactions.
  • State-Preserving HMR: Vite plugin allows for rapid development cycles without losing application state.

Maintenance & Community

Foldkit provides a link to a Discord server for community interaction. The project is pre-1.0, indicating potential for API changes in minor releases, though the core API is considered stable.

Licensing & Compatibility

The project is licensed under the MIT license, which generally permits commercial use and integration into closed-source projects without significant restrictions.

Limitations & Caveats

Foldkit is a pre-1.0 project, meaning minor releases may introduce breaking changes. It requires a full commitment to its architectural paradigm, offering no React interop or escape hatches from its core principles, such as Effect.

Health Check
Last Commit

16 hours ago

Responsiveness

Inactive

Pull Requests (30d)
159
Issues (30d)
26
Star History
222 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.