{"id":13469390,"url":"https://github.com/chiselstrike/chiselstrike","last_synced_at":"2025-05-15T14:05:24.610Z","repository":{"id":36951455,"uuid":"406336675","full_name":"chiselstrike/chiselstrike","owner":"chiselstrike","description":"ChiselStrike abstracts common backends components like databases and message queues, and let you drive them from a convenient TypeScript business logic layer","archived":false,"fork":false,"pushed_at":"2023-04-10T21:15:28.000Z","size":12873,"stargazers_count":1088,"open_issues_count":217,"forks_count":38,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-05-09T15:52:32.600Z","etag":null,"topics":["backend","framework","javascript","runtime","rust","typescript"],"latest_commit_sha":null,"homepage":"https://chiselstrike.com","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chiselstrike.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-09-14T11:19:47.000Z","updated_at":"2025-04-28T20:43:39.000Z","dependencies_parsed_at":"2024-01-16T15:41:33.016Z","dependency_job_id":"e228a148-ca0e-48ed-b759-e2e2816fc3fd","html_url":"https://github.com/chiselstrike/chiselstrike","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiselstrike%2Fchiselstrike","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiselstrike%2Fchiselstrike/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiselstrike%2Fchiselstrike/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiselstrike%2Fchiselstrike/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chiselstrike","download_url":"https://codeload.github.com/chiselstrike/chiselstrike/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355334,"owners_count":22057354,"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":["backend","framework","javascript","runtime","rust","typescript"],"created_at":"2024-07-31T15:01:37.254Z","updated_at":"2025-05-15T14:05:19.602Z","avatar_url":"https://github.com/chiselstrike.png","language":"Rust","readme":"![banner](imgs/logo.png)\n\n---\n\n[![Build Status](https://github.com/chiselstrike/chiselstrike/workflows/Rust/badge.svg?event=push\u0026branch=main)](https://github.com/chiselstrike/chiselstrike/actions)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue)](https://github.com/chiselstrike/chiselstrike/blob/master/LICENSE)\n[![Discord](https://img.shields.io/discord/933071162680958986?color=5865F2\u0026label=discord\u0026logo=discord\u0026logoColor=8a9095)](https://discord.gg/GHNN9CNAZe)\n[![Twitter](https://img.shields.io/twitter/follow/chiselstrike?style=plastic)](https://twitter.com/chiselstrike)\n\n## What is ChiselStrike?\n\nChiselStrike is a complete backend bundled in one piece. Your one stop-shop for all\nyour backend needs, powered by TypeScript.\n\n## Why ChiselStrike?\n\nPutting together a backend is hard work. Databases? ORM? Business logic? Data\naccess policies? And how to offer all of that through an API?\n\nLearning all that, plus figuring out the interactions between all the\ncomponents can be a drain on an application developer's time. Low-code\nbased approaches allow for super fast prototypes, but as you need to scale and\nevolve, the time you saved on the prototype is now owed with interest in refactorings,\nmigrations, etc.\n\nChiselStrike provides everything you need to handle and evolve your backend,\nfrom the data layer to the business logic, allowing you to focus on what you\ncare about – your code, rather than worrying about databases schemas,\nmigrations, or even database operations.\n\nAll driven by TypeScript, so your backend can evolve as your code evolves.\n\n## How does that work?\n\nChiselStrike keeps things as close as possible to pure TypeScript, and a\n[translation\nlayer](https://blog.chiselstrike.com/my-other-database-is-a-compiler-10fd527a4d78)\ntakes care of index creation, database query generation, and even communicating\nwith external systems like Kafka.\n\nInternally, ChiselStrike uses a SQLite database so there's no need to set up\nany external data layer (although it is possible to hook up an external\nPostgres-compatible database).  ChiselStrike also abstract other concepts\ncommon to complex backends, like\n[Kafka-compatible](https://blog.chiselstrike.com/dear-application-developer-how-far-can-you-really-go-without-a-message-queue-d9e5385fab64)\nstreaming platforms.\n\n![](imgs/diagram.png)\n\n## Quick start\n\nTo get a CRUD API working in 30 seconds or less, first create a new project:\n\n```console\nnpx -y create-chiselstrike-app@latest my-app\ncd my-app\n```\n\nAdd a model by writing the following TypeScript code to `models/BlogComment.ts`:\n\n```typescript\nimport { ChiselEntity } from \"@chiselstrike/api\"\n\nexport class BlogComment extends ChiselEntity {\n    content: string = \"\";\n    by: string = \"\";\n}\n```\n\nAdd a route by writing the following TypeScript code to `routes/comments.ts`:\n\n```typescript\nimport { BlogComment } from \"../models/BlogComment\";\nexport default BlogComment.crud();\n```\n\nStart the development server with:\n\n```console\nnpm run dev\n```\n\nThis server will provide a CRUD API that you can use to add and query instances\nof the BlogComment entity.\n\n```console\ncurl -X POST -d '{\"content\": \"First comment\", \"by\": \"Jill\"}' localhost:8080/dev/comments\n\ncurl localhost:8080/dev/comments\n```\n\nFor a more detailed tutorial about how to get started with ChiselStrike, follow\nour [Getting started tutorial](https://cs.docs.chiselstrike.com/tutorials/getting-started/).\n\n### Is ChiselStrike a database?\n\nNo. The [founding team at ChiselStrike](https://chiselstrike.com/about-us) have written databases from scratch before and\nwe believe there are better things to do in life, like pretty much anything else. ChiselStrike comes bundled with SQLite,\nproviding developers with a zero-conf *relational-like abstraction* that allows one to think of backends\nfrom the business needs down, instead of from the database up.\n\nInstead, you can think of ChiselStrike as a big pool of global shared memory.\nThe data access API is an integral part of ChiselStrike and offers developers a way to just code, without\nworrying about the underlying database (anymore than you worry about what happens in each level of the memory hierarchy,\nmeaning some people do, but most people don't have to!).\n\nIn production, ChiselStrike can also hook up into a\n[Kafka-compatible](https://blog.chiselstrike.com/dear-application-developer-how-far-can-you-really-go-without-a-message-queue-d9e5385fab64)\nstreaming platform when available, and transparently drive both that and the database from a unified TypeScript/JavaScript abstraction.\n\n### Is ChiselStrike an ORM?\n\nKind of. ChiselStrike has some aspects that overlap with traditional ORMs, in that it allows you to access database abstractions\nin your programming language. However, in traditional ORMs you start from the database, and export it up. Changes\nare done to the database schema, which is then bubbled up through *migrations*, and elements of the database invariably leak\nto the API.\n\nChiselStrike, on the other hand, starts from your code and automates the decisions needed to implement that into the database, much\nlike what a [compiler](https://blog.chiselstrike.com/my-other-database-is-a-compiler-10fd527a4d78) would do.\n\nLet's look at [ChiselStrike's documentation](https://cs.docs.chiselstrike.com/Intro/first) for an example of what's needed to create a comment on a blog post:\n\n```typescript\nimport { ChiselEntity } from \"@chiselstrike/api\"\n\nexport class BlogComment extends ChiselEntity {\n    content: string = \"\";\n    by: string = \"\";\n}\n```\n\nThe first thing you will notice is that there is no need to specify how those things map to the underlying database. No tracking\nof primary keys, column types, etc.\n\nNow imagine you need to start tracking whether this was created by a human or a bot. You can change your model\nto say:\n\n```typescript\nimport { ChiselEntity } from \"@chiselstrike/api\"\n\nexport class BlogComment extends ChiselEntity {\n    content: string = \"\";\n    by: string = \"\";\n    isHuman: boolean = false;\n}\n```\n\nand that's it! There are no migrations and no need to alter a table.\n\nFurthermore, if you need to find all blog posts written by humans, you\ncan just write a lambda instead of trying to craft a database query in TypeScript:\n\n```typescript\nconst all = await BlogComment.findMany(p =\u003e p.isHuman);\n```\n\n### Is ChiselStrike a TypeScript runtime?\n\nChiselStrike includes a TypeScript runtime - the fantastic and beloved [Deno](https://github.com/denoland/deno). That's the last piece of the puzzle\nwith the data API and the database bundles. That allows you to develop everything locally from your laptop and integrate\nwith your favorite frontend framework. Be it Next.js, Gatsby, Remix, or any others - we're cool with all of them!\n\n### That's all fine and all, but I need more than that!\n\nWe hear you. No modern application is complete without authentication and security. ChiselStrike integrates with [next-auth](https://next-auth.js.org/)\nand allows you to specify authentication entities directly from your TypeScript models.\n\nYou can then add a policy file that details which fields can be accessed, and which endpoints are available.\n\nFor example, you can store the blog authors as part of the models,\n\n```typescript\nimport { ChiselEntity, AuthUser } from \"@chiselstrike/api\"\n\nexport class BlogComment extends ChiselEntity {\n    content: string = \"\";\n    @labels(\"protect\") author: AuthUser;\n}\n```\n\nand then write a policy saying that the users should only be able to see the posts that they themselves\noriginated:\n\n```yaml\nlabels:\n  - name: protect\n    transform: match_login\n```\n\nNow your security policies are declaratively applied separately from the code, and you can easily grasp what's\ngoing on.\n\n## In Summary\n\nChiselStrike provides everything you need to handle your backend, from the data layer to the business logic, wrapped in powerful abstractions that let you just code and not worry about handling databases schemas, migrations, and operations again.\n\nIt allows you to declaratively specify compliance policies around who can access the data and under which circumstances.\n\nYour ChiselStrike files can go into their own repo, or even better, into a subdirectory of your existing frontend repo. You can code your presentation and data layer together, and turn any frontend framework into a full-stack (including the database layer!) framework in minutes.\n\n## Contributing\n\nTo build and develop from source:\n\n```console\ngit submodule update --init --recursive\ncargo build\n```\n\nThat will build the `chiseld` server and `chisel` utility.\n\nYou can now use `create-chiselstrike-app` to install a local version of the API:\n```console\nnode ./packages/create-chiselstrike-app --chisel-version=\"file:../packages/chiselstrike-api\" my-backend\n```\n\nAnd then replace instances of `npm run` with direct calls to the new binaries. For example, instead of\n`npm run dev`, run\n\n```console\ncd my-backend\nnpm i esbuild\n../target/debug/chisel dev\n```\n\nAlso, consider:\n\n[Open (or fix!) an issue](https://github.com/chiselstrike/chiselstrike/issues) 🙇‍♂️\n\n[Join our discord community](https://discord.gg/GHNN9CNAZe) 🤩\n\n[Start a discussion](https://github.com/chiselstrike/chiselstrike/discussions/) 🙋‍♀️\n\n\n## Next steps?\n\nOur documentation (including a quick tutorial) is available at [here](https://cs.docs.chiselstrike.com)\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchiselstrike%2Fchiselstrike","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchiselstrike%2Fchiselstrike","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchiselstrike%2Fchiselstrike/lists"}