{"id":13469488,"url":"https://github.com/remult/remult","last_synced_at":"2025-05-12T20:49:56.652Z","repository":{"id":37004145,"uuid":"108873775","full_name":"remult/remult","owner":"remult","description":"Full-stack CRUD, simplified, with SSOT TypeScript entities","archived":false,"fork":false,"pushed_at":"2025-05-02T07:22:16.000Z","size":61214,"stargazers_count":3002,"open_issues_count":19,"forks_count":138,"subscribers_count":31,"default_branch":"main","last_synced_at":"2025-05-02T07:48:07.519Z","etag":null,"topics":["angular","api","crud","express-middleware","fullstack","fullstack-typescript","jamstack","nextjs","orm","postgresql","react","rest","typescript","validation","vue"],"latest_commit_sha":null,"homepage":"https://remult.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remult.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-10-30T15:55:17.000Z","updated_at":"2025-04-29T09:00:26.000Z","dependencies_parsed_at":"2023-12-25T15:34:51.316Z","dependency_job_id":"1b27216a-6bd1-4f82-86cf-82f134508eb0","html_url":"https://github.com/remult/remult","commit_stats":{"total_commits":3864,"total_committers":36,"mean_commits":"107.33333333333333","dds":0.5157867494824017,"last_synced_commit":"28f34fd4863ccbdc9b17c033dc43144cc4c20cf4"},"previous_names":[],"tags_count":603,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remult%2Fremult","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remult%2Fremult/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remult%2Fremult/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remult%2Fremult/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remult","download_url":"https://codeload.github.com/remult/remult/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253820529,"owners_count":21969534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","api","crud","express-middleware","fullstack","fullstack-typescript","jamstack","nextjs","orm","postgresql","react","rest","typescript","validation","vue"],"created_at":"2024-07-31T15:01:42.025Z","updated_at":"2025-05-12T20:49:56.639Z","avatar_url":"https://github.com/remult.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eRemult\u003c/h1\u003e\n  \u003cp\u003eFull-stack CRUD, simplified, with SSOT TypeScript entities\u003c/p\u003e\n\t\u003ca href=\"https://circleci.com/gh/remult/remult/tree/main\" rel=\"nofollow\"\u003e\n\t\t\u003cimg alt=\"CircleCI\" src=\"https://circleci.com/gh/remult/remult/tree/main.svg?style=shield\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://codecov.io/gh/remult/remult\" rel=\"nofollow\"\u003e\n        \t\u003cimg src=\"https://codecov.io/gh/remult/remult/branch/main/graph/badge.svg?token=LYWQRUN3D1\"/\u003e\u003c/a\u003e\n    \t\u003ca href=\"https://raw.githubusercontent.com/remult/remult/main/LICENSE\" rel=\"nofollow\"\u003e\n\t\t\u003cimg alt=\"GitHub license\" src=\"https://img.shields.io/badge/license-MIT-blue.svg\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://www.npmjs.com/package/remult\" rel=\"nofollow\"\u003e\n\t\t\u003cimg alt=\"npm version\" src=\"https://badge.fury.io/js/remult.svg\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://www.npmjs.com/package/remult\" rel=\"nofollow\"\u003e\n\t\t\u003cimg alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/remult\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://discord.gg/GXHk7ZfuG5\" rel=\"nofollow\"\u003e\n\t\t\u003cimg alt=\"Join Discord\" src=\"https://badgen.net/discord/members/GXHk7ZfuG5?icon=discord\u0026label=Discord\"/\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr/\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"#tutorials\"\u003eTutorials\u003c/a\u003e |\n  \u003ca href=\"https://remult.dev/docs/quickstart\"\u003eQuickstart\u003c/a\u003e |\n  \u003ca href=\"https://remult.dev/docs/example-apps\"\u003eExample Apps\u003c/a\u003e\n\u003c/div\u003e\n\n\u003chr/\u003e\n\u003cbr/\u003e\n\n## What is Remult?\n\nRemult uses **TypeScript entities** as a single source of truth for: ✅ CRUD + Realtime API, ✅ frontend type-safe API client, and\n✅ backend ORM.\n\n- :zap: **Zero-boilerplate CRUD + Realtime API** with paging, sorting, and filtering\n- :ok_hand: **Fullstack type-safety** for API queries, mutations and RPC, without code generation\n- :sparkles: Input validation, **defined once**, runs both on the backend and on the frontend for best UX\n- :lock: Fine-grained **code-based API authorization**\n- :relieved: Incrementally adoptable\n\n**Remult supports all major databases**, including: PostgreSQL, MySQL, SQLite, MongoDB, MSSQL and Oracle.\n\n**Remult is frontend and backend framework agnostic** and comes with adapters for Express, Fastify, Next.js, Nuxt, SvelteKit, SolidStart, Nest, Koa, Hapi and Hono.\n\n\u003e **Want to experience Remult firsthand? [Try our interactive online tutorial](https://learn.remult.dev/).**\n\nRemult promotes a **consistent query syntax for both frontend and Backend code**:\n\n```ts\n// Frontend - GET: /api/products?_limit=10\u0026unitPrice.gt=5,_sort=name\n// Backend  - 'select name, unitPrice from products where unitPrice \u003e 5 order by name limit 10'\nawait repo(Product).find({\n  limit: 10,\n  orderBy: {\n    name: 'asc',\n  },\n  where: {\n    unitPrice: { $gt: 5 },\n  },\n})\n\n// Frontend - PUT: '/api/products/product7' (body: { \"unitPrice\" : 7 })\n// Backend  - 'update products set unitPrice = 7 where id = product7'\nawait repo(Product).update('product7', { unitPrice: 7 })\n```\n\n## Usage\n\n### Define schema in code\n\n```ts\n// shared/product.ts\n\nimport { Entity, Fields } from 'remult'\n\n@Entity('products', {\n  allowApiCrud: true,\n})\nexport class Product {\n  @Fields.cuid()\n  id = ''\n\n  @Fields.string()\n  name = ''\n\n  @Fields.number()\n  unitPrice = 0\n}\n```\n\n👉 **Don't like decorators?** we have full support for [Working without decorators](https://remult.dev/docs/working-without-decorators)\n\n### Add backend API with a [single line of code](https://remult.dev/docs/quickstart#server-side-initialization)\n\n_Example:_\n\n```ts\n// backend/index.ts\n\nimport express from 'express'\nimport { remultApi } from 'remult/remult-express' // adapters for: Fastify,Next.js, Nuxt, SvelteKit, SolidStart, Nest, more...\nimport { createPostgresDataProvider } from 'remult/postgres' // supported: PostgreSQL, MySQL, SQLite, MongoDB, MSSQL and Oracle\nimport { Product } from '../shared/product'\n\nconst app = express()\n\napp.use(\n  remultApi({\n    entities: [Product],\n    dataProvider: createPostgresDataProvider({\n      connectionString: 'postgres://user:password@host:5432/database\"',\n    }),\n  }),\n)\n\napp.listen()\n```\n\nRemult adds route handlers for a fully functional REST API and realtime live-query endpoints, optionally including an [Open API](https://remult.dev/docs/adding-swagger) spec and a [GraphQL](https://remult.dev/docs/adding-graphql) endpoint\n\n### Fetch data with type-safe frontend code\n\n```ts\nconst [products, setProducts] = useState\u003cProduct[]\u003e([])\n\nuseEffect(() =\u003e {\n  repo(Product)\n    .find({\n      limit: 10,\n      orderBy: {\n        name: 'asc',\n      },\n      where: {\n        unitPrice: { $gt: 5 },\n      },\n    })\n    .then(setProducts)\n}, [])\n```\n\n### :mega: Realtime Live Queries\n\n```ts\nuseEffect(() =\u003e {\n  return repo(Product)\n    .liveQuery({\n      limit: 10,\n      orderBy: {\n        name: 'asc',\n      },\n      where: {\n        unitPrice: { $gt: 5 },\n      },\n    })\n    .subscribe((info) =\u003e {\n      setProducts(info.applyChanges)\n    })\n}, [])\n```\n\n### :ballot_box_with_check: Data validation and constraints - defined once\n\n```ts\nimport { Entity, Fields, Validators } from 'remult'\n\n@Entity('products', {\n  allowApiCrud: true,\n})\nexport class Product {\n  @Fields.cuid()\n  id = ''\n\n  @Fields.string({\n    validate: Validators.required,\n  })\n  name = ''\n\n  @Fields.number\u003cProduct\u003e({\n    validate: (product) =\u003e product.unitPrice \u003e 0 || 'must be greater than 0',\n  })\n  unitPrice = 0\n}\n```\n\n#### Enforced in frontend:\n\n```ts\ntry {\n  await repo(Product).insert({ name: '', unitPrice: -1 })\n} catch (e: any) {\n  console.error(e)\n  /* Detailed error object -\u003e\n{\n  \"modelState\": {\n    \"name\": \"Should not be empty\",\n    \"unitPrice\": \"must be greater than 0\"\n  },\n  \"message\": \"Name: Should not be empty\"\n}\n*/\n}\n```\n\n#### Enforced in backend:\n\n```ts\n// POST '/api/products' BODY: { \"name\":\"\", \"unitPrice\":-1 }\n// Response: status 400, body:\n{\n  \"modelState\": {\n    \"name\": \"Should not be empty\",\n    \"unitPrice\": \"must be greater than 0\"\n  },\n  \"message\": \"Name: Should not be empty\"\n}\n```\n\n### :lock: Secure the API with fine-grained authorization\n\n```ts\n@Entity\u003cArticle\u003e('Articles', {\n  allowApiRead: true,\n  allowApiInsert: Allow.authenticated,\n  allowApiUpdate: (article) =\u003e article.author == remult.user.id,\n  apiPrefilter: () =\u003e {\n    if (remult.isAllowed('admin')) return {}\n    return {\n      author: remult.user.id,\n    }\n  },\n})\nexport class Article {\n  @Fields.string({ allowApiUpdate: false })\n  slug = ''\n\n  @Fields.string({ allowApiUpdate: false })\n  authorId = remult.user!.id\n\n  @Fields.string()\n  content = ''\n}\n```\n\n### :rocket: Relations\n\n```ts\nawait repo(Categories).find({\n  orderBy: {\n    name: 'asc ',\n  },\n  include: {\n    products: {\n      where: {\n        unitPrice: { $gt: 5 },\n      },\n    },\n  },\n})\n\n// Entity Definitions\nexport class Product {\n  //...\n  @Relations.toOne(Category)\n  category?: Category\n}\nexport class Category {\n  //...\n  @Relations.toMany\u003cCategory, Product\u003e(() =\u003e Product, `category`)\n  products?: Product[]\n}\n```\n\n### Automatic admin UI\n\n![Automatic admin UI](https://raw.githubusercontent.com/remult/remult/main/static/images/admin-ui.gif)\n\nLearn more [here](https://remult.dev/docs/admin-ui).\n\n## What about complex CRUD?\n\nWhile simple CRUD shouldn’t require any backend coding, using Remult means\nhaving the ability to handle any complex scenario by controlling the backend in\nnumerous ways:\n\n- Backend computed (read-only) fields - from simple\n  [expressions](https://remult.dev/docs/ref_field.html#serverexpression) to\n  complex data lookups or even direct db access (SQL)\n- Custom side-effects with\n  [entity lifecycle hooks](https://remult.dev/docs/ref_entity.html#saving)\n  (before/after saving/deleting)\n- Backend only updatable fields (e.g. “last updated at”)\n- [Relations](https://remult.dev/docs/entity-relations.html)\n- Roll-your-own type-safe endpoints with\n  [Backend Methods](https://remult.dev/docs/backendMethods.html)\n- Roll-your-own low-level endpoints (Express, Fastify, koa, others…)\n\n## Installation\n\nThe _remult_ package is one and the same for both the frontend bundle and the\nbackend. Install it once for a monolith project or per-repo in a monorepo.\n\n```sh\nnpm i remult\n```\n\n## Tutorials\n\nThe best way to learn Remult is by following a tutorial of a simple Todo web app\nwith a Node.js Express backend.\n\n- [Tutorial with React](https://remult.dev/tutorials/react/)\n- [Tutorial with Angular](https://remult.dev/tutorials/angular/)\n- [Tutorial with Vue](https://remult.dev/tutorials/vue/)\n- [Tutorial with Next.js](https://remult.dev/tutorials/react-next/)\n- [Tutorial with Sveltekit](https://remult.dev/tutorials/sveltekit/)\n- [Tutorial with SolidStart](https://remult.dev/tutorials/solid-start/)\n\n## Demo\n\n\u003ca href=\"https://www.youtube.com/watch?v=rEoScmSVNUE\" target=\"_blank\"\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/remult/remult/raw/main/static/images/video-thumbnail.jpg\" alt=\"Video thumbnail\"  /\u003e\n  \u003c/p\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://www.youtube.com/watch?v=rEoScmSVNUE\" target=\"_blank\"\u003e\n  \u003cp align=\"center\"\u003eWatch code demo on YouTube here (14 mins)\u003c/p\u003e\n\u003c/a\u003e\n\n## Documentation\n\nThe [documentation](https://remult.dev/docs) covers the main features of Remult.\nHowever, it is still a work-in-progress.\n\n## Example Apps\n\n- Fullstack TodoMVC example with React and Express.\n  ([Source code](https://github.com/remult/TodoMVC-eample) |\n  [CodeSandbox](https://codesandbox.io/s/github/remult/TodoMVC-example?file=/src/frontend/App.tsx))\n\n- [CRM demo](https://github.com/remult/crm-demo) with a React +\n  [MUI](https://mui.com) front-end and Postgres database.\n\n### Status\n\nRemult is **production-ready** and, in fact, used in production apps since 2018.\nHowever, we’re keeping the major version at zero so we can use community\nfeedback to finalize the v1 API.\n\n## Motivation\n\nFull-stack web development is (still) too complicated. **Simple CRUD, a common\nrequirement of any business application, should be simple to build, maintain,\nand extend** when the need arises.\n\nRemult abstracts away repetitive, boilerplate, error-prone, and poorly designed\ncode on the one hand, and enables total flexibility and control on the other.\n**Remult helps building fullstack apps using only TypeScript code you can easily\nfollow and safely refactor**, and fits nicely into any existing or new project\nby being minimalistic and completely unopinionated regarding the developer’s\nchoice of other frameworks and tools.\n\nOther frameworks tend to fall into either too much abstraction (no-code,\nlow-code, BaaS) or partial abstraction (MVC frameworks, GraphQL, ORMs, API\ngenerators, code generators), and tend to be opinionated regarding the\ndevelopment tool-chain, deployment environment, configuration/conventions or\nDSL. Remult attempts to strike a better balance.\n\n## Contributing\n\nContributions are welcome. See [CONTRIBUTING.md](https://github.com/remult/remult/blob/main/CONTRIBUTING.md).\n\n- :speech_balloon: Any feedback or suggestions? Start a\n  [discussion](https://github.com/remult/remult/discussions).\n- :muscle: Want to help out? Look for \"help wanted\" labeled\n  [issues](https://github.com/remult/remult/issues).\n- :star: Give this repo a star.\n\n## License\n\nRemult is [MIT Licensed](LICENSE).\n","funding_links":[],"categories":["TypeScript","Projects by main language","Frameworks","api","API","Built with TypeScript","MVC Frameworks and Libraries"],"sub_categories":["typescript","Samples","Libraries","Runner"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremult%2Fremult","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremult%2Fremult","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremult%2Fremult/lists"}