{"id":22919423,"url":"https://github.com/takapi327/lepusframework","last_synced_at":"2025-05-12T20:13:59.361Z","repository":{"id":38242711,"uuid":"448239432","full_name":"takapi327/lepusframework","owner":"takapi327","description":"Lepus Framework is an asynchronous REST API framework for Scala 3.","archived":false,"fork":false,"pushed_at":"2023-01-09T13:25:41.000Z","size":2766,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T02:53:56.591Z","etag":null,"topics":["cats-effect","dotty","effect-system","framework","functional-programming","http4s","sbt","scala","scala3"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/takapi327.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":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2022-01-15T09:55:47.000Z","updated_at":"2025-01-29T20:28:33.000Z","dependencies_parsed_at":"2023-02-08T12:01:32.928Z","dependency_job_id":null,"html_url":"https://github.com/takapi327/lepusframework","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takapi327%2Flepusframework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takapi327%2Flepusframework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takapi327%2Flepusframework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takapi327%2Flepusframework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takapi327","download_url":"https://codeload.github.com/takapi327/lepusframework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253814988,"owners_count":21968561,"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":["cats-effect","dotty","effect-system","framework","functional-programming","http4s","sbt","scala","scala3"],"created_at":"2024-12-14T07:12:01.910Z","updated_at":"2025-05-12T20:13:59.340Z","avatar_url":"https://github.com/takapi327.png","language":"Scala","readme":"![lepusframework](https://socialify.git.ci/takapi327/lepusframework/image?description=1\u0026font=Inter\u0026language=1\u0026logo=https%3A%2F%2Fuser-images.githubusercontent.com%2F57429437%2F170270360-93f29bbf-aef3-47d7-8910-f5baba490ba6.png\u0026owner=1\u0026pattern=Plus\u0026theme=Light)\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/lepus-v0.7.0-blue\"\u003e\n  \u003ca href=\"https://en.wikipedia.org/wiki/MIT_License\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-MIT-green\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/lampepfl/dotty\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/scala-v3.x-red\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n---\n\nLepus Framework is an asynchronous REST API framework for Scala.\n\nThe Lepus Framework enables schema-driven development.\n\nThe back-end engineer simply writes the routing definition, and the front-end engineer can validate the API without waiting for the back-end process to complete.\nThis is because OpenAPI documents can be generated from routing definitions built with the Lepus Framework and mock servers can be started.\n\n:warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning:\n\nLepus Framework was created to understand the structure of the Play Framework, functional programming using the cats effect, and schema-driven development using tapir.\n\nWe have not checked or verified the operation in a production environment, so please do not use it in a production environment.\n\n:warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning:\n\n## Introduction\n\nLepus Framework was created to understand the structure of the Play Framework, functional programming using the cats effect, and schema-driven development using tapir.\n\nThis framework relies on several libraries (automatically installed by Lepus).\n\n- [cats](https://github.com/typelevel/cats)\n- [cats-effect](https://github.com/typelevel/cats-effect)\n- [http4s](https://github.com/http4s/http4s)\n\n## Documentation\nComing soon...\n\n## Quickstart with sbt\nLepus Framework is not an official, publicly available plugin, but is privately maintained.\n\nTherefore, S3 is used as maven. To use Lepus Framework plugins from s3, the following plugin must be configured under project/project/build.sbt of the project to be used.\n\n:warning: If it is project/build.sbt or plugin.sbt, I can't get the plugin properly and an error occurs. :warning:\n\n※ Once officially released, the following settings will no longer be necessary.\n\nin: project/project/build.sbt\n```sbt\naddSbtPlugin(\"com.frugalmechanic\" % \"fm-sbt-s3-resolver\" % \"0.20.0\")\n```\n\nAdd the following dependencies to plugins.sbt\n\nin: project/plugins.sbt\n```sbt\nThisBuild / resolvers += \"Lepus Maven\" at \"s3://com.github.takapi327.s3-ap-northeast-1.amazonaws.com/lepus/\"\naddSbtPlugin(\"com.github.takapi327\" % \"sbt-plugin\" % \u003cversion\u003e)\n```\n\nLoad the required project with build.sbt\n```sbt\nlazy val root = (project in file(\".\"))\n  .settings(...)\n  .enablePlugins(Lepus)\n```\n\nAfter setting up dependencies, develop with reference to the contents of Example.\n\n## Example\nThe following is the minimum configuration for routing in the Lepus Framework.\n\n### Use of http4s\n```scala\npackage sample\n\nimport cats.effect.IO\n\nimport org.http4s.*\nimport org.http4s.dsl.io.*\nimport org.http4s.server.Router\n\nimport lepus.server.LepusApp\n\nobject HelloApp extends LepusApp[IO]:\n\n  override val routes = Router(\n    \"/\" -\u003e HttpRoutes.of[IO] {\n      case GET -\u003e Root / \"hello\" / name =\u003e Ok(s\"Hello $name\")\n    }\n  ).orNotFound\n```\n\n### Use of Lepus Router\nCurrently, the advantages of using Lepus Router are negligible.\n\nIf Lepus Router is used in the future, we plan to improve it so that it can work with the OpenAPI specification.\n```scala\npackage sample\n\nimport cats.effect.IO\nimport cats.data.NonEmptyList\n\nimport org.http4s.dsl.io.*\n\nimport lepus.router.{ *, given }\nimport lepus.server.LepusApp\n\nobject HelloApp extends LepusApp[IO]:\n\n  override val routes = NonEmptyList.of(\n    \"hello\" / bindPath[String](\"name\") -\u003e\u003e RouterConstructor.of {\n      case GET =\u003e Ok(s\"Hello ${summon[String]}\")\n    }\n  )\n```\n\nYou must set the path of the object that inherits LepusApp in application.conf.\n\n※ We plan to eliminate the need for configuration in the near future.\n```text\nlepus.server.routes = \"sample.HelloApp\"\n```\n\n### Launch applications in the background\n\nRun the application in the background.\n\n```shell\n$ sbt background\n```\n\nTo enable automatic compilation, run the ~background command.\n\n```shell\n$ sbt ~background\n```\n\nTo stop an application started in the background, execute the stop command.\n\n```shell\n$ stop\n```\n\n### Generate OpenAPI documentation\nLoad the required project with build.sbt\n\n```sbt\nlazy val root = (project in file(\".\"))\n  .settings(...)\n  .enablePlugins(LepusSwagger)\n```\n\nAdd the settings for OpenAPI document generation to the routing.\n\n```scala\nimport cats.effect.*\n\nimport io.circe.*\nimport io.circe.generic.semiauto.*\n\nimport org.http4s.Status.*\nimport org.http4s.dsl.io.*\n\nimport lepus.router.{ *, given }\nimport lepus.core.generic.Schema\nimport lepus.core.generic.semiauto.*\n\nimport lepus.server.LepusApp\n\nimport lepus.swagger.*\nimport lepus.swagger.model.OpenApiResponse\n\ncase class Sample(info: String)\nobject Sample:\n  given Encoder[Sample] = deriveEncoder\n  given Schema[Sample]  = deriveSchemer\n\nobject HelloRoute extends OpenApiConstructor[IO, String]:\n\n  override val summary     = Some(\"Sample Paths\")\n  override val description = Some(\"Sample Paths\")\n\n  override def responses = {\n    case GET =\u003e List(\n      OpenApiResponse[Sample](NoContent, List.empty, \"Sample information acquisition\")\n    )\n  }\n\n  override val routes = {\n    case GET =\u003e Ok(s\"Hello ${summon[String]}\")\n  }\n\nobject HelloApp extends LepusApp[IO]:\n\n  override def routes = NonEmptyList.of(\n    \"hello\" / bindPath[String](\"name\") -\u003e\u003e HelloRoute\n  )\n```\n\nAfter running Compile, the generateApi command generates OpenApi documentation.\n\ndocs/OpenApi.yaml is generated directly under the root project.\n\n```shell\n$ sbt compile\n$ sbt generateApi\n```\n\n### Mock server startup\n\nMock servers are started using libraries such as prism.\n\nSettings must be made for each project.\n\nBelow is an example of starting a mock server in Docker using prism.\n\n```yaml\nversion: '3.9'\n\nservices:\n  swagger-editor:\n    image: swaggerapi/swagger-editor\n    container_name: \"swagger-editor\"\n    ports:\n      - 8001:8080\n\n  swagger-ui:\n    image: swaggerapi/swagger-ui\n    container_name: \"swagger-ui\"\n    ports:\n      - 8002:8080\n    volumes:\n      - ./OpenApi.yaml:/usr/share/nginx/html/OpenApi.yaml\n    environment:\n      API_URL: ./OpenApi.yaml\n\n  swagger-api:\n    image: stoplight/prism:3\n    container_name: \"swagger-api\"\n    ports:\n      - 8003:4010\n    command: mock -h 0.0.0.0 /OpenApi.yaml\n    volumes:\n      - ./OpenApi.yaml:/OpenApi.yaml\n```\n\n## Sample Application\nSample applications using Lepus Framework are available in [this](https://github.com/takapi327/lepus-app-template) repository.\n\nFor a more detailed implementation, please refer to the sample application.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakapi327%2Flepusframework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakapi327%2Flepusframework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakapi327%2Flepusframework/lists"}