{ "openapi": "3.1.1", "info": { "title": "API Title", "version": "1.0" }, "servers": [ { "url": "http://localhost:3000/api/v1", "description": "Local development server" } ], "paths": { "/owner/login": { "post": { "tags": [ "Owner" ], "description": "Owner authentication endpoint", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "example": "owner@example.com" }, "password": { "type": "string", "format": "password", "example": "password123" } }, "required": [ "email", "password" ] } } } }, "responses": { "200": { "description": "Successful authentication", "headers": { "Set-Cookie": { "description": "Session cookie set on successful authentication", "schema": { "type": "string", "examples": [ "ACCESS_TOKEN=abc123; HttpOnly; Secure", "REFRESH_TOKEN=xyz789; HttpOnly; Secure" ] } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "status": "success", "message": "Authentication successful" } } } }, "400": { "description": "Invalid email or password", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FailureResponse" }, "example": { "status": "fail", "message": "Invalid email or password" } } } }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/owner/logout": { "post": { "tags": [ "Owner" ], "description": "Owner logout endpoint", "parameters": [ { "in": "cookie", "name": "REFRESH_TOKEN", "required": true, "schema": { "type": "string" }, "example": "REFRESH_TOKEN=xyz789; HttpOnly; Secure" } ], "responses": { "200": { "description": "Successful logout", "headers": { "Set-Cookie": { "description": "Clears session cookies on logout", "schema": { "type": "string", "examples": [ "ACCESS_TOKEN=; HttpOnly; Secure; Max-Age=0", "REFRESH_TOKEN=; HttpOnly; Secure; Max-Age=0" ] } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "status": "success", "message": "Logout successful" } } } }, "401": { "$ref": "#/components/responses/Unauthenticated" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/owner/access-token": { "get": { "tags": [ "Owner" ], "description": "Get access token for authenticated owner", "parameters": [ { "in": "cookie", "name": "REFRESH_TOKEN", "required": true, "schema": { "type": "string" }, "example": "REFRESH_TOKEN=xyz789; HttpOnly; Secure" } ], "responses": { "200": { "description": "Access token retrieved successfully", "headers": { "Set-Cookie": { "description": "Access token cookie set on successful retrieval", "schema": { "type": "string", "examples": [ "ACCESS_TOKEN=abc123; HttpOnly; Secure" ] } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "status": "success", "message": "Access token retrieved successfully" } } } }, "401": { "$ref": "#/components/responses/Unauthenticated" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/techs": { "get": { "tags": [ "Techs" ], "parameters": [ { "in": "query", "name": "page", "required": false, "schema": { "type": "integer", "default": 1, "description": "Page number for pagination" } }, { "in": "query", "name": "limit", "required": false, "schema": { "type": "integer", "default": 10, "description": "Number of items per page" } }, { "in": "query", "name": "sort", "required": false, "schema": { "type": "string", "default": "name", "description": "Field to sort by" } }, { "in": "query", "name": "order", "required": false, "schema": { "type": "string", "enum": [ "asc", "desc" ], "default": "asc", "description": "Sort order" } } ], "description": "Retrieve a list of technologies", "responses": { "200": { "description": "List of technologies retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "status": "success", "message": "Technologies retrieved successfully", "data": [ { "id": 1, "name": "JavaScript", "logo_url": "https://example.com/js-logo.png", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z" }, { "id": 2, "name": "React", "logo_url": "https://example.com/react-logo.png", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z" } ], "pagination": { "total": 2, "page": 1, "limit": 10, "pages": 1 } } } } }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "tags": [ "Techs" ], "description": "Create a new technology", "parameters": [ { "$ref": "#/components/parameters/AccessTokenParameter" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "example": "TypeScript" }, "logo_url": { "type": "string", "format": "uri", "example": "https://example.com/ts-logo.png" } }, "required": [ "name", "logo_url" ] } } } }, "responses": { "201": { "description": "Technology created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "status": "success", "message": "Technology created successfully", "data": { "id": 3, "name": "TypeScript", "logo_url": "https://example.com/ts-logo.png", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z" } } } } } } }, "delete": { "tags": [ "Techs" ], "description": "Delete a technology", "parameters": [ { "$ref": "#/components/parameters/AccessTokenParameter" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "array", "items": { "type": "string", "format": "uuid", "example": "550e8400-e29b-41d4-a716-446655440000" } } }, "required": [ "id" ] } } } }, "responses": { "200": { "description": "Technology deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "status": "success", "message": "Technology deleted successfully" } } } } } } }, "/techs/{techId}": { "get": { "tags": [ "Techs" ], "description": "Retrieve a specific technology by ID", "parameters": [ { "$ref": "#/components/parameters/TechIdParameter" } ], "responses": { "200": { "description": "Technology retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "status": "success", "message": "Technology retrieved successfully", "data": { "id": 1, "name": "JavaScript", "logo_url": "https://example.com/js-logo.png", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z" } } } } } } }, "put": { "tags": [ "Techs" ], "description": "Update a specific technology by ID", "parameters": [ { "$ref": "#/components/parameters/TechIdParameter" }, { "$ref": "#/components/parameters/AccessTokenParameter" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "example": "Updated Tech Name" }, "logo_url": { "type": "string", "format": "uri", "example": "https://example.com/updated-logo.png" } }, "required": [ "name", "logo_url" ] } } } }, "responses": { "200": { "description": "Technology updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "status": "success", "message": "Technology updated successfully", "data": { "id": 1, "name": "Updated Tech Name", "logo_url": "https://example.com/updated-logo.png", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z" } } } } } } }, "delete": { "tags": [ "Techs" ], "description": "Delete a specific technology by ID", "parameters": [ { "$ref": "#/components/parameters/TechIdParameter" }, { "$ref": "#/components/parameters/AccessTokenParameter" } ], "responses": { "200": { "description": "Technology deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "status": "success", "message": "Technology deleted successfully" } } } } } } }, "/projects": { "post": { "tags": [ "Projects" ], "description": "Create a new project", "parameters": [ { "$ref": "#/components/parameters/AccessTokenParameter" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "example": "My New Project" }, "short_description": { "type": "string", "example": "This is a short description of my new project." }, "description": { "type": "string", "example": "This is a detailed description of my new project." }, "cover_url": { "type": "string", "format": "uri", "example": "https://example.com/my-new-project-cover.jpg" }, "techs": { "type": "array", "items": { "type": "string", "format": "uuid", "example": "123ke4567-e89b-12d3-a456-426614174000" } }, "main_links": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string", "format": "uri", "example": "https://example.com" }, "type": { "type": "string", "enum": [ "FEEDBACK", "LIVE_PRODUCTION" ], "example": "LIVE_PRODUCTION" } } } }, "other_links": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string", "example": "GitHub Repository" }, "url": { "type": "string", "format": "uri", "example": "https://github.com/my-new-project" }, "order": { "type": "integer", "example": 0 } } } } } } } } }, "responses": { "201": { "description": "Project created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "status": "success", "message": "Project created successfully", "data": { "project_id": "12345" } } } } } } } } }, "components": { "schemas": { "SuccessResponse": { "type": "object", "description": "Standard response for successful operations", "required": [ "status", "message", "data" ], "properties": { "status": { "type": "string", "default": "success", "description": "HTTP status code" }, "message": { "type": "string" }, "data": { "additionalProperties": true, "description": "Response data, can be an object or an array of objects", "oneOf": [ { "type": "object" }, { "type": "array", "items": { "type": "object" } } ] }, "pagination": { "type": "object", "description": "Pagination information", "properties": { "total": { "type": "integer", "description": "Total number of items available" }, "page": { "type": "integer", "description": "Current page number" }, "limit": { "type": "integer", "description": "Number of items per page" }, "pages": { "type": "integer", "description": "Total number of pages" } } } } }, "FailureResponse": { "type": "object", "description": "Standard failure response format", "required": [ "status", "message" ], "properties": { "status": { "type": "string", "default": "fail", "description": "Indicates a failure occurred" }, "message": { "type": "string" } } }, "ErrorResponse": { "type": "object", "description": "Standard error response format", "required": [ "status", "message" ], "properties": { "status": { "type": "string", "default": "error", "description": "Indicates an error occurred" }, "message": { "type": "string" }, "error": { "type": "string", "description": "Error message" } } } }, "parameters": { "TechIdParameter": { "name": "techId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "example": "123ke4567-e89b-12d3-a456-426614174000", "description": "Unique identifier for the technology" }, "AccessTokenParameter": { "name": "ACCESS_TOKEN", "in": "cookie", "required": true, "schema": { "type": "string" }, "example": "ACCESS_TOKEN=abc123; HttpOnly; Secure", "description": "Access token for authenticated requests" } }, "responses": { "Unauthenticated": { "description": "Not authenticated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FailureResponse" }, "example": { "status": "error", "message": "Not authenticated" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "example": { "status": "error", "message": "An unexpected error occurred" }, "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }