Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pedroaurelli/fastify-swagger
Fastify Node example application auto documatated by Swagger
https://github.com/pedroaurelli/fastify-swagger
autodoc fastify nodejs solid swagger zod-validation
Last synced: 19 days ago
JSON representation
Fastify Node example application auto documatated by Swagger
- Host: GitHub
- URL: https://github.com/pedroaurelli/fastify-swagger
- Owner: pedroaurelli
- Created: 2024-12-23T12:48:11.000Z (22 days ago)
- Default Branch: main
- Last Pushed: 2024-12-24T11:35:09.000Z (21 days ago)
- Last Synced: 2024-12-24T11:50:56.998Z (21 days ago)
- Topics: autodoc, fastify, nodejs, solid, swagger, zod-validation
- Language: TypeScript
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node.JS app (Fastify) auto documented by Swagger
## Objective
- The objective of this project is not to create a new API. I was testing some project structures to validate the input and output values from the controller. I applied knowledge from all the API projects I have worked on and merged only the best practices that I consider essential for any API project. This includes: route documentation, input and output value validation, tests (coming soon), directory structure, some SOLID principles, and Design Patterns.## Project Structure
- [**src**](https://github.com/pedroaurelli/fastify-swager/tree/main/src)
- [**controllers**](https://github.com/pedroaurelli/fastify-swager/tree/main/src/controllers)
- [**lib**](https://github.com/pedroaurelli/fastify-swager/tree/main/src/lib)
- [schemas](https://github.com/pedroaurelli/fastify-swager/tree/main/src/lib/schemas)
- [types](https://github.com/pedroaurelli/fastify-swager/tree/main/src/lib/types)
- [utils](https://github.com/pedroaurelli/fastify-swager/tree/main/src/lib/utils)
- [**services**](https://github.com/pedroaurelli/fastify-swager/tree/main/src/services)| **Folder** | **Description** |
|----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
| [**src**](https://github.com/pedroaurelli/fastify-swager/tree/main/src) | Root folder of the project's source code. |
| [**controllers**](https://github.com/pedroaurelli/fastify-swager/tree/main/src/controllers) | Contains controllers responsible for handling route requests and responses. |
| [**lib**](https://github.com/pedroaurelli/fastify-swager/tree/main/src/lib) | Folder with libraries and auxiliary resources for the project. |
| [**schemas**](https://github.com/pedroaurelli/fastify-swager/tree/main/src/lib/schemas) | Defines validation and data structure schemas. |
| [**types**](https://github.com/pedroaurelli/fastify-swager/tree/main/src/lib/types) | Contains type and interface definitions for the project. |
| [**utils**](https://github.com/pedroaurelli/fastify-swager/tree/main/src/lib/utils) | Includes utility functions and helpers to support core functionalities. |
| [**services**](https://github.com/pedroaurelli/fastify-swager/tree/main/src/services) | Implements business logic. |## Scripts
| **Script** | **Description** |
|------------|---------------------------------------------------------|
| `dev` | Runs the server in development mode|## Packages
| **Dependency** | **Description** |
|-------------------------|------------------------------------------------------|
| `typescript` | Typed JavaScript language. |
| `tsx` | TypeScript runtime with ES module support. |
| `fastify` | Fast web framework for Node.js. |
| `@fastify/swagger` | Swagger/OpenAPI plugin for Fastify. |
| `zod` | Schema validation library for TypeScript. |## Swagger
- Swagger UI available in `/docs` route