diff --git a/README.md b/README.md index a396f12..b67a489 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,222 @@ -# azure-functions-nodejs-monorepo +
-Monorepo for NodeJs Azure Functions V4 that provides extensions and tools support for example to exporting OpenAPI spec files from annotated Azure Functions. +# ๐Ÿš€ Azure Functions Node.js Monorepo + +### *Enterprise-Grade Tools & Extensions for Azure Functions V4* + +[Features](#-features) โ€ข [Projects](#-projects) โ€ข [Quick Start](#-quick-start) โ€ข [Documentation](#-documentation) โ€ข [Contributing](#-contributing) + +
+ +--- + +## ๐ŸŒŸ Features + +This monorepo brings together cutting-edge tools and libraries that supercharge your Azure Functions development experience: + +- โœจ **Type-Safe APIs** - Full TypeScript support with automatic type inference +- ๐Ÿ“š **Auto-Generated Documentation** - OpenAPI/Swagger specs generated from your code +- ๐Ÿ”’ **Built-in Security** - Multiple authentication strategies out of the box +- ๐ŸŽฏ **Developer Experience** - Intuitive APIs that feel natural and productive +- โšก **Production Ready** - Battle-tested code designed for enterprise use +- ๐Ÿ”ง **Extensible** - Plugin architecture for custom integrations + +--- + +## ๐Ÿ“ฆ Projects + +### [@apvee/azure-functions-openapi](./packages/azure-functions-openapi) + +> **Version 2.0** - A complete rewrite with improved TypeScript support, automatic type inference, and enhanced Azure integration. + +![Apvee Azure Functions OpenAPI v2](https://raw.githubusercontent.com/apvee/azure-functions-nodejs-monorepo/main/packages/azure-functions-openapi/assets/apvee-azure-functions-openapi-v2.png) + +#### ๐Ÿ“– Overview + +A powerful extension for **Azure Functions V4** that automatically generates and serves OpenAPI documentation for your serverless APIs. Built on top of `@asteasolutions/zod-to-openapi` and leveraging **Zod schemas** for validation, it ensures your API is always type-safe, well-documented, and easy to explore. + +#### โœจ Key Features + +- ๐ŸŽฏ **Zero Configuration** - Works out of the box with sensible defaults +- ๐Ÿ“ **Automatic OpenAPI Generation** - Generate specs from your function definitions +- ๐Ÿ” **Interactive Swagger UI** - Explore and test APIs directly in the browser +- ๐Ÿ›ก๏ธ **Multiple Auth Strategies** - Support for API keys, Bearer tokens, OAuth2, and more +- ๐ŸŽจ **Customizable** - Full control over your OpenAPI specification +- ๐Ÿ“Š **Zod Integration** - Leverage Zod for runtime validation and type safety + +#### ๐Ÿš€ Quick Example + +```typescript +import { z } from 'zod'; +import { createOpenAPIHttpTrigger } from '@apvee/azure-functions-openapi'; + +const TodoSchema = z.object({ + id: z.string(), + title: z.string(), + completed: z.boolean() +}); + +export const getTodo = createOpenAPIHttpTrigger({ + summary: 'Get a todo item', + responses: { + 200: { description: 'Success', schema: TodoSchema } + }, + handler: async (context) => { + return { status: 200, body: { id: '1', title: 'Example', completed: false } }; + } +}); +``` + +[๐Ÿ“š Full Documentation](./packages/azure-functions-openapi/README.md) + +--- + +### [test-functions](./packages/test-functions) + +#### ๐Ÿ“– Overview + +A comprehensive **sample application** demonstrating the usage of the OpenAPI library with a complete Todo API implementation. This project serves as both a working example and a testbed for the OpenAPI library. + +#### ๐ŸŽฏ What's Inside + +- โœ… **Complete CRUD Operations** - Full Todo API with Create, Read, Update, Delete +- ๐Ÿ” **Security Examples** - Multiple authentication strategies implemented +- ๐Ÿ“ **Best Practices** - Production-ready code structure and patterns +- ๐Ÿงช **Real-World Scenarios** - Webhook handlers, batch operations, and more +- ๐Ÿ“š **Learning Resource** - Well-commented code to help you get started + +#### ๐Ÿ—‚๏ธ Example Endpoints + +- `GET /api/todos` - List all todos +- `GET /api/todos/{id}` - Get a single todo +- `POST /api/todos` - Create a new todo +- `PUT /api/todos/{id}` - Update a todo +- `DELETE /api/todos/{id}` - Delete a todo +- `POST /api/todos/export` - Export todos to various formats + +[๐Ÿ“š View Examples](./packages/test-functions/src/functions) + +--- + +## ๐Ÿš€ Quick Start + +### Prerequisites + +- **Node.js** 18.x or higher +- **Azure Functions Core Tools** v4 +- **TypeScript** 5.0 or higher + +### Installation + +```bash +# Clone the repository +git clone https://github.com/apvee/azure-functions-nodejs-monorepo.git +cd azure-functions-nodejs-monorepo + +# Install dependencies +npm install + +# Build all packages +npm run build +``` + +### Running the Example + +```bash +# Navigate to the test functions +cd packages/test-functions + +# Start the Azure Functions runtime +npm start + +# Access the Swagger UI at +# http://localhost:7071/api/docs +``` + +--- + +## ๐Ÿ“š Documentation + +Each project contains detailed documentation in its respective directory: + +- [**@apvee/azure-functions-openapi**](./packages/azure-functions-openapi/README.md) - Complete API reference and guides +- [**test-functions**](./packages/test-functions/README.md) - Sample code and usage examples + +--- + +## ๐Ÿ› ๏ธ Development + +This monorepo uses a modern development setup: + +- **Package Manager**: npm workspaces +- **Language**: TypeScript 5.0+ +- **Build Tool**: Native TypeScript compiler +- **Runtime**: Azure Functions V4 (Node.js 18+) + +### Project Structure + +``` +azure-functions-nodejs-monorepo/ +โ”œโ”€โ”€ packages/ +โ”‚ โ”œโ”€โ”€ azure-functions-openapi/ # Main OpenAPI library +โ”‚ โ””โ”€โ”€ test-functions/ # Example implementation +โ”œโ”€โ”€ package.json # Workspace configuration +โ””โ”€โ”€ README.md # This file +``` + +--- + +## ๐Ÿค Contributing + +We welcome contributions! Whether it's: + +- ๐Ÿ› Bug reports +- ๐Ÿ’ก Feature requests +- ๐Ÿ“ Documentation improvements +- ๐Ÿ”ง Code contributions + +Please feel free to open an issue or submit a pull request. + +### Development Workflow + +1. Fork the repository +2. Create your feature branch (`git checkout -b feature/amazing-feature`) +3. Commit your changes (`git commit -m 'Add some amazing feature'`) +4. Push to the branch (`git push origin feature/amazing-feature`) +5. Open a Pull Request + +--- + +## ๐Ÿ“‹ Roadmap + +We're constantly working to improve this monorepo. Here's what's coming: + +- ๐Ÿ”„ **More Packages** - Additional tools and utilities for Azure Functions +- ๐Ÿงช **Testing Utilities** - Helpers for testing Azure Functions +- ๐Ÿ“Š **Monitoring Integration** - Application Insights helpers +- ๐Ÿ”Œ **Additional Integrations** - Support for more Azure services +- ๐Ÿ“– **Enhanced Documentation** - Video tutorials and interactive guides + +**Stay tuned - more projects will be added soon!** + +--- + +## ๐Ÿ“„ License + +This project is licensed under the MIT License - see the individual package LICENSE files for details. + +--- + +## ๐Ÿ’ฌ Support + +- ๐Ÿ“ง **Issues**: [GitHub Issues](https://github.com/apvee/azure-functions-nodejs-monorepo/issues) +- ๐Ÿ’ฌ **Discussions**: [GitHub Discussions](https://github.com/apvee/azure-functions-nodejs-monorepo/discussions) +- ๐Ÿ“– **Documentation**: [Full Docs](./packages/azure-functions-openapi/README.md) + +--- + +
+ +**Built with โค๏ธ by the Apvee Team** + +