From eb576c4878525fe884318a440c95b8bc3d3fafc5 Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 2 Jun 2026 20:02:48 +0200 Subject: [PATCH] OpenCode Agents add --- .env_dev | 4 ++-- AGENTS.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 AGENTS.md diff --git a/.env_dev b/.env_dev index 6ba0900..80aaa5d 100644 --- a/.env_dev +++ b/.env_dev @@ -2,8 +2,8 @@ HTTP_PORT=8080 HTTP_HOST=0.0.0.0. DATABASE_URL="postgres://user:password@server:port/database" -DATABASE_POOLSIZE=32 -DATABASE_MAX_LIFETIME= +DATABASE_POOL_SIZE=32 +DATABASE_MAX_LIFETIME=10 GRAPHQL_SCHEMA_LOCATION="tests/schema.graphql" diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..ba177b6 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,61 @@ +# axum-async-graphql + +## Setup and Running + +1. Copy `.env_dev` to `.env` for local development: + + ```bash + cp .env_dev .env + ``` + +2. Update database connection string in `.env` file as needed + +3. Run the application: + + ```bash + cargo run + ``` + +4. Access GraphiQL IDE at: "" + +## Development Commands + +- Run tests: `cargo test` +- Format code: `cargo fmt` +- Check types: `cargo check` +- Lint: `cargo clippy` + +## Architecture + +This is a Rust application using: + +- `axum` for web framework +- `async-graphql` for GraphQL implementation +- `sqlx` for database access +- PostgreSQL as the database + +The structure follows domain-driven design with separate modules for: + +- `domain` - core business logic and entities +- `queries` - GraphQL query resolvers +- `mutations` - GraphQL mutation resolvers +- `dataloader` - data loading optimization +- `models` - shared data models + +## Key Files + +- `src/main.rs` - Entry point and application setup +- `src/database.rs` - Database connection management +- `src/config.rs` - Configuration handling +- `src/domain/` - Core business logic modules + +## Testing + +Integration tests can be run via the test script: + +```bash +./test.sh +``` + +The test script contains example mutations to test the API. +