{"id":22727001,"url":"https://github.com/zihantype/predawn","last_synced_at":"2025-04-04T14:06:39.157Z","repository":{"id":226046233,"uuid":"767628168","full_name":"ZihanType/predawn","owner":"ZihanType","description":"Predawn is a Rust web framework like Spring Boot -- Predawn 是一个类似 Spring Boot 的 Rust web 框架","archived":false,"fork":false,"pushed_at":"2024-10-23T01:39:48.000Z","size":528,"stargazers_count":77,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-25T04:29:57.450Z","etag":null,"topics":["framework","rust","spring-boot","web"],"latest_commit_sha":null,"homepage":"","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/ZihanType.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"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}},"created_at":"2024-03-05T16:28:47.000Z","updated_at":"2024-10-23T01:39:52.000Z","dependencies_parsed_at":"2024-03-11T16:53:41.943Z","dependency_job_id":"75bb9299-c78e-4923-af18-02d4081a38c1","html_url":"https://github.com/ZihanType/predawn","commit_stats":null,"previous_names":["zihantype/predawn"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZihanType%2Fpredawn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZihanType%2Fpredawn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZihanType%2Fpredawn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZihanType%2Fpredawn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZihanType","download_url":"https://codeload.github.com/ZihanType/predawn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190250,"owners_count":20898702,"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":["framework","rust","spring-boot","web"],"created_at":"2024-12-10T17:08:17.443Z","updated_at":"2025-04-04T14:06:39.138Z","avatar_url":"https://github.com/ZihanType.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Predawn\n\n[![Crates.io version](https://img.shields.io/crates/v/predawn.svg?style=flat-square)](https://crates.io/crates/predawn)\n[![docs.rs docs](https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square)](https://docs.rs/predawn)\n\n`predawn` is a Rust web framework like `Spring Boot`.\n\n```rust\nuse predawn::{\n    app::{run_app, Hooks},\n    controller,\n};\nuse rudi::Singleton;\n\nstruct App;\n\nimpl Hooks for App {}\n\n#[tokio::main]\nasync fn main() {\n    run_app::\u003cApp\u003e().await;\n}\n\n#[derive(Clone)]\n#[Singleton]\nstruct Controller;\n\n#[controller]\nimpl Controller {\n    #[endpoint(paths = [\"/\"], methods = [post])]\n    async fn hello(\u0026self, name: String) -\u003e String {\n        format!(\"Hello {name}\")\n    }\n}\n```\n\n## Features\n\n- Built-in OpenAPI support.\n- Automatic dependency injection.\n- Programmable configuration.\n\nMore examples can be found in the [examples](./examples/) directories.\n\n## More complex example\n\n```rust\nuse std::sync::Arc;\n\nuse async_trait::async_trait;\nuse predawn::{\n    app::{run_app, Hooks},\n    controller,\n};\nuse rudi::Singleton;\n\nstruct App;\n\nimpl Hooks for App {}\n\n#[tokio::main]\nasync fn main() {\n    run_app::\u003cApp\u003e().await;\n}\n\n#[async_trait]\ntrait Service: Send + Sync {\n    fn arc(self) -\u003e Arc\u003cdyn Service\u003e\n    where\n        Self: Sized + 'static,\n    {\n        Arc::new(self)\n    }\n\n    async fn hello(\u0026self) -\u003e String;\n}\n\n#[derive(Clone)]\n#[Singleton(binds = [Service::arc])]\nstruct ServiceImpl;\n\n#[async_trait]\nimpl Service for ServiceImpl {\n    async fn hello(\u0026self) -\u003e String {\n        \"Hello, World!\".to_string()\n    }\n}\n\n#[derive(Clone)]\n#[Singleton]\nstruct Controller {\n    svc: Arc\u003cdyn Service\u003e,\n}\n\n#[controller]\nimpl Controller {\n    #[endpoint(paths = [\"/\"], methods = [GET])]\n    async fn hello(\u0026self) -\u003e String {\n        self.svc.hello().await\n    }\n}\n```\n\n## Credits\n\n- [axum](https://github.com/tokio-rs/axum)\n- [poem](https://github.com/poem-web/poem)\n- [loco](https://github.com/loco-rs/loco)\n- [volo-http](https://github.com/cloudwego/volo)\n- [salvo](https://github.com/salvo-rs/salvo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzihantype%2Fpredawn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzihantype%2Fpredawn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzihantype%2Fpredawn/lists"}