{
  "openapi": "3.1.0",
  "info": {
    "title": "Hubert Grzesiak Developer API",
    "description": "Public machine-readable REST API for Hubert Grzesiak's portfolio, case studies, technical articles, and direct developer contact. Designed for web clients, autonomous agents, and LLM function calling.",
    "version": "1.0.0",
    "contact": {
      "name": "Hubert Grzesiak",
      "email": "hubertgrzesiak.dev@gmail.com",
      "url": "https://hubertgrzesiak.com"
    },
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/licenses/MIT"
    }
  },
  "servers": [
    {
      "url": "https://hubertgrzesiak.com",
      "description": "Production API Server"
    },
    {
      "url": "http://localhost:3000",
      "description": "Local Development Server"
    }
  ],
  "paths": {
    "/api/v1/profile": {
      "get": {
        "operationId": "getProfile",
        "summary": "Get developer profile and skills",
        "description": "Retrieve Hubert Grzesiak's background, professional roles, primary skills, and communication links.",
        "responses": {
          "200": {
            "description": "Developer profile retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects": {
      "get": {
        "operationId": "listProjects",
        "summary": "List featured case studies and projects",
        "description": "Retrieve fullstack case studies, featured frontend projects, architecture breakdowns, and tech stacks.",
        "responses": {
          "200": {
            "description": "Projects retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "projects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Project"
                      }
                    },
                    "total": {
                      "type": "integer",
                      "example": 1
                    }
                  },
                  "required": ["projects", "total"]
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/posts": {
      "get": {
        "operationId": "listPosts",
        "summary": "List technical blog posts",
        "description": "Retrieve published technical guides, performance articles, and developer workflow breakdowns.",
        "parameters": [
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Filter blog posts by tag (e.g., 'ai', 'nextjs', 'performance')",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of articles to return",
            "schema": {
              "type": "integer",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Blog posts retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "posts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BlogPost"
                      }
                    },
                    "total": {
                      "type": "integer",
                      "example": 8
                    }
                  },
                  "required": ["posts", "total"]
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/contact": {
      "post": {
        "operationId": "submitContact",
        "summary": "Submit a project inquiry or contact message",
        "description": "Send a verified contact message directly to Hubert Grzesiak for freelance web development, engineering audits, or collaborations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactSubmission"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message received successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Profile": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "example": "Hubert Grzesiak" },
          "headline": { "type": "string", "example": "Frontend Developer & Web Performance Specialist" },
          "location": { "type": "string", "example": "Poland / Remote Worldwide" },
          "email": { "type": "string", "example": "hubertgrzesiak.dev@gmail.com" },
          "website": { "type": "string", "example": "https://hubertgrzesiak.com" },
          "github": { "type": "string", "example": "https://github.com/hubert-grzesiak" },
          "linkedin": { "type": "string", "example": "https://www.linkedin.com/in/hubertgrzesiakjs/" },
          "skills": {
            "type": "object",
            "properties": {
              "frontend": { "type": "array", "items": { "type": "string" }, "example": ["React 19", "Next.js 16", "TypeScript", "Tailwind CSS", "Framer Motion"] },
              "performance": { "type": "array", "items": { "type": "string" }, "example": ["Core Web Vitals (LCP, INP, CLS)", "Lighthouse", "Web Vitals API", "Bundle Optimization"] },
              "backend": { "type": "array", "items": { "type": "string" }, "example": ["PostgreSQL", "Prisma ORM", "MongoDB", "Stripe API", "RESTful Services"] },
              "ai_tooling": { "type": "array", "items": { "type": "string" }, "example": ["Claude Code", "Cursor", "v0", "DevTools Automation"] }
            }
          },
          "experience": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "company": { "type": "string" },
                "role": { "type": "string" },
                "period": { "type": "string" },
                "description": { "type": "string" }
              }
            }
          }
        },
        "required": ["name", "headline", "email", "website", "skills"]
      },
      "Project": {
        "type": "object",
        "properties": {
          "slug": { "type": "string", "example": "restly" },
          "title": { "type": "string", "example": "Restly" },
          "description": { "type": "string", "example": "Fullstack booking and vacation rental platform with interactive map exploration, instant booking, and Stripe checkout." },
          "url": { "type": "string", "example": "https://hubertgrzesiak.com/case-studies/restly" },
          "technologies": { "type": "array", "items": { "type": "string" }, "example": ["Next.js", "React", "Prisma", "PostgreSQL", "Tailwind CSS", "Stripe", "Mapbox", "Cloudinary"] }
        },
        "required": ["slug", "title", "description", "url", "technologies"]
      },
      "BlogPost": {
        "type": "object",
        "properties": {
          "slug": { "type": "string", "example": "my-daily-ai-developer-stack" },
          "title": { "type": "string", "example": "The AI Tools I Actually Use Daily as a Frontend Developer" },
          "description": { "type": "string", "example": "A breakdown of the four AI tools in my daily frontend workflow, their exact boundaries, and why keeping their responsibilities narrow saves time." },
          "url": { "type": "string", "example": "https://hubertgrzesiak.com/blog/my-daily-ai-developer-stack" },
          "date": { "type": "string", "example": "2026-09-17" },
          "tags": { "type": "array", "items": { "type": "string" }, "example": ["ai", "developer-tools", "productivity"] }
        },
        "required": ["slug", "title", "description", "url", "date", "tags"]
      },
      "ContactSubmission": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "minLength": 2, "example": "Alex Taylor" },
          "email": { "type": "string", "format": "email", "example": "alex@company.com" },
          "message": { "type": "string", "minLength": 10, "example": "We need a frontend developer for a Next.js App Router performance audit." },
          "serviceType": { "type": "string", "enum": ["frontend_development", "performance_audit", "consultation", "general_inquiry"], "default": "general_inquiry" }
        },
        "required": ["name", "email", "message"]
      },
      "ContactResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "example": true },
          "message": { "type": "string", "example": "Inquiry received. Hubert will review your inquiry and follow up within 24 hours." }
        },
        "required": ["success", "message"]
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": { "type": "string", "example": "INVALID_INPUT" },
              "message": { "type": "string", "example": "The email provided is not valid." },
              "resolution": { "type": "string", "example": "Provide a valid email address and resubmit to /api/v1/contact." }
            },
            "required": ["code", "message", "resolution"]
          }
        },
        "required": ["error"]
      }
    }
  }
}
