Cr Layer

A GraphQL caching layer built with Crystal 🚀

Development

Dependencies

Run Watch

dev/start

Docker Compose 🐳

Quick Start

# Build and start all services
docker compose up --build

Services

Configuration

The application uses config.docker.json for Docker environment configuration:

Docker Configuration Example

{
  "graphqlUrl": "http://host.docker.internal:3000/graphql",
  "storeUrl": "redis://redis:6379/0",
  "storeConnectionPoolSize": 1000,
  "operationsMap": {
    "searchProduct": {
      "expiration": "1m",
      "enabled": true
    }
  }
}

Key Settings:

Docker Hub Publishing 🚀

The project includes an automated GitHub Action that builds and publishes Docker images to Docker Hub:

Usage

Once running, the application will be available at:

Example Requests

# Check version
curl http://localhost:3003/version

# GraphQL query (cached)
curl -X POST http://localhost:3003/ \
  -H "Content-Type: application/json" \
  -d '{"query": "query { __typename }"}'