Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

API Documentation

This project uses Swagger/OpenAPI for API documentation.

Accessing the Documentation

Once the server is running, you can access the Swagger UI at:

http://localhost:3000/api-docs

(Replace 3000 with your actual server port if different)

Adding Documentation to New Endpoints

To document a new endpoint, add JSDoc comments with Swagger annotations above your route handler. Here's an example:

/**
 * @swagger
 * /api/v1/example:
 *   get:
 *     summary: Example endpoint
 *     description: This is an example endpoint
 *     tags: [Example]
 *     responses:
 *       200:
 *         description: Success
 *         content:
 *           application/json:
 *             schema:
 *               type: object
 *               properties:
 *                 status:
 *                   type: string
 *                   example: success
 */
router.get('/example', exampleHandler);

Swagger Configuration

The Swagger configuration is located in src/docs/swagger.config.ts. You can modify:

  • API information (title, version, description)
  • Server URLs
  • Security schemes (JWT, API keys, etc.)
  • Common schemas
  • Tags for grouping endpoints

Documentation Structure

  • Auth: Authentication endpoints
  • System: System status and configuration endpoints
  • Devices: Device management endpoints

Resources