IHP: The Type-safe Web Framework for Builders

March 11, 2026 ยท View on GitHub

MIT License

IHP Website

IHP: The Type-safe Web Framework for Builders

IHP is a batteries-included web framework optimized for longterm productivity and programmer happiness. Built on top of Haskell and Nix. Move fast, without breaking things.

In production since 2017. Used by teams building serious web applications.

Watch the IHP introduction

What IHP Code Looks Like

-- Controller: Create a new post
action CreatePostAction = do
    let post = newRecord @Post
    post
        |> fill @'["title", "body"]
        |> validateField #title nonEmpty
        |> validateField #body nonEmpty
        |> ifValid \case
            Left post -> render NewView { .. }
            Right post -> do
                post <- post |> createRecord
                redirectTo PostsAction

-- View: Type-safe HTML with HSX
renderPost :: Post -> Html
renderPost post = [hsx|
    <article>
        <h2>{post.title}</h2>
        <p>{post.body}</p>
    </article>
|]

Features

Type Safety -- Type-safe routing, queries, and HTML (HSX). Catch errors at compile time.

AI-Driven Development -- Optimized for Claude Code and AI-assisted workflows. The type system acts as a safety net -- AI generates code, the compiler verifies it. Ship features faster with confidence. IHP ships with a comprehensive CLAUDE.md that teaches AI tools the framework conventions.

Schema Designer -- Visual database design tool. Edit tables in a GUI or write SQL directly.

Code Generators -- Generate controllers, views, and migrations from the IDE.

Live Reload -- Instant feedback during development despite being a compiled language.

Live Reload

Auto Refresh -- Real-time views that update when data changes. One line of code.

Auto Refresh

Authentication -- Built-in user signup and login.

Forms & Validation -- Type-safe form handling with built-in validation.

Managed Environment -- Nix handles all dependencies including PostgreSQL and GHC. You don't need to learn Nix -- IHP uses it behind the scenes so that devenv up just works. Every developer on your team gets the exact same environment with zero setup friction.

Quick Start

nix profile install nixpkgs#ihp-new
ihp-new myproject
cd myproject && devenv up

Full Installation Guide | Your First Project

Package Ecosystem

IHP is a monorepo with focused packages:

PackagePurpose
ihpCore web framework (routing, controllers, views, models, validation)
ihp-hsxHSX templating (JSX-like HTML in Haskell)
ihp-ideDev server, schema designer, code generators
ihp-datasyncReal-time data sync via WebSockets
ihp-graphqlGraphQL API
ihp-openaiOpenAI integration
ihp-sscServer-side components
ihp-hspecTesting utilities
ihp-migrateDatabase migration tool
ihp-mailEmail support
ihp-job-dashboardBackground job monitoring
ihp-pglistenerPostgreSQL LISTEN/NOTIFY

Deployment

IHP apps deploy to NixOS servers using the built-in deploy-to-nixos tool. Your entire server configuration -- nginx, TLS via Let's Encrypt, PostgreSQL, systemd services -- lives declaratively in your git repository under Config/nix/hosts/production/.

deploy-to-nixos production

This runs nixos-rebuild over SSH to apply your configuration. No Docker, Kubernetes, or CI pipeline required -- your server matches your dev environment exactly. Systemd socket activation queues requests during deploys for zero-downtime restarts, and a watchdog automatically recovers unresponsive processes.

Docker and bare-metal deployments are also supported. Full deployment guide

Community

  • Slack -- Questions, help with type errors, or just chat
  • Forum -- Longer discussions and announcements

Contributing

We welcome pull requests! See CONTRIBUTING.md for details. Documentation lives in the Guide directory.