/
API Design

API Design

Description

Design and document robust APIs with clear endpoints, fostering developer collaboration and scalability.

Version

2.0

Pre-selected AI

Anthropic: Claude 3.5 Sonnet

Contexts

Jira issue (full context) Project: Purpose Project: Features / Advantages Project: Target Audience Project: Tech Stack

Steps

1

Requirements Analysis

  • Input: A document describing the game mechanics from contexts

  • AI Task

    • Extract key aspects: rules, user flows, data flows, core functionality, etc.

    • Create a glossary of relevant terms and definitions.

    • Determine roles/entities involved (e.g., user, admin, NPC, etc.).

  • Output: A concise, structured overview covering:

    • Fundamental concepts and components

    • Main interactions or workflows

    • Basic relationships among these elements

2

User Actions

  • Input: Output from "Requirements Analysis" (glossary, core components, etc.)

  • AI Task:

    • Compile a full list of possible user actions (in a game context: movement, item usage, etc.; in software: CRUD actions, triggers, etc.).

    • For each action:

      • Name (short tag)

      • Short description

      • Requirements/conditions (e.g., parameters, permissions, items)

      • Result (changes in system state, UI updates, etc.)

  • Output: Comprehensive list (table or hierarchy) of all user actions with detailed descriptions

3

Data model

  • Input: User actions and entities

  • AI Task:

    • Identify main entities (e.g., Player, User, Item, Resource, etc.) and their fields (id, status, relationships, etc.).

    • Determine client-side vs. server-side storage (or local vs. cloud for software).

    • Define how and when the system synchronizes data.

  • Output: A schema (ER diagram or tabular format) clarifying how data is structured and updated

4

API Design

  • Input: User actions and the data model

  • AI Task:

    • Map endpoints or service methods to each action (REST, GraphQL, WebSocket, etc.).

    • Specify request/response formats (HTTP method, path, parameters, body, etc.).

  • Output: A table with next columns:

    • Endpoint: API route.

    • HTTP Method: GET, POST, PUT, DELETE.

    • Request Body: JSON schema for the request payload (use `json` formatting).

    • Response Structure: JSON schema for the response payload (use `json` formatting).

5

Design Validation

  • Input: Draft API specification and the list of user actions

  • AI Task:

    • Verify that all actions are covered (no duplicates or gaps).

    • Adjust data structures or endpoints if needed.

  • Output: A refined API spec addressing all requirements and potential concerns