{"id":48147551,"url":"https://github.com/kavinda-100/rust_simple_web_app","last_synced_at":"2026-04-04T17:01:44.878Z","repository":{"id":306393041,"uuid":"1026020151","full_name":"kavinda-100/rust_simple_web_app","owner":"kavinda-100","description":"A simple REST API built with Rust and the Axum web framework for learning purposes. This project demonstrates basic CRUD operations for vehicle management without database integration.","archived":false,"fork":false,"pushed_at":"2025-07-25T08:49:00.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-25T13:10:03.449Z","etag":null,"topics":["axum","backend-api","cargo","rest-api","rust"],"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/kavinda-100.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,"zenodo":null}},"created_at":"2025-07-25T07:19:03.000Z","updated_at":"2025-07-25T08:49:04.000Z","dependencies_parsed_at":"2025-07-25T13:11:09.199Z","dependency_job_id":null,"html_url":"https://github.com/kavinda-100/rust_simple_web_app","commit_stats":null,"previous_names":["kavinda-100/rust_simple_web_app"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/kavinda-100/rust_simple_web_app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinda-100%2Frust_simple_web_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinda-100%2Frust_simple_web_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinda-100%2Frust_simple_web_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinda-100%2Frust_simple_web_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kavinda-100","download_url":"https://codeload.github.com/kavinda-100/rust_simple_web_app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinda-100%2Frust_simple_web_app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31407391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: 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":["axum","backend-api","cargo","rest-api","rust"],"created_at":"2026-04-04T17:01:43.182Z","updated_at":"2026-04-04T17:01:44.462Z","avatar_url":"https://github.com/kavinda-100.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚗 Rust Simple Web App - Vehicle REST API\n\n![Rust](https://img.shields.io/badge/rust-%23000000.svg?style=for-the-badge\u0026logo=rust\u0026logoColor=white)\n![Axum](https://img.shields.io/badge/axum-ff6600?style=for-the-badge\u0026logo=rust\u0026logoColor=white)\n![REST API](https://img.shields.io/badge/REST-API-blue?style=for-the-badge)\n![Learning](https://img.shields.io/badge/Purpose-Learning-green?style=for-the-badge)\n\nA simple REST API built with **Rust** and the **Axum** web framework for learning purposes. This project demonstrates basic CRUD operations for vehicle management without database integration.\n\n## 🎯 Project Goals\n\n- 📚 Learn Rust programming language fundamentals\n- 🌐 Understand REST API development with Axum\n- 🔧 Practice CRUD operations (Create, Read, Update, Delete)\n- 🚀 Build a foundation for future Rust web development\n\n## ✨ Features\n\n- ✅ **GET** - Retrieve all vehicles or specific vehicle by ID\n- ✅ **POST** - Create new vehicles with auto-generated UUIDs\n- ✅ **PUT** - Update existing vehicles\n- ✅ **DELETE** - Remove vehicles by ID\n- ✅ **Query Parameters** - Search vehicles with custom filters\n- ✅ **JSON Response** - All endpoints return JSON data\n- ✅ **HTTP Status Codes** - Proper status codes (200, 201, 204, etc.)\n\n## 🛠️ Tech Stack\n\n- **Language**: Rust 🦀\n- **Web Framework**: Axum\n- **Serialization**: Serde (JSON)\n- **Async Runtime**: Tokio\n- **UUID Generation**: uuid crate\n- **HTTP Client Testing**: REST Client files\n\n## 📊 API Endpoints\n\n| Method | Endpoint | Description | Status Code |\n|--------|----------|-------------|-------------|\n| `GET` | `/` | Welcome message | 200 |\n| `GET` | `/vehicle/all` | Get all vehicles | 200 |\n| `GET` | `/vehicle/{id}` | Get vehicle by ID | 200 |\n| `GET` | `/vehicle/query?params` | Search vehicles | 200 |\n| `POST` | `/vehicle` | Create new vehicle | 201 |\n| `PUT` | `/vehicle/{id}` | Update vehicle | 200 |\n| `DELETE` | `/vehicle/{id}` | Delete vehicle | 204 |\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- [Rust](https://rustup.rs/) (latest stable version)\n- [Cargo](https://doc.rust-lang.org/cargo/) (comes with Rust)\n\n### Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/kavinda-100/rust_simple_web_app.git\n   cd rust_simple_web_app\n   ```\n\n2. **Install dependencies**\n   ```bash\n   cargo build\n   ```\n\n3. **Run the server**\n   ```bash\n   cargo run\n   ```\n\n4. **Server will start on**\n   ```\n   🌐 http://localhost:5000\n   ```\n\n## 📝 Usage Examples\n\n### Using the HTTP File\n\nThe project includes a `AxumWithRust.http` file for easy API testing. Open it in VS Code with the REST Client extension or any compatible IDE.\n\n### Sample Requests\n\n#### Create a Vehicle\n```http\nPOST http://localhost:5000/vehicle\nContent-Type: application/json\n\n{\n  \"manufacturer\": \"Toyota\",\n  \"name\": \"Camry\",\n  \"model\": \"Camry\",\n  \"year\": 2023\n}\n```\n\n#### Get All Vehicles\n```http\nGET http://localhost:5000/vehicle/all\n```\n\n#### Search Vehicles\n```http\nGET http://localhost:5000/vehicle/query?manufacturer=Toyota\u0026year=2023\n```\n\n#### Update Vehicle\n```http\nPUT http://localhost:5000/vehicle/1\nContent-Type: application/json\n\n{\n  \"manufacturer\": \"Honda\",\n  \"name\": \"Civic\",\n  \"model\": \"Civic\",\n  \"year\": 2024\n}\n```\n\n#### Delete Vehicle\n```http\nDELETE http://localhost:5000/vehicle/1\n```\n\n## 📁 Project Structure\n\n```\nrust_simple_web_app/\n├── 📄 Cargo.toml          # Project dependencies\n├── 📄 README.md           # Project documentation\n├── 🧪 AxumWithRust.http   # HTTP test requests\n├── 📂 src/\n│   ├── 📄 main.rs         # Application entry point \u0026 routes\n│   └── 📄 vehicle.rs      # Vehicle handlers \u0026 data structures\n└── 📂 target/             # Compiled artifacts\n```\n\n## 🔧 Dependencies\n\n```toml\n[dependencies]\naxum = \"0.7\"\nserde = { version = \"1.0\", features = [\"derive\"] }\nserde_json = \"1.0\"\ntokio = { version = \"1.0\", features = [\"full\"] }\nuuid = { version = \"1.0\", features = [\"v4\"] }\n```\n\n## 📚 Learning Objectives Covered\n\n- ✅ **Rust Syntax**: Structs, enums, pattern matching, ownership\n- ✅ **Async Programming**: Understanding `async/await` with Tokio\n- ✅ **Web Development**: HTTP methods, status codes, JSON handling\n- ✅ **Error Handling**: Result types and proper error responses\n- ✅ **Code Organization**: Module system and separation of concerns\n- ✅ **Testing**: HTTP file-based API testing\n\n## 📄 License\n\nThis project is available for learning purposes.\n\n## Author\n- [Kavinda Rathnayake](https://github.com/kavinda-100)\n\n## 🙏 Acknowledgments\n\n- 🦀 [Rust Community](https://www.rust-lang.org/)\n- ⚡ [Axum Framework](https://github.com/tokio-rs/axum)\n- 📚 [Rust Book](https://doc.rust-lang.org/book/)\n- 🌐 [Tokio Async Runtime](https://tokio.rs/)\n\n---\n\n**Happy Learning with Rust! 🦀✨**\n\n\u003e *\"The best way to learn is by building. Start simple, iterate, and grow.\"*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkavinda-100%2Frust_simple_web_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkavinda-100%2Frust_simple_web_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkavinda-100%2Frust_simple_web_app/lists"}