{"id":32162879,"url":"https://github.com/monadicsystems/okapi","last_synced_at":"2026-02-18T22:01:53.426Z","repository":{"id":42477657,"uuid":"475659092","full_name":"monadicsystems/okapi","owner":"monadicsystems","description":"A data-driven micro web framework for Haskell","archived":false,"fork":false,"pushed_at":"2024-01-11T12:00:25.000Z","size":6411,"stargazers_count":104,"open_issues_count":16,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-25T13:58:28.818Z","etag":null,"topics":["data-driven","haskell","http-server","microframework","web"],"latest_commit_sha":null,"homepage":"https://okapi.wiki","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monadicsystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-03-30T00:07:01.000Z","updated_at":"2025-09-27T12:02:56.000Z","dependencies_parsed_at":"2023-10-15T01:42:26.459Z","dependency_job_id":"ee34cd6e-f251-4bbc-a312-b9f4508eb269","html_url":"https://github.com/monadicsystems/okapi","commit_stats":{"total_commits":184,"total_committers":1,"mean_commits":184.0,"dds":0.0,"last_synced_commit":"ab8c04b0e17d597d88c3ed1057afcc6278c63b1d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/monadicsystems/okapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monadicsystems%2Fokapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monadicsystems%2Fokapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monadicsystems%2Fokapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monadicsystems%2Fokapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monadicsystems","download_url":"https://codeload.github.com/monadicsystems/okapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monadicsystems%2Fokapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["data-driven","haskell","http-server","microframework","web"],"created_at":"2025-10-21T14:02:30.181Z","updated_at":"2026-02-18T22:01:53.421Z","avatar_url":"https://github.com/monadicsystems.png","language":"Haskell","readme":"# 🦓🦒Okapi\n\nOkapi is a data-driven micro framework for implementing HTTP servers.\n\n- Ergonomic DSLs for routing and parsing requests\n- Integrate Okapi with ANY monad stack or effect system\n- Automatically generate clients and OpenAPI specifications (coming soon)\n- Programatically generate your API's structure\n\n## Hello World Example\n\n```haskell\nhelloWorld =\n  responder @200 @'[] @Text.Text @Text.Text\n    . method HTTP.GET id\n    $ \\greet _req -\u003e return $ greet noHeaders \"Hello World!\"\n\nmain =\n  Warp.run 8000\n    . withDefault helloWorld\n    $ \\_ resp -\u003e resp $ Wai.responseLBS HTTP.status404 [] \"Not Found...\"\n```\n\n## Calculator Example\n\n```haskell\ndata Operator\n    = Add\n    | Sub\n    | Mul\n    | Div\n    | Sq\n    | Neg\n    deriving (Show)\n\ninstance Web.FromHttpApiData Operator where\n    parseUrlPiece \"add\" = Right Add\n    parseUrlPiece \"sub\" = Right Sub\n    parseUrlPiece \"minus\" = Right Sub\n    parseUrlPiece \"mul\" = Right Mul\n    parseUrlPiece \"div\" = Right Div\n    parseUrlPiece \"neg\" = Right Neg\n    parseUrlPiece \"sq\" = Right Sq\n    parseUrlPiece \"square\" = Right Sq\n    parseUrlPiece _ = Left \"Can't parse operator...\"\n\nshared =\n  lit \"calc\"\n    . param @Operator\n    . param @Int\n\nunary =\n  responder @200 @'[] @Text.Text @Int\n    . responder @500 @'[] @Text.Text @Text.Text\n    . method HTTP.GET id\n\nunaryHandler operator x ok wrongArgs _req =\n  return $ case operator of\n    Sq  -\u003e ok noHeaders (x * x)\n    Neg -\u003e ok noHeaders (x * (-1))\n    _   -\u003e wrongArgs noHeaders $ Text.pack (show operator) \u003c\u003e \" needs two arguments.\"\n\nbinary =\n  param @Int\n    . responder @200 @'[] @Text.Text @Int\n    . responder @500 @'[] @Text.Text @Text.Text\n    . responder @403 @'[] @Text.Text @Text.Text\n    . method HTTP.GET id\n\nbinaryHandler operator x y ok wrongArgs divByZeroErr _req =\n  return $ case operator of\n    Add -\u003e ok noHeaders (x + y)\n    Sub -\u003e ok noHeaders (x - y)\n    Mul -\u003e ok noHeaders (x * y)\n    Div -\u003e\n      if y == 0\n      then divByZeroErr noHeaders \"You can't divide by 0.\"\n      else ok noHeaders (div x y)\n    _ -\u003e wrongArgs noHeaders $ Text.pack (show operator) \u003c\u003e \" needs one argument.\"\n\ncalc = shared $ choice\n  [ unary unaryHandler\n  , binary binaryHandler\n  ]\n\nmain =\n  Warp.run 8003\n    . withDefault calc\n    $ \\_ resp -\u003e resp $ Wai.responseLBS HTTP.status404 [] \"Not Found...\"\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonadicsystems%2Fokapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonadicsystems%2Fokapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonadicsystems%2Fokapi/lists"}