{
    "openapi": "3.0.0",
    "info": {
        "title": "Portofolio API",
        "description": "Dokumentasi REST API untuk backend website portofolio",
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "/",
            "description": "API Server"
        }
    ],
    "paths": {
        "/api/admin/certificates": {
            "post": {
                "tags": [
                    "Admin - Certificates"
                ],
                "summary": "Tambah sertifikat (Admin)",
                "operationId": "976194b9053de3512252827f49ebb664",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title",
                                    "issuer",
                                    "issued_at"
                                ],
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "example": "Belajar Fundamental Aplikasi Web dengan React"
                                    },
                                    "issuer": {
                                        "type": "string",
                                        "example": "Dicoding Indonesia"
                                    },
                                    "issued_at": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2026-09-01"
                                    },
                                    "credential_url": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "image": {
                                        "type": "string",
                                        "example": "/certificates/nama-file.webp",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Sertifikat berhasil ditambahkan"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/admin/certificates/{certificate}": {
            "put": {
                "tags": [
                    "Admin - Certificates"
                ],
                "summary": "Update sertifikat (Admin)",
                "operationId": "e809ac8e6bf9c1fd3f56cf00cfc36041",
                "parameters": [
                    {
                        "name": "certificate",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "title": {
                                        "type": "string"
                                    },
                                    "issuer": {
                                        "type": "string"
                                    },
                                    "issued_at": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "credential_url": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "image": {
                                        "type": "string",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Sertifikat berhasil diupdate"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    },
                    "404": {
                        "description": "Sertifikat tidak ditemukan"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin - Certificates"
                ],
                "summary": "Hapus sertifikat (Admin)",
                "operationId": "fd4d32ebea0fe3b9c4644d2f43c0333f",
                "parameters": [
                    {
                        "name": "certificate",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Sertifikat berhasil dihapus"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    },
                    "404": {
                        "description": "Sertifikat tidak ditemukan"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/admin/experiences": {
            "post": {
                "tags": [
                    "Admin - Experiences"
                ],
                "summary": "Tambah pengalaman kerja baru (Admin)",
                "operationId": "c5353909c9f70a1484d4e8e79e873f24",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "company",
                                    "position",
                                    "start_date"
                                ],
                                "properties": {
                                    "company": {
                                        "type": "string",
                                        "example": "PT Hayati Pratama Mandiri"
                                    },
                                    "position": {
                                        "type": "string",
                                        "example": "IT Infrastruktur"
                                    },
                                    "start_date": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2023-01-01"
                                    },
                                    "end_date": {
                                        "type": "string",
                                        "format": "date",
                                        "nullable": true
                                    },
                                    "description": {
                                        "type": "string",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Pengalaman berhasil ditambahkan"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/admin/experiences/{experience}": {
            "put": {
                "tags": [
                    "Admin - Experiences"
                ],
                "summary": "Update pengalaman kerja (Admin)",
                "operationId": "08a68c2f60c772d7a1aa0c63bce2c391",
                "parameters": [
                    {
                        "name": "experience",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "company": {
                                        "type": "string"
                                    },
                                    "position": {
                                        "type": "string"
                                    },
                                    "start_date": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "end_date": {
                                        "type": "string",
                                        "format": "date",
                                        "nullable": true
                                    },
                                    "description": {
                                        "type": "string",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Pengalaman berhasil diupdate"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    },
                    "404": {
                        "description": "Pengalaman tidak ditemukan"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin - Experiences"
                ],
                "summary": "Hapus pengalaman kerja (Admin)",
                "operationId": "696661dea6990e872271aa3dbd1621d7",
                "parameters": [
                    {
                        "name": "experience",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Pengalaman berhasil dihapus"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    },
                    "404": {
                        "description": "Pengalaman tidak ditemukan"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/admin/messages": {
            "get": {
                "tags": [
                    "Admin - Messages"
                ],
                "summary": "Lihat semua pesan masuk (Admin)",
                "operationId": "9b6408c2a65ca75f83053f31c72cd88b",
                "responses": {
                    "200": {
                        "description": "Berhasil mengambil daftar pesan"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/admin/messages/{message}/read": {
            "patch": {
                "tags": [
                    "Admin - Messages"
                ],
                "summary": "Tandai pesan sudah dibaca (Admin)",
                "operationId": "9330595ea3c979ed2fed9c18c2bbc85f",
                "parameters": [
                    {
                        "name": "message",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Pesan berhasil ditandai sudah dibaca"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    },
                    "404": {
                        "description": "Pesan tidak ditemukan"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/admin/messages/{message}": {
            "delete": {
                "tags": [
                    "Admin - Messages"
                ],
                "summary": "Hapus pesan (Admin)",
                "operationId": "825d51f65563501bed3f3740589ad2dc",
                "parameters": [
                    {
                        "name": "message",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Pesan berhasil dihapus"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    },
                    "404": {
                        "description": "Pesan tidak ditemukan"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/admin/projects": {
            "post": {
                "tags": [
                    "Admin - Projects"
                ],
                "summary": "Tambah project baru (Admin)",
                "operationId": "0b4e209628531c3d1e5bb311f33eae3d",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title",
                                    "slug"
                                ],
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "example": "Website Portofolio"
                                    },
                                    "slug": {
                                        "type": "string",
                                        "example": "website-portofolio"
                                    },
                                    "description": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "content": {
                                        "type": "string",
                                        "example": "Masalah\n...\n\nSolusi\n...\n\nHasil\n...",
                                        "nullable": true
                                    },
                                    "thumbnail": {
                                        "type": "string",
                                        "example": "/projects/website-portofolio.webp",
                                        "nullable": true
                                    },
                                    "demo_url": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "repo_url": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "skill_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "example": [
                                            1,
                                            2,
                                            3
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Project berhasil ditambahkan"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/admin/projects/{project}": {
            "put": {
                "tags": [
                    "Admin - Projects"
                ],
                "summary": "Update project (Admin)",
                "operationId": "03edce66cb4892f67b27ce99258c2bfc",
                "parameters": [
                    {
                        "name": "project",
                        "in": "path",
                        "description": "ID project",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "title": {
                                        "type": "string"
                                    },
                                    "slug": {
                                        "type": "string"
                                    },
                                    "description": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "content": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "thumbnail": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "demo_url": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "repo_url": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "skill_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Project berhasil diupdate"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    },
                    "404": {
                        "description": "Project tidak ditemukan"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin - Projects"
                ],
                "summary": "Hapus project (Admin)",
                "operationId": "3b29de091a6b9129ede64775a612167c",
                "parameters": [
                    {
                        "name": "project",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project berhasil dihapus"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    },
                    "404": {
                        "description": "Project tidak ditemukan"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/admin/skills": {
            "post": {
                "tags": [
                    "Admin - Skills"
                ],
                "summary": "Tambah skill baru (Admin)",
                "operationId": "4821ea029e220d7c2b15d8954145b57a",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Laravel"
                                    },
                                    "icon": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "category": {
                                        "type": "string",
                                        "example": "Backend",
                                        "nullable": true,
                                        "enum": [
                                            "Backend",
                                            "Frontend",
                                            "Mobile",
                                            "Tools"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Skill berhasil ditambahkan"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/admin/skills/{skill}": {
            "put": {
                "tags": [
                    "Admin - Skills"
                ],
                "summary": "Update skill (Admin)",
                "operationId": "dadbfc722cbae6400fc79124334b6d5d",
                "parameters": [
                    {
                        "name": "skill",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "icon": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "category": {
                                        "type": "string",
                                        "example": "Frontend",
                                        "nullable": true,
                                        "enum": [
                                            "Backend",
                                            "Frontend",
                                            "Mobile",
                                            "Tools"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Skill berhasil diupdate"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    },
                    "404": {
                        "description": "Skill tidak ditemukan"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin - Skills"
                ],
                "summary": "Hapus skill (Admin)",
                "operationId": "62cc968127792ff93d0b3d9fae1ea371",
                "parameters": [
                    {
                        "name": "skill",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Skill berhasil dihapus"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    },
                    "404": {
                        "description": "Skill tidak ditemukan"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/login": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Login admin",
                "operationId": "a3b306d14572d1f4bd6c064b3233e7b8",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "password"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "admin@portofolio.test"
                                    },
                                    "password": {
                                        "type": "string",
                                        "format": "password",
                                        "example": "password"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Login berhasil, mengembalikan token"
                    },
                    "422": {
                        "description": "Email atau password salah"
                    }
                }
            }
        },
        "/api/logout": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Logout, hapus token aktif",
                "operationId": "fe8f3429cd6979b3b4517e186505f9f9",
                "responses": {
                    "200": {
                        "description": "Berhasil logout"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/me": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "Data admin yang sedang login",
                "operationId": "9d9bc556f927575aa492a88c28fe5908",
                "responses": {
                    "200": {
                        "description": "Berhasil mengambil data user"
                    },
                    "401": {
                        "description": "Tidak terautentikasi"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/certificates": {
            "get": {
                "tags": [
                    "Certificates"
                ],
                "summary": "List sertifikat",
                "operationId": "542620d99fb7a93d6889bcd434d9afe0",
                "responses": {
                    "200": {
                        "description": "Berhasil mengambil daftar sertifikat"
                    }
                }
            }
        },
        "/api/experiences": {
            "get": {
                "tags": [
                    "Experiences"
                ],
                "summary": "List riwayat pengalaman kerja",
                "operationId": "9808e2b3304f0b4df63e0b33dc489031",
                "responses": {
                    "200": {
                        "description": "Berhasil mengambil daftar pengalaman"
                    }
                }
            }
        },
        "/api/messages": {
            "post": {
                "tags": [
                    "Messages"
                ],
                "summary": "Kirim pesan lewat form kontak",
                "operationId": "db79bb7bcadfdb708e9f6c38ac928f4a",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "email",
                                    "message"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "John Doe"
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "john@example.com"
                                    },
                                    "message": {
                                        "type": "string",
                                        "example": "Halo, saya tertarik dengan project Anda."
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Pesan berhasil dikirim"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                }
            }
        },
        "/api/projects": {
            "get": {
                "tags": [
                    "Projects"
                ],
                "summary": "List semua project",
                "operationId": "8d4a13ef3fc773ff4031e515460919ea",
                "responses": {
                    "200": {
                        "description": "Berhasil mengambil daftar project"
                    }
                }
            }
        },
        "/api/projects/{slug}": {
            "get": {
                "tags": [
                    "Projects"
                ],
                "summary": "Detail project berdasarkan slug",
                "operationId": "71202ddc37d4c2fb9711871fd74d89b0",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "description": "Slug unik project",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil mengambil detail project"
                    },
                    "404": {
                        "description": "Project tidak ditemukan"
                    }
                }
            }
        },
        "/api/skills": {
            "get": {
                "tags": [
                    "Skills"
                ],
                "summary": "List semua skill",
                "operationId": "6acb38b223d6471cc32eab45ea57be4b",
                "responses": {
                    "200": {
                        "description": "Berhasil mengambil daftar skill"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "bearerFormat": "JWT",
                "scheme": "bearer"
            }
        }
    },
    "tags": [
        {
            "name": "Admin - Certificates",
            "description": "Admin - Certificates"
        },
        {
            "name": "Admin - Experiences",
            "description": "Admin - Experiences"
        },
        {
            "name": "Admin - Messages",
            "description": "Admin - Messages"
        },
        {
            "name": "Admin - Projects",
            "description": "Admin - Projects"
        },
        {
            "name": "Admin - Skills",
            "description": "Admin - Skills"
        },
        {
            "name": "Auth",
            "description": "Auth"
        },
        {
            "name": "Certificates",
            "description": "Certificates"
        },
        {
            "name": "Experiences",
            "description": "Experiences"
        },
        {
            "name": "Messages",
            "description": "Messages"
        },
        {
            "name": "Projects",
            "description": "Projects"
        },
        {
            "name": "Skills",
            "description": "Skills"
        }
    ]
}