Skip to content

What is Ghuri?

Ghuri is a web framework for TypeScript that copies Django’s structure on purpose. A Ghuri project has a settings.ts, a list of INSTALLED_APPS, models with objects managers, migrations generated from those models, a urls.ts built from path() and include(), an admin you get by registering models, and a REST framework that reads like Django REST framework.

The name is Bengali for kite (ঘুড়ি): something light that flies high and stays on a string you control.

TypeScript has excellent building blocks (routers, query builders, validation libraries) and very few frameworks that decide how a whole application fits together. Django’s answers to that question have held up for twenty years. Ghuri takes those answers and fits them to a different runtime: serverless JavaScript at the edge.

Three ideas drive the design:

Cloudflare first. A new project runs on Cloudflare Workers with D1 (SQLite) for data, R2 for files and KV for cache. npm run dev starts wrangler dev; ghuri deploy ships it. For a small project that is free or close to it.

Portability is a feature. Your code never touches env.DB or env.BUCKET. Databases, storage, caches and the runtime sit behind adapters chosen in settings. Moving to Postgres on a VPS means changing DATABASES, running ghuri migrate, and copying your data with ghuri dumpdata and ghuri loaddata. Your models, views and serializers stay as they are.

Django muscle memory. Names, file layout and behaviour follow Django and DRF wherever TypeScript allows. Where TypeScript forces a change (options are camelCase, everything that touches the database is async), the change is mechanical and documented in Ghuri for Django developers.

Layer Library
HTTP routing, middleware, JSX rendering Hono
SQL generation and dialects Drizzle ORM
Local development and deploys Wrangler
Node runtime @hono/node-server
AI agents Vercel AI SDK

You can always reach the layer below. A view receives a Hono Context, any Hono app can be mounted in urlpatterns, and getDrizzle() gives you the Drizzle database for a query the ORM cannot express.

Ghuri is split into packages under the @ghuri npm scope. A new project installs the core set (core, orm, auth, rest, storage, admin, cli, plus graphql with startproject --graphql). You add the others when you want them, and can drop the ones you do not use.

Package Contains
@ghuri/core settings, app registry, URLs, views, middleware, request context, signals, cache, management command base, test client, Node adapter
@ghuri/orm Model, fields, managers and QuerySets, relations, database adapters (D1, Postgres, SQLite, PGlite), migrations
@ghuri/auth content types, users, groups, permissions, password hashing, sessions, tokens, JWT; REST authentication in @ghuri/auth/rest
@ghuri/rest serializers, API views, viewsets, routers, permissions, pagination, filters, throttling, OpenAPI
@ghuri/storage storage API with R2, S3, filesystem (@ghuri/storage/fs) and memory backends; FileField, ImageField
@ghuri/admin the admin site, server-rendered with Hono JSX and htmx
@ghuri/graphql GraphQL in graphene-django style: model types, Relay connections and filters, serializer mutations, GraphiQL
@ghuri/realtime WebSockets in Django Channels style: consumers routed in urls.ts, rooms on Durable Objects, a channel layer
@ghuri/oauth Passport.js-style login strategies: OAuth2, OpenID Connect, local, magic link, bearer
@ghuri/socialauth social login like django-allauth: GitHub, Google, Microsoft and other providers, any OpenID Connect provider
@ghuri/mail email like django.core.mail: sendMail, EmailMessage; Cloudflare Email, Resend, SMTP, console and test backends
@ghuri/tenants shared-schema multi-tenancy: tenant-scoped models and QuerySets that fail closed, request resolvers, leak tests
@ghuri/agents AI agents whose tools come from your models and viewsets; an MCP server
@ghuri/cli the ghuri command
create-ghuri npm create ghuri@latest
  • Install Ghuri and create a project.
  • Work through the tutorial, which builds a blog with an admin and a REST API and deploys it to Cloudflare.
  • If you already know Django, keep the cheat sheet open in a tab.