# {{PROJECT_NAME}}

A production-ready Rust web application built with [Kegani](https://github.com/yourname/kegani).

## Project Structure

```
{{PROJECT_NAME}}/
├── manifest/config/          # Application configuration (dev/prod/test variants)
├── internal/                  # Private layered code
│   ├── model/               # Domain entities
│   ├── dto/                 # Request/Response DTOs
│   ├── repository/          # Data access (sqlx)
│   ├── logic/               # Business logic
│   └── service/             # Service layer with DI
├── resource/openapi/        # OpenAPI spec files
├── protocol/                # Protocol definitions (gRPC, etc.)
├── migrations/              # Database migrations
├── src/                     # Public HTTP layer
│   ├── controller/          # HTTP handlers
│   ├── routes/              # Route registration
│   └── middleware/          # Custom middleware
└── tests/                   # Integration tests
```

## Getting Started

### Prerequisites

- Rust 1.75+
- PostgreSQL 14+
- Redis 7+

### Setup

```bash
# Copy and configure environment
cp .env.example .env
# Edit .env with your database credentials

# Run database migrations
sqlx migrate run

# Start the server
cargo run
```

Visit http://127.0.0.1:8080

### API Documentation

- Swagger UI: http://127.0.0.1:8080/swagger-ui
- ReDoc: http://127.0.0.1:8080/redoc
- OpenAPI JSON: http://127.0.0.1:8080/api-docs/openapi.json

## CLI Commands

This project was created with `keg`. Available commands:

```bash
keg gen api <name>     # Generate full CRUD stack
keg gen model <name>   # Generate entity
keg gen service <name> # Generate service layer
keg gen migration <name> # Generate migration
keg run                # Run with hot reload
keg build              # Build release binary
keg docker             # Generate Dockerfile
```

## Architecture

```
HTTP Request
    ↓
Controller    ← src/controller/
    ↓
Service       ← internal/service/
    ↓
Logic         ← internal/logic/
    ↓
Repository    ← internal/repository/ (sqlx)
    ↓
Database      ← PostgreSQL
```

## License

MIT OR Apache-2.0