OpenCode Agents add
This commit is contained in:
4
.env_dev
4
.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"
|
||||
|
||||
|
||||
61
AGENTS.md
Normal file
61
AGENTS.md
Normal file
@@ -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: "<http://localhost:8000>"
|
||||
|
||||
## 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.
|
||||
|
||||
Reference in New Issue
Block a user