page.tsx 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import { ApiReferenceReact } from '@scalar/api-reference-react'
  2. import '@scalar/api-reference-react/style.css'
  3. const openApiSpec = {
  4. openapi: '3.0.3',
  5. info: {
  6. title: 'Vtorio API',
  7. version: '1.0.0',
  8. description: 'File upload and management API for Vtorio application',
  9. },
  10. servers: [
  11. {
  12. url: 'http://localhost:3000',
  13. description: 'Development server',
  14. },
  15. ],
  16. components: {
  17. schemas: {
  18. File: {
  19. type: 'object',
  20. properties: {
  21. id: { type: 'string' },
  22. filename: { type: 'string' },
  23. mimetype: { type: 'string' },
  24. size: { type: 'number' },
  25. createdAt: { type: 'string', format: 'date-time' },
  26. updatedAt: { type: 'string', format: 'date-time' },
  27. },
  28. required: ['id', 'filename', 'mimetype', 'size', 'createdAt'],
  29. },
  30. Error: {
  31. type: 'object',
  32. properties: {
  33. success: { type: 'boolean', example: false },
  34. error: { type: 'string' },
  35. },
  36. required: ['success', 'error'],
  37. },
  38. },
  39. },
  40. paths: {
  41. },
  42. }
  43. export default function ApiDocs() {
  44. return (
  45. <div className="min-h-screen bg-gray-50">
  46. <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
  47. <div className="bg-white shadow rounded-lg">
  48. <div className="px-4 py-5 sm:p-6">
  49. <div className="mb-4">
  50. <h1 className="text-2xl font-bold text-gray-900">
  51. Vtorio API Documentation
  52. </h1>
  53. <p className="text-gray-600 mt-2">
  54. Interactive API documentation for file upload and management endpoints.
  55. </p>
  56. </div>
  57. <ApiReferenceReact
  58. configuration={{
  59. content: openApiSpec,
  60. theme: 'default',
  61. layout: 'modern'
  62. }}
  63. />
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. )
  69. }