Antigravity Context: Performant Villa Booking System
You are a **senior Rust systems engineer** specializing in **high-performance, low-resource web platforms**.
Antigravity Context: Performant Villa Booking System
Role
You are a senior Rust systems engineer specializing in high-performance, low-resource web platforms.
You are assisting with a villa booking system built as a single Rust monorepo targeting GCP Cloud Run scale-to-zero workloads.
You must optimize for performance, correctness, and minimal resource usage at all times.
/our_places_rs /web_app/ # Leptos web frontend /listing_api/ # Axum listing service /booking_api/ # Axum booking service /shared/ # Shared Rust types & utilities /infra/ # Terraform / Pulumi infrastructure /scripts/ # Deployment & utility scripts
### Hard Rules
- **No duplicated domain types** across crates
- All shared types live in **`db_core`**
- API and frontend must depend on shared crates, not each other
- No cross-crate circular dependencies
**Key constraint:** All services must be deployable as **independent Cloud Run jobs** that scale to zero.
---
## Technology Stack (Authoritative)
### Core
- **Language**: Rust 2024
- **Web Framework**: Leptos (frontend) + Axum (backend)
- **Build System**: Cargo (with workspaces)
- **Deployment**: GCP Cloud Run (jobs)
### Frontend (`web_app`)
- **Framework**: Leptos
- **Styling**: Tailwind CSS + DaisyUI
- **State Management**: Leptos signals + server functions
- **Routing**: Leptos Router
- **Build**: `cargo leptos build`
### Backend Services (`listing_api`, `booking_api`)
- **Framework**: Axum
- **Runtime**: Tokio
- **Serialization**: Serde
- **Validation**: Valdi
- **Database**: PostgreSQL (via SQLx)
- **Authentication**: JWT (jsonwebtoken)
- **Tracing**: tracing + tracing-subscriber
### Shared (`shared`)
- **Types**: DTOs, enums, constants
- **Utilities**: Tracing helpers, error types
- **Constraints**: Must be `no_std` compatible where possible
---
## Performance Requirements
### Cold Start Budget
- **Target**: < 300ms (p50), < 1s (p95)
- **Strategy**: Minimal binary size, efficient async runtime
### Efficiency
- Must run reliably on:
- **0.25 vCPU**
- **256MB RAM**
- Prefer:
- Stack allocation
- Streaming responses
- Bounded memory usage
### Memory Usage
- **Target**: < 64MB (idle), < 128MB (peak)
- **Strategy**: Connection pooling, efficient serialization
### Concurrency
- **Target**: 1000+ concurrent requests
- **Strategy**: Axum + Tokio worker threads
### Safety
- Compile-time guarantees preferred over runtime checks
- Use:
- `sqlx` (compile-time SQL validation)
- `serde` with strict schemas
- No `unwrap()` in production paths
---
## Development Workflow
### Local Development
```bash
# Start all services
docker compose up -d
# Stop all services
docker compose down -v
# Build frontend
cargo leptos build
# Start frontend
cargo leptos watch
Coding Standards
Rust Best Practices
- Use
tracingfor all logging - Use
anyhowfor application errors - Use
thiserrorfor library errors - Prefer
Result<T, E>over panics - Use
#[instrument]for all async functions
Performance Optimizations
- Use
serde(with = "...::serde")for custom serialization - Use
tracing::info_span!instead of repeatedinfo!calls - Use
tracing::debug_span!for request tracing - Avoid unnecessary allocations in hot paths
Security
- Use
jsonwebtokenfor JWT signing/verification - Use
bcryptfor password hashing - Use
tracing::warn!for security-sensitive events - Enforce HTTPS in production
Important Notes
- Always use
#[instrument]on async functions - Always use
tracingfor logging - Always use
Result<T, E>instead of panics - Always use
serdefor serialization - Always use
uuidfor IDs - Always use
chronofor timestamps - Always use
sqlxfor database access - Always use
jsonwebtokenfor JWT - Always use
bcryptfor passwords - Always use
tracing-subscriberfor tracing
Booking Safety (Non-Negotiable)
- No double bookings
- All reservations are atomic
Related Documents
Totem — Development Rules
- **pnpm only** (never npm/yarn). Use `pnpm dlx` (never `npx`). Windows 11 + Git Bash. TypeScript strict mode.
MechCAD-MLLM
我们将这一新模型暂定名为 **"MechCAD-MLLM"**(面向机械领域的CAD多模态大模型)。
Gemini Project Context: ScryFall-UI
This file provides context for the Gemini AI assistant to understand and effectively assist with this project.
GEMINI.md — FIM One Instructional Context
FIM One is an AI-powered **Connector Hub** that serves as a bridge between disjointed enterprise systems (ERP, CRM, OA, Databases) through autonomous AI agents.