{"id":20503212,"url":"https://github.com/fu-ry17/rust-axum-api","last_synced_at":"2026-05-29T06:31:08.728Z","repository":{"id":186409198,"uuid":"675127830","full_name":"fu-ry17/rust-axum-api","owner":"fu-ry17","description":"rust axum api - using postgreql and sqlx","archived":false,"fork":false,"pushed_at":"2023-08-06T21:11:21.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T20:38:55.234Z","etag":null,"topics":["axum","rust","sqlx","sqlx-cli","tokio"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fu-ry17.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-05T21:53:51.000Z","updated_at":"2023-08-06T09:21:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"5c281258-feae-453f-8440-1dfd817d87fd","html_url":"https://github.com/fu-ry17/rust-axum-api","commit_stats":null,"previous_names":["fu-ry17/rust-axum-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fu-ry17/rust-axum-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fu-ry17%2Frust-axum-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fu-ry17%2Frust-axum-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fu-ry17%2Frust-axum-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fu-ry17%2Frust-axum-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fu-ry17","download_url":"https://codeload.github.com/fu-ry17/rust-axum-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fu-ry17%2Frust-axum-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33640627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["axum","rust","sqlx","sqlx-cli","tokio"],"created_at":"2024-11-15T19:29:43.184Z","updated_at":"2026-05-29T06:31:08.707Z","avatar_url":"https://github.com/fu-ry17.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust API with Axum\n\nA simple Rust API using the Axum framework to manage a collection of blogs. The API allows you to perform basic CRUD operations on the blogs.\n\n## Endpoints\n\n- `GET /`: Get the root endpoint.\n- `GET /blog`: Get all blogs.\n- `POST /blog`: Create a new blog.\n- `DELETE /blog/:id`: Delete a blog by ID.\n- `PATCH /blog/:id`: Update a blog by ID.\n\n## Prerequisites\n\n- Rust: Ensure you have Rust and Cargo installed. You can install it from [https://www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install).\n- PostgreSQL: Make sure you have PostgreSQL installed and running.\n\n## Installation\n\n1. Clone the repository.\n\n```bash\ngit clone https://github.com/fu-ry17/rust-axum-api.git\ncd rust-axum-api\n```\n\n2. Create a `.env` file and add your PostgreSQL database connection string.\n\n```plaintext\nDATABASE_URL=postgres://username:password@localhost/your_database_name\n```\n\n3. Build and run the API.\n\n```bash\ncargo run\n```\n\n## Usage\n\n### `GET /`\n\nGet the root endpoint.\n\n### `GET /blog`\n\nGet all blogs.\n\n### `POST /blog`\n\nCreate a new blog.\n\n**Request Body**\n\n```json\n{\n  \"title\": \"Your Blog Title\",\n  \"description\": \"Your Blog Description\"\n}\n```\n\n### `DELETE /blog/:id`\n\nDelete a blog by ID.\n\n### `PATCH /blog/:id`\n\nUpdate a blog by ID.\n\n**Request Body**\n\n```json\n{\n  \"title\": \"Updated Blog Title\",\n  \"description\": \"Updated Blog Description\"\n}\n```\n\n## Data Structures\n\n### Blog\n\nA blog entity with the following fields:\n\n- `id`: An integer representing the blog's unique identifier.\n- `title`: A string representing the blog's title.\n- `description`: A string representing the blog's description.\n- `created_at`: A chrono::NaiveDateTime representing the blog's creation date.\n- `updated_at`: A chrono::NaiveDateTime representing the blog's last update date.\n\n### CreateBlog\n\nA data structure used for creating a new blog with the following fields:\n\n- `title`: A string representing the blog's title.\n- `description`: A string representing the blog's description.\n\n### BlogId\n\nA data structure used to extract the blog ID from the URL path.\n\n## Contributing\n\nContributions are welcome! If you find any issues or want to add new features, feel free to open a pull request.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## Contact\n\nFor any questions or feedback, please reach out to:\n\n- Email: furybrian175@gmail.com\n- Project Repository: [https://github.com/fu-ry17/rust-axum-api](https://github.com/fu-ry17/rust-axum-api)\n\n---\n\nHappy coding!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffu-ry17%2Frust-axum-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffu-ry17%2Frust-axum-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffu-ry17%2Frust-axum-api/lists"}