A simple and modular Task Tracker API built using Rust and Axum. This project demonstrates how to create a RESTful API with in-memory state management and support for basic CRUD operations.
- ✅ Health Check (
GET /health) - 📄 Get All Tasks (
GET /tasks) - 🔍 Get Task by ID (
GET /tasks/:id) - 🆕 Create Task (
POST /tasks) - 📝 Update Task (
PUT /tasks/:id) - ❌ Delete Task (
DELETE /tasks/:id) - 🔄 Toggle Completion Status (
PATCH /tasks/:id/toggle)
- Language: Rust
- Framework: Axum
- State Management:
Arc<Mutex<Vec<Task>>> - UUID Support:
uuidcrate - Serialization:
serde
git clone https://github.com/yourusername/task_tracker_api.git
cd task_tracker_apiMake sure you have Rust installed: https://rustup.rs
Then run:
cargo buildcargo runVisit: http://localhost:3000
GET /healthGET /tasksGET /tasks/{id}POST /tasks
Content-Type: application/json
{
"title": "Learn Axum"
}PUT /tasks/{id}
Content-Type: application/json
{
"id": "UUID_HERE",
"title": "Updated Title",
"completed": true
}DELETE /tasks/{id}PATCH /tasks/{id}/togglesrc/
├── main.rs # App entrypoint & router setup
├── handlers.rs # Route handler logic
├── models.rs # Task structs & types
└── state.rs # Shared application state