{"id":13681449,"url":"https://github.com/kowainik/cake-slayer","last_synced_at":"2025-04-30T03:31:28.769Z","repository":{"id":42004460,"uuid":"209720017","full_name":"kowainik/cake-slayer","owner":"kowainik","description":"🍰🔪 Architecture of Haskell backend applications","archived":false,"fork":false,"pushed_at":"2023-01-11T07:12:15.000Z","size":48,"stargazers_count":132,"open_issues_count":7,"forks_count":6,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-11-12T00:36:41.229Z","etag":null,"topics":["architecture","backend","elm","haskell","haskell-backend","web"],"latest_commit_sha":null,"homepage":"https://kowainik.github.io/projects/cake-slayer","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kowainik.png","metadata":{"funding":{"ko_fi":"kowainik","github":["vrom911"]},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2019-09-20T06:24:00.000Z","updated_at":"2024-11-05T11:40:57.000Z","dependencies_parsed_at":"2023-02-09T02:15:57.039Z","dependency_job_id":null,"html_url":"https://github.com/kowainik/cake-slayer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kowainik%2Fcake-slayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kowainik%2Fcake-slayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kowainik%2Fcake-slayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kowainik%2Fcake-slayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kowainik","download_url":"https://codeload.github.com/kowainik/cake-slayer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251635260,"owners_count":21619184,"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":["architecture","backend","elm","haskell","haskell-backend","web"],"created_at":"2024-08-02T13:01:30.886Z","updated_at":"2025-04-30T03:31:28.505Z","avatar_url":"https://github.com/kowainik.png","language":"Haskell","funding_links":["https://ko-fi.com/kowainik","https://github.com/sponsors/vrom911"],"categories":["Haskell"],"sub_categories":[],"readme":"# cake-slayer\n\n![logo](https://user-images.githubusercontent.com/4276606/67370235-fc5cbb00-f582-11e9-9f45-09bf96ee6d0c.png)\n\n[![GitHub CI](https://github.com/kowainik/cake-slayer/workflows/CI/badge.svg)](https://github.com/kowainik/cake-slayer/actions)\n[![Hackage](https://img.shields.io/hackage/v/cake-slayer.svg?logo=haskell)](https://hackage.haskell.org/package/cake-slayer)\n[![Stackage Lts](http://stackage.org/package/cake-slayer/badge/lts)](http://stackage.org/lts/package/cake-slayer)\n[![Stackage Nightly](http://stackage.org/package/cake-slayer/badge/nightly)](http://stackage.org/nightly/package/cake-slayer)\n[![MPL-2.0 license](https://img.shields.io/badge/license-MPL--2.0-blue.svg)](LICENSE)\n\n`cake-slayer` (do not confuse with `cakes-layer`) is a modern and\nbatteries-included framework for creating backend in Haskell for\nweb-applications. It allows you to scaffold working and extensible project in\nminutes.\n\n## Overview\n\nThe main goal of `cake-slayer` is to provide a backbone for your Haskell\nbackend. Unlike many other Haskell libraries, `cake-slayer` doesn't try to be as\nabstract as possible. It includes best-practices and makes some architecture\ndecisions for you. On the one hand, your application should satisfy the\nrequirements for using this framework. On the other hand, it takes care of a lot\nof stuff for you, so you don't need to worry about everyday problems.\n\nA typical backend does the following:\n\n* Communicates with the frontend (web, mobile) via some wire format (JSON,\n  Protocol Buffers, etc.)\n* Talks to the database\n* Authenticates and authorizes users\n* Has some background jobs\n\n`cake-slayer` works exceptionally well if your application uses:\n\n1. PostgreSQL as database.\n2. Elm on the frontend.\n\nThe following Haskell packages have been chosen to provide the necessary\nfunctional:\n\n* [`postgresql-simple`](https://hackage.haskell.org/package/postgresql-simple),\n  [`postgresql-simple-named`](https://hackage.haskell.org/package/postgresql-simple-named),\n  [`postgresql-simple-migration`](https://hackage.haskell.org/package/postgresql-simple-migration)\n  + For connecting and talking to the PostgreSQL database\n* [`servant`](http://hackage.haskell.org/package/servant),\n  [`servant-swagger`](http://hackage.haskell.org/package/servant-swagger),\n  [`swagger2`](http://hackage.haskell.org/package/swagger2)\n  + A family of libraries for defining and documenting Rest API using type-level eDSL\n* [`elm-street`](http://hackage.haskell.org/package/elm-street)\n  + The bridge between Elm and Haskell — generating Elm data types, JSON\n    encoders and decoders from Haskell types automatically\n* [`jwt`](http://hackage.haskell.org/package/jwt)\n  + User authentication via JWT\n* [`bcrypt`](http://hackage.haskell.org/package/bcrypt)\n  + Secure password hashing\n* [`ekg`](http://hackage.haskell.org/package/ekg),\n  [`prometheus-client`](https://hackage.haskell.org/package/prometheus-client)\n  + Application performance monitoring.\n  \u003e **NOTE:** Using `prometheus-client` is optional\n\nBesides `cake-slayer` encourages (but doesn't force) to use the following libraries:\n\n* [`relude`](https://hackage.haskell.org/package/relude)\n  + Alternative standard library\n* [`co-log`](https://hackage.haskell.org/package/co-log)\n  + [Composable contravariant comonadic logging library](https://kowainik.github.io/posts/2018-09-25-co-log)\n\n## How to use?\n\nThe `cake-slayer` framework contains implementations of most common and useful\nfunctions. But at the same time, it provides enough flexibility to specify\napplication-specific parts. To integrate `cake-slayer` smoothly into your\nproject, you should perform the following steps:\n\n1. Define a type of errors your application can throw. See `CakeSlayer.Error`\n   module for details.\n2. Define a monad for your application by specializing the `App` monad from the\n   `CakeSlayer.Monad` module.\n3. Derive or implement all necessary instances for your application monad.\n   `cake-slayer` provides `MonadJwt` and `MonadTimed` effects with sensible\n   default implementations for your convenience.\n\nAnd you're good to go!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkowainik%2Fcake-slayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkowainik%2Fcake-slayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkowainik%2Fcake-slayer/lists"}