Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ cargo build --workspace --release

### Running Examples

In-repo examples live under `crates/rustapi-rs/examples/`. Start with the golden path (see [docs/GOLDEN_PATH.md](docs/GOLDEN_PATH.md)):

```bash
# Run a specific example
cargo run -p hello-world
# First run — handler → OpenAPI → probes
cargo run -p rustapi-rs --example golden_path

# List all examples
ls examples/
# List in-repo examples
ls crates/rustapi-rs/examples/
```

## Making Changes
Expand Down Expand Up @@ -398,6 +400,7 @@ Closes #456
RustAPI/
├── crates/
│ ├── rustapi-rs/ # 🎯 Public-facing crate (re-exports)
│ │ └── examples/ # 📖 In-crate examples (start with golden_path)
│ ├── rustapi-core/ # ⚙️ Core HTTP engine and routing
│ ├── rustapi-macros/ # 🔧 Procedural macros (#[get], #[post], etc.)
│ ├── rustapi-validate/ # ✅ Validation integration (validator crate)
Expand All @@ -406,18 +409,12 @@ RustAPI/
│ ├── rustapi-toon/ # 🎨 TOON format support
│ ├── rustapi-ws/ # 🔌 WebSocket support
│ ├── rustapi-view/ # 🖼️ Template rendering (Tera)
│ ├── rustapi-testing/ # 🧪 Test client and fluent assertions
│ ├── rustapi-grpc/ # 📡 gRPC helpers (Tonic)
│ ├── rustapi-mcp/ # 🤖 Native MCP (expose routes as LLM tools)
│ └── cargo-rustapi/ # 📦 CLI tool
├── examples/ # 📖 Example applications
│ ├── hello-world/ # Basic example
│ ├── crud-api/ # CRUD operations
│ ├── auth-api/ # Authentication
│ ├── sqlx-crud/ # Database integration
│ ├── websocket/ # WebSocket example
│ └── ...
├── benches/ # 🏃 Performance benchmarks
├── docs/ # 📝 Documentation
├── scripts/ # 🛠️ Build and publish scripts
└── memories/ # 🧠 Project memory/context
└── scripts/ # 🛠️ Build and publish scripts
```

### Crate Dependencies
Expand All @@ -441,7 +438,7 @@ rustapi-rs (public API)
- **Adding validation** → `rustapi-validate`
- **Adding OpenAPI features** → `rustapi-openapi`
- **Adding optional features** → `rustapi-extras`
- **Adding examples** → `examples/`
- **Adding examples** → `crates/rustapi-rs/examples/`
- **Adding tests** → relevant crate's `tests/` directory
- **Adding docs** → `docs/` or inline rustdoc

Expand Down
38 changes: 5 additions & 33 deletions crates/rustapi-rs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,50 +44,22 @@ Feature taxonomy on the facade:

## 📦 Quick Start

**Önerilen kullanım** (en temiz ve kısa makro isimleri için):

```toml
[dependencies]
api = { package = "rustapi-rs", version = "0.2.0" }
```

Sonra kodunda:

```rust
use api::prelude::*;

#[api::get("/hello")]
async fn hello() -> &'static str {
"Hello from RustAPI!"
}

#[api::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
api::RustApi::auto().run("127.0.0.1:8080").await
}
```

Eğer istersen direkt uzun isimle de kullanabilirsin:
Add `rustapi-rs` to your `Cargo.toml`:

```toml
[dependencies]
rustapi-rs = "0.2.0"
```

```rust
use rustapi_rs::prelude::*;

#[rustapi_rs::get("/hello")]
...
```

Add `rustapi-rs` to your `Cargo.toml` (kısa isim için alias önerilir):
You can also rename the crate if you prefer shorter macro paths:

```toml
[dependencies]
rustapi-rs = { version = "0.1", features = ["full"] }
api = { package = "rustapi-rs", version = "0.2.0" }
```

Route macros work through that alias (`#[api::get("/")]`, `use api::prelude::*`).

### The "Hello World"

```rust
Expand Down
Loading