diff --git a/404-handler/README.md b/404-handler/README.md index 5a92c2b26b..8f2ab3ba58 100644 --- a/404-handler/README.md +++ b/404-handler/README.md @@ -1,6 +1,7 @@ --- title: 404 Handler keywords: [404, not found, handler, errorhandler, custom] +description: Custom 404 error page handling. --- # Custom 404 Not Found Handler Example diff --git a/README.md b/README.md index e8731a80ce..ef2c0d2262 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ title: 👋 Overview sidebar_position: 1 --- -# 🍳 Examples for [Fiber](https://github.com/gofiber/fiber) +# 🍳 Recipes for [Fiber](https://github.com/gofiber/fiber) **Welcome to the official Fiber cookbook**! @@ -13,85 +13,85 @@ Here you can find the most **delicious** recipes to cook delicious meals using o ## 🌽 Table of contents -- [404 Handler](./404-handler/README.md) -- [Air Live Reloading](./air/README.md) -- [Auth + Docker + Postgres + JWT](./auth-docker-postgres-jwt/README.md) -- [Auth + JWT](./auth-jwt/README.md) -- [Autocert](./autocert/README.md) -- [AWS Elastic Beanstalk](./aws-eb/README.md) -- [AWS SAM](./aws-sam/README.md) -- [AWS SAM Container](./aws-sam-container/README.md) -- [Bootstrap](./bootstrap/README.md) -- [Clean Architecture](./clean-architecture/README.md) -- [Cloud Run](./cloud-run/README.md) -- [Colly Gorm](./colly-gorm/README.md) -- [CSRF](./csrf/README.md) -- [CSRF + Session](./csrf-with-session/README.md) -- [Docker + MariaDB](./docker-mariadb-clean-arch/README.md) -- [Docker + Nginx](./docker-nginx-loadbalancer/README.md) -- [Dummy JSON Proxy](./dummyjson/README.md) -- [Entgo ORM (MySQL)](./ent-mysql/README.md) -- [Entgo Sveltekit](./entgo-sveltekit/README.md) -- [Envoy External Authorization](./envoy-extauthz/README.md) -- [File Server](./file-server/README.md) -- [Firebase Authentication](./firebase-auth/README.md) -- [Firebase Functions](./firebase-functions/README.md) -- [Firebase GCloud](./gcloud/README.md) -- [Google Cloud Firebase](./gcloud-firebase/README.md) -- [GeoIP](./geoip/README.md) -- [GeoIP + MaxMind](./geoip-maxmind/README.md) -- [GORM](./gorm/README.md) -- [GORM MySQL](./gorm-mysql/README.md) -- [GORM + PostgreSQL](./gorm-postgres/README.md) -- [Graceful shutdown](./graceful-shutdown/README.md) -- [GraphQL](./graphql/README.md) -- [gRPC](./grpc/README.md) -- [Hello World](./hello-world/README.md) -- [Heroku](./heroku/README.md) -- [Hexagonal Architecture](./hexagonal/README.md) -- [HTTPS with PKCS12 TLS](./https-pkcs12-tls/README.md) -- [HTTPS with TLS](./https-tls/README.md) -- [I18n](./i18n/README.md) -- [JWT](./jwt/README.md) -- [Kubernetes](./k8s/README.md) -- [Memgraph](./memgraph/README.md) -- [MinIO](./minio/README.md) -- [MongoDB Example](./mongodb/README.md) -- [Multiple Ports](./multiple-ports/README.md) -- [MySQL](./mysql/README.md) -- [Neo4j](./neo4j/README.md) -- [OAuth2](./oauth2/README.md) -- [Google OAuth2](./oauth2-google/README.md) -- [Optional Parameter Example](./optional-parameter/README.md) -- [Parsley](./parsley/README.md) -- [PostgreSQL](./postgresql/README.md) -- [Prefork Example](./prefork/README.md) -- [RabbitMQ](./rabbitmq/README.md) -- [React](./react-router/README.md) -- [Recover Middleware Example](./recover/README.md) -- [RSS Feed](./rss-feed/README.md) -- [Server Timing](./server-timing/README.md) -- [Sessions + SQLite3](./sessions-sqlite3/README.md) -- [Socketio](./socketio/README.md) -- [Single Page Application (SPA)](./spa/README.md) -- [Sqlboiler](./sqlboiler/README.md) -- [Sqlc](./sqlc/README.md) -- [Server-Sent Events](./sse/README.md) -- [Stream Request Body](./stream-request-body/README.md) -- [Svelte Netlify](./svelte-netlify/README.md) -- [Sveltekit Embed](./sveltekit-embed/README.md) -- [Swagger](./swagger/README.md) -- [Tableflip Example](./tableflip/README.md) -- [Template](./template/README.md) -- [Template Asset Bundling](./template-asset-bundling/README.md) -- [Todo App + Auth + GORM](./todo-app-with-auth-gorm/README.md) -- [Unit Testing](./unit-test/README.md) -- [File Upload](./upload-file/README.md) -- [URL Shortener](./url-shortener-api/README.md) -- [Validation](./validation/README.md) -- [Vercel](./vercel/README.md) -- [WebSocket](./websocket/README.md) -- [WebSocket Chat](./websocket-chat/README.md) +- [404 Handler](./404-handler/README.md) - Custom 404 error page handling. +- [Air Live Reloading](./air/README.md) - Live reloading for Go applications. +- [Auth + Docker + Postgres + JWT](./auth-docker-postgres-jwt/README.md) - Authentication with Docker, Postgres, and JWT. +- [Auth + JWT](./auth-jwt/README.md) - Simple JWT authentication. +- [Autocert](./autocert/README.md) - Automatic TLS certificate management. +- [AWS Elastic Beanstalk](./aws-eb/README.md) - Deploying to AWS Elastic Beanstalk. +- [AWS SAM](./aws-sam/README.md) - Serverless applications with AWS SAM. +- [AWS SAM Container](./aws-sam-container/README.md) - Containerized serverless applications with AWS SAM. +- [Bootstrap](./bootstrap/README.md) - Integrating Bootstrap. +- [Clean Architecture](./clean-architecture/README.md) - Implementing clean architecture in Go. +- [Cloud Run](./cloud-run/README.md) - Deploying to Google Cloud Run. +- [Colly Gorm](./colly-gorm/README.md) - Web scraping with Colly and GORM. +- [CSRF](./csrf/README.md) - Cross-Site Request Forgery (CSRF) protection. +- [CSRF + Session](./csrf-with-session/README.md) - Cross-Site Request Forgery (CSRF) protection with session management. +- [Docker + MariaDB](./docker-mariadb-clean-arch/README.md) - Dockerized MariaDB with Clean Architecture. +- [Docker + Nginx](./docker-nginx-loadbalancer/README.md) - Load balancing with Docker and Nginx. +- [Dummy JSON Proxy](./dummyjson/README.md) - Proxying dummy JSON data. +- [Entgo ORM (MySQL)](./ent-mysql/README.md) - Using Entgo ORM with MySQL +- [Entgo Sveltekit](./entgo-sveltekit/README.md) - A full-stack Todo application built using Sveltekit, Tailwind CSS, Entgo, and SQLite. +- [Envoy External Authorization](./envoy-extauthz/README.md) - External authorization with Envoy. +- [File Server](./file-server/README.md) - Serving static files. +- [Firebase Authentication](./firebase-auth/README.md) - Firebase authentication integration. +- [Firebase Functions](./firebase-functions/README.md) - Using Firebase Functions. +- [Firebase GCloud](./gcloud/README.md) - Integrating Firebase with Google Cloud. +- [Google Cloud Firebase](./gcloud-firebase/README.md) - Firebase services on Google Cloud. +- [GeoIP](./geoip/README.md) - Geolocation with GeoIP. +- [GeoIP + MaxMind](./geoip-maxmind/README.md) - Geolocation with GeoIP and MaxMind databases. +- [GORM](./gorm/README.md) - Using GORM with SQLite database. +- [GORM MySQL](./gorm-mysql/README.md) - Using GORM with MySQL database. +- [GORM + PostgreSQL](./gorm-postgres/README.md) - Using GORM with PostgreSQL database. +- [Graceful shutdown](./graceful-shutdown/README.md) - Graceful shutdown of applications. +- [GraphQL](./graphql/README.md) - Setting up a GraphQL server. +- [gRPC](./grpc/README.md) - Using Fiber as a client to a gRPC server. +- [Hello World](./hello-world/README.md) - A simple "Hello, World!" application. +- [Heroku](./heroku/README.md) - Deploying to Heroku. +- [Hexagonal Architecture](./hexagonal/README.md) - A Hexagonal Software Architecture in Golang and MongoDB. +- [HTTPS with PKCS12 TLS](./https-pkcs12-tls/README.md) - Setting up an HTTPS server with PKCS12 TLS certificates. +- [HTTPS with TLS](./https-tls/README.md) - Setting up an HTTPS server with self-signed TLS certificates. +- [I18n](./i18n/README.md) - Internationalization support. +- [JWT](./jwt/README.md) - Using JSON Web Tokens (JWT) for authentication. +- [Kubernetes](./k8s/README.md) - Deploying applications to Kubernetes. +- [Memgraph](./memgraph/README.md) - Using Memgraph. +- [MinIO](./minio/README.md) - A simple application for uploading and downloading files from MinIO. +- [MongoDB](./mongodb/README.md) - Connecting to a MongoDB database. +- [Multiple Ports](./multiple-ports/README.md) - Running an application on multiple ports. +- [MySQL](./mysql/README.md) - Connecting to a MySQL database. +- [Neo4j](./neo4j/README.md) - Connecting to a Neo4j database. +- [OAuth2](./oauth2/README.md) - Implementing OAuth2 authentication. +- [Google OAuth2](./oauth2-google/README.md) - Implementing Google OAuth2 authentication. +- [Optional Parameter](./optional-parameter/README.md) - Handling optional parameters. +- [Parsley](./parsley/README.md) - Using Parsley for dependency injection in an application. +- [PostgreSQL](./postgresql/README.md) - Connecting to a PostgreSQL database. +- [Prefork](./prefork/README.md) - Running an application in prefork mode. +- [RabbitMQ](./rabbitmq/README.md) - Using RabbitMQ. +- [React](./react-router/README.md) - Using React. +- [Recover Middleware](./recover/README.md) - Recover middleware for error handling. +- [RSS Feed](./rss-feed/README.md) - Generating an RSS feed. +- [Server Timing](./server-timing/README.md) - Adding Server Timing headers to an application. +- [Sessions + SQLite3](./sessions-sqlite3/README.md) - Using SQLite3 as a storage engine for user sessions. +- [Socketio](./socketio/README.md) - A chatroom application using Socket.IO. +- [Single Page Application (SPA)](./spa/README.md) - Setting up a Single Page Application (SPA) using React for the frontend and Go for the backend. +- [Sqlboiler](./sqlboiler/README.md) - Using Sqlboiler ORM. +- [Sqlc](./sqlc/README.md) - Using Sqlc to generate Go code from SQL queries. +- [Server-Sent Events](./sse/README.md) - Implementing Server-Sent Events in an application. +- [Stream Request Body](./stream-request-body/README.md) - Streaming request bodies. +- [Svelte Netlify](./svelte-netlify/README.md) - Deploying a Svelte application on Netlify. +- [Sveltekit Embed](./sveltekit-embed/README.md) - A full-stack application built using Sveltekit and Tailwind CSS. +- [Swagger](./swagger/README.md) - Generate Swagger documentation for your application. +- [Tableflip Example](./tableflip/README.md) - Use tableflip for graceful upgrades in a Go application. +- [Template](./template/README.md) - Setting up a Go application with template rendering. +- [Template Asset Bundling](./template-asset-bundling/README.md) - Setting up a Go application with template rendering and asset bundling. +- [Todo App + Auth + GORM](./todo-app-with-auth-gorm/README.md) - A Todo application with authentication using GORM. +- [Unit Testing](./unit-test/README.md) - Writing unit tests for a Go Fiber application. +- [File Upload](./upload-file/README.md) - Handling file uploads in a Go application. +- [URL Shortener](./url-shortener-api/README.md) - URL shortening service with a simple API. +- [Validation](./validation/README.md) - Input validation using go-playground/validator. +- [Vercel](./vercel/README.md) - Deploy a Go application to Vercel. +- [WebSocket](./websocket/README.md) - Real-time communication application using WebSockets. +- [WebSocket Chat](./websocket-chat/README.md) - Real-time chat application using WebSockets. ## 👩‍🍳 Have a delicious recipe? diff --git a/air/README.md b/air/README.md index 35c5a1fe41..cfcb48c171 100644 --- a/air/README.md +++ b/air/README.md @@ -1,13 +1,14 @@ --- title: Air Live Reloading keywords: [air, live reloading, development, air tool, hot reload, watch, changes] +description: Live reloading for Go applications. --- # Live Reloading with Air Example [![Github](https://img.shields.io/static/v1?label=&message=Github&color=2ea44f&style=for-the-badge&logo=github)](https://github.com/gofiber/recipes/tree/master/air) [![StackBlitz](https://img.shields.io/static/v1?label=&message=StackBlitz&color=2ea44f&style=for-the-badge&logo=StackBlitz)](https://stackblitz.com/github/gofiber/recipes/tree/master/air) -This example demonstrates how to set up live reloading for a Go application using the [Air](https://github.com/cosmtrek/air) tool. The purpose of this example is to show how to automatically reload your application during development whenever you make changes to the source code. +This example demonstrates how to set up live reloading for a Go application using the [Air](https://github.com/air-verse/air) tool. The purpose of this example is to show how to automatically reload your application during development whenever you make changes to the source code. ## Description @@ -17,7 +18,7 @@ Live reloading is a useful feature during development as it saves time by automa - [Go](https://golang.org/dl/) 1.18 or higher - [Git](https://git-scm.com/downloads) -- [Air](https://github.com/cosmtrek/air) +- [Air](https://github.com/air-verse/air) ## Setup @@ -93,6 +94,6 @@ This example provides a basic setup for live reloading a Go application using Ai ## References -- [Air Documentation](https://github.com/cosmtrek/air) +- [Air Documentation](https://github.com/air-verse/air) - [Fiber Documentation](https://docs.gofiber.io) - [GitHub Repository](https://github.com/gofiber/fiber) diff --git a/auth-docker-postgres-jwt/README.md b/auth-docker-postgres-jwt/README.md index 1e66dcf3a8..102cbdd1f5 100644 --- a/auth-docker-postgres-jwt/README.md +++ b/auth-docker-postgres-jwt/README.md @@ -1,6 +1,7 @@ --- title: Auth + Docker + Postgres + JWT keywords: [auth, docker, postgres, jwt] +description: Authentication with Docker, Postgres, and JWT. --- # Auth Docker Postgres JWT Example diff --git a/auth-jwt/README.md b/auth-jwt/README.md index 4335e100a7..26c1552de7 100644 --- a/auth-jwt/README.md +++ b/auth-jwt/README.md @@ -1,6 +1,7 @@ --- title: Auth + JWT keywords: [auth, jwt, gorm, fiber] +description: Simple JWT authentication. --- # Auth JWT Example diff --git a/autocert/README.md b/autocert/README.md index 7ce97ecd83..06661f7971 100644 --- a/autocert/README.md +++ b/autocert/README.md @@ -1,6 +1,7 @@ --- title: Autocert keywords: [autocert, tls, letsencrypt, ssl, https, certificate] +description: Automatic TLS certificate management. --- # Autocert Example diff --git a/aws-eb/README.md b/aws-eb/README.md index 0f66990d4f..87a32efff1 100644 --- a/aws-eb/README.md +++ b/aws-eb/README.md @@ -1,6 +1,7 @@ --- title: AWS Elastic Beanstalk keywords: [aws, elastic beanstalk, deploy, amazon, aws-eb] +description: Deploying to AWS Elastic Beanstalk. --- # AWS Elastic Beanstalk Example diff --git a/aws-sam-container/README.md b/aws-sam-container/README.md index c79ff82cb0..f8b581e73f 100644 --- a/aws-sam-container/README.md +++ b/aws-sam-container/README.md @@ -1,6 +1,7 @@ --- title: AWS SAM Container keywords: [aws, sam, serverless, lambda, container] +description: Containerized serverless applications with AWS SAM. --- # AWS SAM Container diff --git a/aws-sam/README.md b/aws-sam/README.md index da028de1ae..a86c071ea0 100644 --- a/aws-sam/README.md +++ b/aws-sam/README.md @@ -1,6 +1,7 @@ --- title: AWS SAM keywords: [aws, sam, serverless, lambda] +description: Serverless applications with AWS SAM. --- # AWS SAM diff --git a/bootstrap/README.md b/bootstrap/README.md index aa0f7ef5c7..f9ce7c51e1 100644 --- a/bootstrap/README.md +++ b/bootstrap/README.md @@ -1,6 +1,7 @@ --- title: Bootstrap keywords: [bootstrap, gorm, validator, env] +description: Integrating Bootstrap. --- # Bootstrap diff --git a/clean-architecture/README.md b/clean-architecture/README.md index d0c6762db5..d80b435b71 100644 --- a/clean-architecture/README.md +++ b/clean-architecture/README.md @@ -1,6 +1,7 @@ --- title: Clean Architecture keywords: [clean, architecture, fiber, mongodb, go] +description: Implementing clean architecture in Go. --- # Clean Architecture Example diff --git a/cloud-run/README.md b/cloud-run/README.md index 930a4c3ba3..4636c0336b 100644 --- a/cloud-run/README.md +++ b/cloud-run/README.md @@ -1,6 +1,7 @@ --- title: Cloud Run keywords: [cloud run, deploy, google, docker, gcp] +description: Deploying to Google Cloud Run. --- # Cloud Run Example diff --git a/colly-gorm/README.md b/colly-gorm/README.md index ee4b00486b..d50542f915 100644 --- a/colly-gorm/README.md +++ b/colly-gorm/README.md @@ -1,6 +1,7 @@ --- title: Colly Gorm keywords: [colly, gorm, postgresql] +description: Web scraping with Colly and GORM. --- # Simple Web Scraping Colly App with Fiber diff --git a/csrf-with-session/README.md b/csrf-with-session/README.md index 15e80eec08..c54abe01ee 100644 --- a/csrf-with-session/README.md +++ b/csrf-with-session/README.md @@ -1,6 +1,7 @@ --- title: CSRF + Session keywords: [csrf, security, hacking, vulnerability, session] +description: Cross-Site Request Forgery (CSRF) protection with session management. --- # CSRF-with-session Example diff --git a/csrf/README.md b/csrf/README.md index a772936ec1..207e66e3c1 100644 --- a/csrf/README.md +++ b/csrf/README.md @@ -1,6 +1,7 @@ --- title: CSRF keywords: [csrf, security, hacking, vulnerability] +description: Cross-Site Request Forgery (CSRF) protection. --- # CSRF Examples diff --git a/docker-mariadb-clean-arch/README.md b/docker-mariadb-clean-arch/README.md index d904dedcd1..e08256e42e 100644 --- a/docker-mariadb-clean-arch/README.md +++ b/docker-mariadb-clean-arch/README.md @@ -1,6 +1,7 @@ --- title: Docker + MariaDB keywords: [docker, mariadb, clean architecture, makefile] +description: Dockerized MariaDB with Clean Architecture. --- # Docker MariaDB Clean Architecture diff --git a/docker-nginx-loadbalancer/README.md b/docker-nginx-loadbalancer/README.md index b1af8d6974..a1ae7d655a 100644 --- a/docker-nginx-loadbalancer/README.md +++ b/docker-nginx-loadbalancer/README.md @@ -1,6 +1,7 @@ --- title: Docker + Nginx keywords: [docker, nginx, loadbalancer, reverse proxy] +description: Load balancing with Docker and Nginx. --- # Docker + Nginx diff --git a/dummyjson/README.md b/dummyjson/README.md index 7506f82922..be923581df 100644 --- a/dummyjson/README.md +++ b/dummyjson/README.md @@ -1,6 +1,7 @@ --- title: Dummy JSON Proxy keywords: [dummyjson, proxy, json, server] +description: Proxying dummy JSON data. --- # Simple Fiber Proxy Server diff --git a/ent-mysql/README.md b/ent-mysql/README.md index 9da67fb648..8c3b848a28 100644 --- a/ent-mysql/README.md +++ b/ent-mysql/README.md @@ -1,6 +1,7 @@ --- title: Entgo ORM (MySQL) keywords: [ent, mysql, orm, rest] +description: Using Entgo ORM with MySQL --- # Example ent ORM for fiber with MySQL diff --git a/entgo-sveltekit/README.md b/entgo-sveltekit/README.md index bafe11f03e..7cb46611af 100644 --- a/entgo-sveltekit/README.md +++ b/entgo-sveltekit/README.md @@ -1,6 +1,7 @@ --- title: Entgo Sveltekit keywords: [ent, sveltekit, tailwindcss, sqlite, rest] +description: A full-stack Todo application built using Sveltekit, Tailwind CSS, Entgo, and SQLite. --- # Todo Application diff --git a/envoy-extauthz/README.md b/envoy-extauthz/README.md index 47e4c40f8b..3e1f7b829e 100644 --- a/envoy-extauthz/README.md +++ b/envoy-extauthz/README.md @@ -1,6 +1,7 @@ --- title: Envoy External Authorization keywords: [envoy, external authorization, keyauth] +description: External authorization with Envoy. --- # Fiber as an Envoy External Authorization HTTP Service diff --git a/file-server/README.md b/file-server/README.md index 70aa55a15a..e81d3316ce 100644 --- a/file-server/README.md +++ b/file-server/README.md @@ -1,6 +1,7 @@ --- title: File Server keywords: [file server, static files] +description: Serving static files. --- # File Server Example diff --git a/firebase-auth/README.md b/firebase-auth/README.md index 0ca7810a89..311e8030bc 100644 --- a/firebase-auth/README.md +++ b/firebase-auth/README.md @@ -1,6 +1,7 @@ --- title: Firebase Authentication keywords: [firebase, authentication, middleware] +description: Firebase authentication integration. --- # Go Fiber Firebase Authentication Example diff --git a/firebase-functions/README.md b/firebase-functions/README.md index 1c70dff109..2f974a5cac 100644 --- a/firebase-functions/README.md +++ b/firebase-functions/README.md @@ -1,6 +1,7 @@ --- title: Firebase Functions keywords: [firebase, functions, deployment, gcloud, cloud] +description: Using Firebase Functions. --- # Deploying GoFiber Application to Firebase Functions diff --git a/gcloud-firebase/README.md b/gcloud-firebase/README.md index 00f141f8c8..02535fee9f 100644 --- a/gcloud-firebase/README.md +++ b/gcloud-firebase/README.md @@ -1,6 +1,7 @@ --- title: Google Cloud Firebase keywords: [firebase, gcloud, cloud run, cloud function, app engine] +description: Firebase services on Google Cloud. --- # Deploy Fiber to Google Cloud with Firebase diff --git a/gcloud/README.md b/gcloud/README.md index 8f75a0a3de..ebd33bc13c 100644 --- a/gcloud/README.md +++ b/gcloud/README.md @@ -1,6 +1,7 @@ --- title: Firebase GCloud keywords: [firebase, gcloud, cloud run, cloud function, app engine] +description: Integrating Firebase with Google Cloud. --- # Deploy Fiber to Google Cloud with Firebase diff --git a/geoip-maxmind/README.md b/geoip-maxmind/README.md index 7bde0ffcd0..3dfa3d79b3 100644 --- a/geoip-maxmind/README.md +++ b/geoip-maxmind/README.md @@ -1,6 +1,7 @@ --- title: GeoIP + MaxMind keywords: [geoip, maxmind, databases] +description: Geolocation with GeoIP and MaxMind databases. --- # GeoIP (with MaxMind databases) diff --git a/geoip/README.md b/geoip/README.md index 53f2204ef6..f4bf08b9ea 100644 --- a/geoip/README.md +++ b/geoip/README.md @@ -1,6 +1,7 @@ --- title: GeoIP keywords: [geoip, maxmind, ip] +description: Geolocation with GeoIP. --- # GeoIP Example diff --git a/gorm-mysql/README.md b/gorm-mysql/README.md index 8dfb672ba8..72f0243956 100644 --- a/gorm-mysql/README.md +++ b/gorm-mysql/README.md @@ -1,6 +1,7 @@ --- title: GORM MySQL keywords: [gorm, mysql, database, rest, api] +description: Using GORM with MySQL database. --- # GORM MySQL Example diff --git a/gorm-postgres/README.md b/gorm-postgres/README.md index bf99a60b0b..4bf5da9278 100644 --- a/gorm-postgres/README.md +++ b/gorm-postgres/README.md @@ -1,6 +1,7 @@ --- title: GORM + PostgreSQL keywords: [gorm, postgres, database] +description: Using GORM with PostgreSQL database. --- # GORM with PostgreSQL Example diff --git a/gorm/README.md b/gorm/README.md index c66f9f2021..f4359ae2ef 100644 --- a/gorm/README.md +++ b/gorm/README.md @@ -1,6 +1,7 @@ --- title: GORM keywords: [gorm, sqlite, api, rest] +description: Using GORM with SQLite database. --- # GORM Example diff --git a/graceful-shutdown/README.md b/graceful-shutdown/README.md index bc808b5e6d..1f4b0b590d 100644 --- a/graceful-shutdown/README.md +++ b/graceful-shutdown/README.md @@ -1,6 +1,7 @@ --- title: Graceful shutdown keywords: [graceful, shutdown, os/signal, channel] +description: Graceful shutdown of applications. --- # Graceful shutdown in Fiber diff --git a/graphql/README.md b/graphql/README.md index 0d7a8a939c..477e309e6e 100644 --- a/graphql/README.md +++ b/graphql/README.md @@ -1,6 +1,7 @@ --- title: GraphQL keywords: [graphql] +description: Setting up a GraphQL server. --- # GraphQL Example diff --git a/grpc/README.md b/grpc/README.md index 01594060f8..dbd3948e7f 100644 --- a/grpc/README.md +++ b/grpc/README.md @@ -1,6 +1,7 @@ --- title: gRPC keywords: [grpc, server, client] +description: Using Fiber as a client to a gRPC server. --- # Example for fiber as a client to gRPC server. diff --git a/hello-world/README.md b/hello-world/README.md index 51d57461f1..9f83620836 100644 --- a/hello-world/README.md +++ b/hello-world/README.md @@ -1,6 +1,7 @@ --- title: Hello World keywords: [hello world, golang, fiber] +description: A simple "Hello, World!" application. --- # Hello World Example diff --git a/heroku/README.md b/heroku/README.md index 9481c88373..4cfa4424fa 100644 --- a/heroku/README.md +++ b/heroku/README.md @@ -1,6 +1,7 @@ --- title: Heroku keywords: [heroku, deployment] +description: Deploying to Heroku. --- # Heroku Deployment Example diff --git a/hexagonal/README.md b/hexagonal/README.md index 1d48d4f650..ad4489a93a 100644 --- a/hexagonal/README.md +++ b/hexagonal/README.md @@ -1,6 +1,7 @@ --- title: Hexagonal Architecture keywords: [hexagonal, architecture, mongodb] +description: A Hexagonal Software Architecture in Golang and MongoDB. --- # A Hexagonal Software Architecture in Golang and MongoDB diff --git a/https-pkcs12-tls/README.md b/https-pkcs12-tls/README.md index bc8270bddc..de0572e78e 100644 --- a/https-pkcs12-tls/README.md +++ b/https-pkcs12-tls/README.md @@ -1,6 +1,7 @@ --- title: HTTPS with PKCS12 TLS keywords: [https, tls, pkcs12] +description: Setting up an HTTPS server with PKCS12 TLS certificates. --- # HTTPS with PKCS12 TLS Example diff --git a/https-tls/README.md b/https-tls/README.md index 7f3f1a0c83..fbcc0ee565 100644 --- a/https-tls/README.md +++ b/https-tls/README.md @@ -1,6 +1,7 @@ --- title: HTTPS with TLS keywords: [https, tls, ssl, self-signed] +description: Setting up an HTTPS server with self-signed TLS certificates. --- # HTTPS with TLS Example diff --git a/i18n/README.md b/i18n/README.md index 1548924c10..2d87a38816 100644 --- a/i18n/README.md +++ b/i18n/README.md @@ -1,6 +1,7 @@ --- title: I18n keywords: [i18n, go-i18n, internationalization] +description: Internationalization support. --- # Fiber with i18n diff --git a/jwt/README.md b/jwt/README.md index 0ebc6931d4..bcb0188ffc 100644 --- a/jwt/README.md +++ b/jwt/README.md @@ -1,6 +1,7 @@ --- title: JWT keywords: [jwt, json web token, authentication] +description: Using JSON Web Tokens (JWT) for authentication. --- # Fiber with JWT diff --git a/k8s/README.md b/k8s/README.md index f32879f8d0..8f8d065fd6 100644 --- a/k8s/README.md +++ b/k8s/README.md @@ -1,6 +1,7 @@ --- title: Kubernetes keywords: [kubernetes, cloud, deployment, gcloud, aws, azure] +description: Deploying applications to Kubernetes. --- # Kubernetes Example diff --git a/memgraph/README.md b/memgraph/README.md index d298c4752c..f0573bf5f8 100644 --- a/memgraph/README.md +++ b/memgraph/README.md @@ -1,6 +1,7 @@ --- title: Memgraph keywords: [memgraph, graph, database] +description: Using Memgraph. --- # Fiber and Memgraph diff --git a/minio/README.md b/minio/README.md index dd83a85b96..a10173daad 100644 --- a/minio/README.md +++ b/minio/README.md @@ -1,6 +1,7 @@ --- title: MinIO keywords: [minio, file upload, file download] +description: A simple application for uploading and downloading files from MinIO. --- # MinIO File Upload & Download Example diff --git a/mongodb/README.md b/mongodb/README.md index dde4f8af15..56bcaa7d61 100644 --- a/mongodb/README.md +++ b/mongodb/README.md @@ -1,6 +1,7 @@ --- -title: MongoDB Example +title: MongoDB keywords: [mongodb, database] +description: Connecting to a MongoDB database. --- # MongoDB Example diff --git a/multiple-ports/README.md b/multiple-ports/README.md index 1545b7d5c9..5cde22f14a 100644 --- a/multiple-ports/README.md +++ b/multiple-ports/README.md @@ -1,6 +1,7 @@ --- title: Multiple Ports keywords: [multiple ports, server, port] +description: Running an application on multiple ports. --- # Multiple Ports Example diff --git a/mysql/README.md b/mysql/README.md index c3fced94e5..fc7ee074ef 100644 --- a/mysql/README.md +++ b/mysql/README.md @@ -1,6 +1,7 @@ --- title: MySQL keywords: [mysql] +description: Connecting to a MySQL database. --- # MySQL Example diff --git a/neo4j/README.md b/neo4j/README.md index 5b7d1b1608..52979e247e 100644 --- a/neo4j/README.md +++ b/neo4j/README.md @@ -1,6 +1,7 @@ --- title: Neo4j keywords: [neo4j, database] +description: Connecting to a Neo4j database. --- # Neo4j Example diff --git a/oauth2-google/README.md b/oauth2-google/README.md index ec8d743d55..eecdcdecae 100644 --- a/oauth2-google/README.md +++ b/oauth2-google/README.md @@ -1,6 +1,7 @@ --- title: Google OAuth2 keywords: [oauth2, google, authentication] +description: Implementing Google OAuth2 authentication. --- # Fiber with Google OAuth2 diff --git a/oauth2/README.md b/oauth2/README.md index 3c2382e117..1d9a503662 100644 --- a/oauth2/README.md +++ b/oauth2/README.md @@ -1,7 +1,7 @@ -```markdown --- title: OAuth2 keywords: [oauth2, golang, authentication, api] +description: Implementing OAuth2 authentication. --- # OAuth2 diff --git a/optional-parameter/README.md b/optional-parameter/README.md index fada14f916..e12e4d1805 100644 --- a/optional-parameter/README.md +++ b/optional-parameter/README.md @@ -1,6 +1,7 @@ --- -title: Optional Parameter Example +title: Optional Parameter keywords: [optional, parameter] +description: Handling optional parameters. --- # Optional Parameter Example diff --git a/overview.go b/overview.go index e616d5b523..7c63028232 100644 --- a/overview.go +++ b/overview.go @@ -9,9 +9,10 @@ import ( ) var ( - titleRegex = regexp.MustCompile(`(?m)^title: (.+)`) - keywordsRegex = regexp.MustCompile(`(?m)^keywords: \[(.+)\]`) - headerRegex = regexp.MustCompile(`(?m)^# .+`) + titleRegex = regexp.MustCompile(`(?m)^title: (.+)`) + keywordsRegex = regexp.MustCompile(`(?m)^keywords: \[(.+)\]`) + descriptionRegex = regexp.MustCompile(`(?m)^description: (.+)`) + headerRegex = regexp.MustCompile(`(?m)^# .+`) ) //go:generate go run overview.go @@ -22,6 +23,7 @@ func main() { var missingReadmeDirs []string var missingTitleDirs []string var missingKeywordsDirs []string + var missingDescriptionDirs []string err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { if err != nil { @@ -34,7 +36,7 @@ func main() { return err } if _, err := os.Stat(readmePath); err == nil { - title, keywords, err := extractTitleAndKeywords(readmePath) + title, keywords, description, err := extractMetadata(readmePath) if err != nil { return err } @@ -44,10 +46,16 @@ func main() { if len(keywords) == 0 { missingKeywordsDirs = append(missingKeywordsDirs, relativePath) } + if description == "" { + missingDescriptionDirs = append(missingDescriptionDirs, relativePath) + } if title == "" { title = "No title" } - toc += fmt.Sprintf("- [%s](./%s/README.md)\n", title, relativePath) + if description == "" { + description = "No description" + } + toc += fmt.Sprintf("- [%s](./%s/README.md) - %s\n", title, relativePath, description) err = addLinksToReadme(readmePath, info.Name()) if err != nil { return err @@ -102,20 +110,28 @@ func main() { } } - if len(missingReadmeDirs) > 0 || len(missingTitleDirs) > 0 || len(missingKeywordsDirs) > 0 { - fmt.Println("Error: Some directories are missing README.md files, Docusaurus title, or keywords.") + if len(missingDescriptionDirs) > 0 { + fmt.Println("Directories without Docusaurus description:") + for _, dir := range missingDescriptionDirs { + fmt.Println("-", dir) + } + } + + if len(missingReadmeDirs) > 0 || len(missingTitleDirs) > 0 || len(missingKeywordsDirs) > 0 || len(missingDescriptionDirs) > 0 { + fmt.Println("Error: Some directories are missing README.md files, Docusaurus title, keywords, or description.") os.Exit(1) } } -func extractTitleAndKeywords(readmePath string) (string, []string, error) { +func extractMetadata(readmePath string) (string, []string, string, error) { content, err := os.ReadFile(readmePath) if err != nil { - return "", nil, err + return "", nil, "", err } titleMatches := titleRegex.FindSubmatch(content) keywordsMatches := keywordsRegex.FindSubmatch(content) + descriptionMatches := descriptionRegex.FindSubmatch(content) var title string if len(titleMatches) > 1 { @@ -130,7 +146,12 @@ func extractTitleAndKeywords(readmePath string) (string, []string, error) { } } - return title, keywords, nil + var description string + if len(descriptionMatches) > 1 { + description = strings.TrimSpace(string(descriptionMatches[1])) + } + + return title, keywords, description, nil } func addLinksToReadme(readmePath, dirName string) error { diff --git a/parsley/README.md b/parsley/README.md index ad78d267f3..f7e652434e 100644 --- a/parsley/README.md +++ b/parsley/README.md @@ -1,6 +1,7 @@ --- title: Parsley keywords: [parsley, dependency injection, di, inversion of control, ioc] +description: Using Parsley for dependency injection in an application. --- # Fiber with Dependency Injection (via Parsley) diff --git a/postgresql/README.md b/postgresql/README.md index 7f28692aee..494bb4f985 100644 --- a/postgresql/README.md +++ b/postgresql/README.md @@ -1,6 +1,7 @@ --- title: PostgreSQL keywords: [postgresql] +description: Connecting to a PostgreSQL database. --- # PostgreSQL Example diff --git a/prefork/README.md b/prefork/README.md index ed713bf370..1f6bfa7e90 100644 --- a/prefork/README.md +++ b/prefork/README.md @@ -1,6 +1,7 @@ --- -title: Prefork Example +title: Prefork keywords: [prefork] +description: Running an application in prefork mode. --- # Prefork Example diff --git a/rabbitmq/README.md b/rabbitmq/README.md index e294d8fa5d..16f03d8678 100644 --- a/rabbitmq/README.md +++ b/rabbitmq/README.md @@ -1,6 +1,7 @@ --- title: RabbitMQ keywords: [rabbitmq, amqp, messaging, queue] +description: Using RabbitMQ. --- # Fiber and RabbitMQ example diff --git a/react-router/README.md b/react-router/README.md index c1a2d4fc74..25642bf463 100644 --- a/react-router/README.md +++ b/react-router/README.md @@ -1,6 +1,7 @@ --- title: React keywords: [react, react-router, client-side, spa, docker] +description: Using React. --- # React Fiber diff --git a/recover/README.md b/recover/README.md index 5a139b1427..a970b40261 100644 --- a/recover/README.md +++ b/recover/README.md @@ -1,6 +1,7 @@ --- -title: Recover Middleware Example +title: Recover Middleware keywords: [recover, middleware] +description: Recover middleware for error handling. --- # Recover Middleware Example diff --git a/rss-feed/README.md b/rss-feed/README.md index 18a491766f..3a3d727ca5 100644 --- a/rss-feed/README.md +++ b/rss-feed/README.md @@ -1,6 +1,7 @@ --- title: RSS Feed keywords: [rss, feed] +description: Generating an RSS feed. --- # RSS Feed diff --git a/server-timing/README.md b/server-timing/README.md index 57cf25de32..3321f6c2c7 100644 --- a/server-timing/README.md +++ b/server-timing/README.md @@ -1,6 +1,7 @@ --- title: Server Timing keywords: [server timing] +description: Adding Server Timing headers to an application. --- # Server Timing diff --git a/sessions-sqlite3/README.md b/sessions-sqlite3/README.md index 6426f0e1e6..4ad68b82ef 100644 --- a/sessions-sqlite3/README.md +++ b/sessions-sqlite3/README.md @@ -1,6 +1,7 @@ --- title: Sessions + SQLite3 keywords: [sessions, sqlite3, storage] +description: Using SQLite3 as a storage engine for user sessions. --- # Sessions - SQLite3 diff --git a/socketio/README.md b/socketio/README.md index 20edb8040f..415e896211 100644 --- a/socketio/README.md +++ b/socketio/README.md @@ -1,6 +1,7 @@ --- title: Socketio keywords: [websocket, chat, socketio, chatroom, contrib] +description: A chatroom application using Socket.IO. --- # WebSocket Chat Example diff --git a/spa/README.md b/spa/README.md index ea06526827..7d9c4a2bb1 100644 --- a/spa/README.md +++ b/spa/README.md @@ -1,6 +1,7 @@ --- title: Single Page Application (SPA) keywords: [spa, react, tailwindcss, parcel] +description: Setting up a Single Page Application (SPA) using React for the frontend and Go for the backend. --- # Single Page Application (SPA) diff --git a/sqlboiler/README.md b/sqlboiler/README.md index a61b296552..500c4e439e 100644 --- a/sqlboiler/README.md +++ b/sqlboiler/README.md @@ -1,6 +1,7 @@ --- title: Sqlboiler keywords: [sqlboiler, database, docker] +description: Using Sqlboiler ORM. --- # Fiber with sqlboiler diff --git a/sqlc/README.md b/sqlc/README.md index 7bb52bbf40..5af4a32f2a 100644 --- a/sqlc/README.md +++ b/sqlc/README.md @@ -1,6 +1,7 @@ --- title: Sqlc keywords: [database, sqlc, postgresql] +description: Using Sqlc to generate Go code from SQL queries. --- # Fiber with sqlc diff --git a/sse/README.md b/sse/README.md index ebee76e764..d16be01db0 100644 --- a/sse/README.md +++ b/sse/README.md @@ -1,6 +1,7 @@ --- title: Server-Sent Events keywords: [sse, server-sent events, real-time] +description: Implementing Server-Sent Events in an application. --- # Server-Sent Events with Fiber diff --git a/stream-request-body/README.md b/stream-request-body/README.md index d315fbe83e..37da41b360 100644 --- a/stream-request-body/README.md +++ b/stream-request-body/README.md @@ -1,6 +1,7 @@ --- title: Stream Request Body keywords: [stream, request body] +description: Streaming request bodies. --- # Stream Request Body diff --git a/svelte-netlify/README.md b/svelte-netlify/README.md index c1512de5b0..8376c8634c 100644 --- a/svelte-netlify/README.md +++ b/svelte-netlify/README.md @@ -1,6 +1,7 @@ --- title: Svelte Netlify keywords: [netlify, deploy, svelte] +description: Deploying a Svelte application on Netlify. --- # Deploying fiber on Netlify diff --git a/sveltekit-embed/README.md b/sveltekit-embed/README.md index 3dad48a1b5..a5a845b686 100644 --- a/sveltekit-embed/README.md +++ b/sveltekit-embed/README.md @@ -1,6 +1,7 @@ --- title: Sveltekit Embed keywords: [sveltekit, tailwindcss, embed] +description: A full-stack application built using Sveltekit and Tailwind CSS. --- # Fiber Sveltekit Embed App diff --git a/swagger/README.md b/swagger/README.md index 983c7711fb..a681dab046 100644 --- a/swagger/README.md +++ b/swagger/README.md @@ -1,6 +1,7 @@ --- title: Swagger keywords: [swagger, api, documentation, contrib] +description: Generate Swagger documentation for your application. --- # Swagger API Documentation diff --git a/tableflip/README.md b/tableflip/README.md index 59087458e9..f269ebddc3 100644 --- a/tableflip/README.md +++ b/tableflip/README.md @@ -1,6 +1,7 @@ --- title: Tableflip Example keywords: [tableflip, golang, graceful upgrade] +description: Use tableflip for graceful upgrades in a Go application. --- # Tableflip Example diff --git a/template-asset-bundling/README.md b/template-asset-bundling/README.md index daf0925855..025ded5fd9 100644 --- a/template-asset-bundling/README.md +++ b/template-asset-bundling/README.md @@ -1,6 +1,7 @@ --- title: Template Asset Bundling keywords: [template, tailwindcss, parcel] +description: Setting up a Go application with template rendering and asset bundling. --- # Template Asset Bundling diff --git a/template/README.md b/template/README.md index dfbc333e69..d51f3d5094 100644 --- a/template/README.md +++ b/template/README.md @@ -1,6 +1,7 @@ --- title: Template keywords: [template, tailwindcss, parcel] +description: Setting up a Go application with template rendering. --- # Template Project diff --git a/todo-app-with-auth-gorm/README.md b/todo-app-with-auth-gorm/README.md index 5cc5dcac17..2d6e371e9a 100644 --- a/todo-app-with-auth-gorm/README.md +++ b/todo-app-with-auth-gorm/README.md @@ -1,6 +1,7 @@ --- title: Todo App + Auth + GORM keywords: [todo app, gorm, authentication] +description: A Todo application with authentication using GORM. --- # Todo App with Auth using GORM diff --git a/unit-test/README.md b/unit-test/README.md index 27c4b2e4f0..9ff5c056ce 100644 --- a/unit-test/README.md +++ b/unit-test/README.md @@ -1,6 +1,7 @@ --- title: Unit Testing keywords: [unit testing, testing, stretchr/testify] +description: Writing unit tests for a Go Fiber application. --- # Unit Testing Example diff --git a/upload-file/README.md b/upload-file/README.md index 2ce496c12a..6c2057b552 100644 --- a/upload-file/README.md +++ b/upload-file/README.md @@ -1,6 +1,7 @@ --- title: File Upload keywords: [file upload, upload, form, multipart] +description: Handling file uploads in a Go application. --- # File Upload Example diff --git a/url-shortener-api/README.md b/url-shortener-api/README.md index 3ced490be4..bd20f3ab6d 100644 --- a/url-shortener-api/README.md +++ b/url-shortener-api/README.md @@ -1,6 +1,7 @@ --- title: URL Shortener keywords: [url shortener, redis, api] +description: URL shortening service with a simple API. --- # URL Shortener API diff --git a/validation/README.md b/validation/README.md index 1a1fe73aac..64095036a1 100644 --- a/validation/README.md +++ b/validation/README.md @@ -1,6 +1,7 @@ --- title: Validation keywords: [validation, input, go-playground, validator] +description: Input validation using go-playground/validator. --- # Validation with [Fiber](https://gofiber.io) diff --git a/vercel/README.md b/vercel/README.md index 8344dd5132..190e995d25 100644 --- a/vercel/README.md +++ b/vercel/README.md @@ -1,6 +1,7 @@ --- title: Vercel keywords: [vercel, deploy, serverless] +description: Deploy a Go application to Vercel. --- # Vercel Example diff --git a/websocket-chat/README.md b/websocket-chat/README.md index 3c4b75d3e4..3841440401 100644 --- a/websocket-chat/README.md +++ b/websocket-chat/README.md @@ -1,6 +1,7 @@ --- title: WebSocket Chat keywords: [websocket, chat, chatroom, contrib] +description: Real-time chat application using WebSockets. --- # WebSocket Chat Example diff --git a/websocket/README.md b/websocket/README.md index 426cc5ef21..4cd23d0074 100644 --- a/websocket/README.md +++ b/websocket/README.md @@ -1,6 +1,7 @@ --- title: WebSocket keywords: [websocket, real-time, chat, contrib] +description: Real-time communication application using WebSockets. --- # WebSocket Example