JSON AI Server

Quickly build JSON REST endpoints with AI using JSON AI Server. Simply provide a title, short description, and a sample JSON node, and the application will generate the endpoint for you.

This application leverages Spring AI and is written in Kotlin. The frontend, developed with React and TypeScript, is integrated directly into the Spring application. An embedded H2 database eliminates the need for external database dependencies.

While Claude and OpenAI are currently supported, we plan to add support for more Spring AI models soon.

GitHub repository: https://github.com/mmedojevicbg/json-ai-server
Docker Hub image: https://hub.docker.com/repository/docker/mmedojevicbg/json-ai-server

Installation

Create a file named docker-compose.yml with the following content:

services:
  jsonaiserver:
    image: 'mmedojevicbg/json-ai-server:latest'
    container_name: jsonaiserver
    environment:
      - 'CLAUDE_API_KEY=claude-api-key'
      - 'AI_MODEL=claude'
      - 'H2_FILE_STORAGE=/var/lib/h2/data'
    ports:
      - '15000:40000'
    volumes:
      - jsonaiserver_data:/var/lib/h2/data
volumes:
  jsonaiserver_data:

To use Claude, set the AI_MODEL environment variable to claude and provide your Claude API key in the CLAUDE_API_KEY environment variable. For OpenAI, set AI_MODEL to openai and provide your OpenAI API key in the OPENAI_API_KEY environment variable.

Once the application starts, access it at http://localhost:15000.

Let’s create a JSON endpoint with AI.

Your new endpoint will appear in the list.

Clicking the JSON preview link will open the endpoint.

Let’s add in a couple more datasets.

Sample client application

Let’s make a sample client application to talk to a JSON API server.

The output displays the generated data. Let’s select different category in the dropdown now.

Future enhancements

  • Support for the rest of AI models (Gemini, DeepSeek, …)
  • AI image generation
  • Improvements trough AI conversation
  • Full REST API support (add, edit, delete)

Leave a Reply

Your email address will not be published. Required fields are marked *