diff --git a/api-docs/docs.go b/api-docs/docs.go index dfec3d05..18b98d0d 100644 --- a/api-docs/docs.go +++ b/api-docs/docs.go @@ -1044,6 +1044,26 @@ const docTemplate = `{ } } }, + "/api/v1/events": { + "get": { + "description": "Subscribe to server-sent events", + "produces": [ + "text/event-stream" + ], + "tags": [ + "events" + ], + "summary": "SSE Events", + "responses": { + "200": { + "description": "stream", + "schema": { + "type": "string" + } + } + } + } + }, "/api/v1/llm/config": { "get": { "security": [ diff --git a/api-docs/swagger.json b/api-docs/swagger.json index 3f432ecd..29e0c6c5 100644 --- a/api-docs/swagger.json +++ b/api-docs/swagger.json @@ -1038,6 +1038,26 @@ } } }, + "/api/v1/events": { + "get": { + "description": "Subscribe to server-sent events", + "produces": [ + "text/event-stream" + ], + "tags": [ + "events" + ], + "summary": "SSE Events", + "responses": { + "200": { + "description": "stream", + "schema": { + "type": "string" + } + } + } + } + }, "/api/v1/llm/config": { "get": { "security": [ diff --git a/api-docs/swagger.yaml b/api-docs/swagger.yaml index 8fa79567..b104170e 100644 --- a/api-docs/swagger.yaml +++ b/api-docs/swagger.yaml @@ -1427,6 +1427,19 @@ paths: summary: Validate OpenAI API Key tags: - config + /api/v1/events: + get: + description: Subscribe to server-sent events + produces: + - text/event-stream + responses: + "200": + description: stream + schema: + type: string + summary: SSE Events + tags: + - events /api/v1/llm/config: get: description: Get the current active LLM configuration diff --git a/cmd/server/main.go b/cmd/server/main.go index 14758b92..58cdd4be 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -23,8 +23,6 @@ import ( "scriberr/internal/transcription/adapters" "scriberr/internal/transcription/registry" "scriberr/pkg/logger" - - _ "scriberr/api-docs" // Import generated Swagger docs ) // Version information (set by GoReleaser) diff --git a/internal/api/router.go b/internal/api/router.go index 94b53878..4db05f05 100644 --- a/internal/api/router.go +++ b/internal/api/router.go @@ -7,8 +7,6 @@ import ( "scriberr/pkg/middleware" "github.com/gin-gonic/gin" - swaggerFiles "github.com/swaggo/files" - ginSwagger "github.com/swaggo/gin-swagger" ) // SetupRoutes sets up all API routes @@ -46,9 +44,6 @@ func SetupRoutes(handler *Handler, authService *auth.AuthService) *gin.Engine { // Health check endpoint (no auth required) router.GET("/health", handler.HealthCheck) - // Swagger documentation - router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) - // CLI install script alias (root level for easier access) router.GET("/install.sh", handler.GetInstallScript) router.GET("/install-cli.sh", handler.GetInstallScript) diff --git a/web/project-site/Makefile b/web/project-site/Makefile index bdf233cf..2b10cea7 100644 --- a/web/project-site/Makefile +++ b/web/project-site/Makefile @@ -4,7 +4,7 @@ install: npm install generate-api: - cd ../.. && swag init -g server/main.go -o api-docs --dir cmd,internal + cd ../.. && swag init -g server/main.go -o web/project-site/public/api --outputTypes json --dir cmd,internal build: generate-api npm run build diff --git a/web/project-site/package.json b/web/project-site/package.json index d89d195f..98713959 100644 --- a/web/project-site/package.json +++ b/web/project-site/package.json @@ -4,7 +4,7 @@ "version": "0.0.0", "type": "module", "scripts": { - "sync:spec": "mkdir -p public/api && cp -f ../../api-docs/swagger.json public/api/swagger.json || echo 'No swagger.json found, skipping copy'", + "sync:spec": "echo 'Swagger spec is generated by make generate-api'", "sync:undoc": "node ./scripts/gen-endpoints.mjs", "dev": "npm run sync:spec && npm run sync:undoc && vite", "build": "npm run sync:spec && npm run sync:undoc && tsc -b && vite build", diff --git a/web/project-site/src/Layout.tsx b/web/project-site/src/Layout.tsx index 661aad96..8eee5317 100644 --- a/web/project-site/src/Layout.tsx +++ b/web/project-site/src/Layout.tsx @@ -1,8 +1,11 @@ import React from 'react'; import { Link, useLocation } from 'react-router-dom'; import { ScriberrLogo } from './components/ScriberrLogo'; -import { Github, Book, Code } from 'lucide-react'; -import { Button } from './components/ui/Button'; +import { Github, Book, Menu, X } from 'lucide-react'; +import { useState } from 'react'; + + +import { GithubBadge } from './components/GithubBadge'; interface LayoutProps { children: React.ReactNode; @@ -11,6 +14,7 @@ interface LayoutProps { export function Layout({ children }: LayoutProps) { const location = useLocation(); const isDocs = location.pathname.startsWith('/docs'); + const [isMenuOpen, setIsMenuOpen] = useState(false); return (
@@ -22,33 +26,55 @@ export function Layout({ children }: LayoutProps) { {isDocs && ( - + Docs )}
- - - -
- +
+
+
+ + {/* Mobile Menu Overlay */} + {isMenuOpen && ( +
+ +
+ )} {/* Main Content */} @@ -57,21 +83,23 @@ export function Layout({ children }: LayoutProps) { {/* Footer */} -