-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(doc): Improve documentation generation and display (#64)
* Create new documentation architecture * Rename documentation folder to doc
- Loading branch information
1 parent
c42aaf1
commit 0bc292f
Showing
103 changed files
with
651 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
name: Documentation service build CI | ||
# This workflow is triggered on pushes to the /microservices/documentation/app/ directory. | ||
name: doc service build CI | ||
# This workflow is triggered on pushes to the /microservices/doc/app/ directory. | ||
# The workflow does not trigger on main and pre-prod branch | ||
on: | ||
push: | ||
paths: | ||
- 'microservices/documentation/app/**' | ||
- 'microservices/doc/app/**' | ||
branches-ignore: | ||
- master | ||
|
||
jobs: | ||
build: | ||
name: Docker Build Documentation | ||
name: Docker Build doc | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build Documentation Docker image | ||
- name: Build doc Docker image | ||
# Official docker action: https://github.com/docker/build-push-action | ||
uses: docker/build-push-action@v1.1.0 | ||
with: | ||
# github.repository -> alexandr-io/backend | ||
repository: ${{github.repository}} | ||
path: microservices/documentation/app | ||
path: microservices/doc/app | ||
push: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
merged/**.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/go-openapi/runtime/middleware" | ||
"github.com/gofiber/fiber/v2" | ||
"github.com/valyala/fasthttp/fasthttpadaptor" | ||
) | ||
|
||
const auth = "auth" | ||
|
||
func wrapAuthDocHandler() func(ctx *fiber.Ctx) error { | ||
swaggerHandler := middleware.Redoc(fillRedocOpts(auth), nil) | ||
|
||
return func(ctx *fiber.Ctx) error { | ||
fasthttpadaptor.NewFastHTTPHandler(swaggerHandler)(ctx.Context()) | ||
return nil | ||
} | ||
} | ||
|
||
func mergeAuthFiles(ctx *fiber.Ctx) error { | ||
if err := mergeDocsFiles(ctx, auth); err != nil { | ||
return err | ||
} | ||
return ctx.Next() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
openapi: 3.0.2 | ||
info: | ||
description: "Documentation for the Alexandrio's AUTH microsecervice REST API\n\n | ||
<b>You can find the documentation of the others MS in these pages:</b>\n\n | ||
<a href=\"{{ .Auth }}\" class=\"sc-fzooss bFAotz\">Auth</a> | ||
<a href=\"{{ .User }}\" class=\"sc-fzooss bFAotz\">User</a> | ||
<a href=\"{{ .Library }}\" class=\"sc-fzooss bFAotz\">Library</a> | ||
<a href=\"{{ .Media }}\" class=\"sc-fzooss bFAotz\">Media</a>" | ||
version: v1 | ||
title: AUTH Documentation | ||
tags: | ||
- name: AUTHENTICATION | ||
- name: INVITATION | ||
- name: RESET PASSWORD | ||
description: "Schema of reset password workflow: <img src=\"https://i.imgur.com/qrqkPtO.png\" />" | ||
paths: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,4 @@ paths: | |
- url: //auth.preprod.alexandrio.cloud | ||
description: Preprod server | ||
tags: | ||
- AUTH | ||
- AUTHENTICATION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,4 @@ paths: | |
- url: //auth.preprod.alexandrio.cloud | ||
description: Preprod server | ||
tags: | ||
- AUTH | ||
- AUTHENTICATION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,4 @@ paths: | |
- url: //auth.preprod.alexandrio.cloud | ||
description: Preprod server | ||
tags: | ||
- AUTH | ||
- AUTHENTICATION |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
microservices/documentation/app/security.yml → microservices/doc/app/auth/security.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
--- | ||
components: | ||
securitySchemes: | ||
Bearer Auth: | ||
bearerAuth: | ||
description: "Alexandrio backend is using both auth token and refresh token.\n\nThe auth token is used to access resources as an authenticated user. This token is only valid for 15 minutes for security purposes. \nThe auth token is given by the [`/register`](#operation/register), [`/login`](#operation/login) and [`/auth/refresh`](#operation/refresh_token) routes. \nYou need to send the auth token as a Bearer authentication token in the header of the request to access protected routes.\n\nThe refresh token is used to get a new auth token. When the auth token is expired, you need to send this refresh token to [`/auth/refresh`](#operation/refresh_token) to get a new auth and refresh token. \nThe refresh token is valid for 30 days and can be used only once. The [`/auth/refresh`](#operation/refresh_token) route return a new refresh token.\n\n<div align=\"center\">\n <img alt=\"Workflow\" src=\"https://i.imgur.com/ldrebnu.png\" />\n</div>\n<center><p style=\"font-size:11px\">Schema of the authentication workflow</p></center>\n" | ||
type: https | ||
type: http | ||
scheme: bearer | ||
bearerFormat: JWT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
openapi: 3.0.2 | ||
info: | ||
description: "Documentation for the Alexandrio's microsecervice REST API\n\n | ||
<b>You can find the documentation of the microservices in these pages:</b>\n\n | ||
<a href=\"{{ .Auth }}\" class=\"sc-fzooss bFAotz\">Auth</a> | ||
<a href=\"{{ .User }}\" class=\"sc-fzooss bFAotz\">User</a> | ||
<a href=\"{{ .Library }}\" class=\"sc-fzooss bFAotz\">Library</a> | ||
<a href=\"{{ .Media }}\" class=\"sc-fzooss bFAotz\">Media</a>" | ||
version: v1 | ||
title: Alexandrio Documentation | ||
paths: | ||
/ping: | ||
get: | ||
description: Check whether or not a service is running | ||
responses: | ||
'200': | ||
description: The service is running | ||
servers: | ||
- url: //service.alexandrio.cloud | ||
description: Production server | ||
- url: //service.preprod.alexandrio.cloud | ||
description: Preprod server | ||
tags: | ||
- PING |
2 changes: 1 addition & 1 deletion
2
microservices/documentation/app/go.mod → microservices/doc/app/go.mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module github.com/alexandr-io/backend/documentation | ||
module github.com/alexandr-io/backend/doc | ||
|
||
go 1.15 | ||
|
||
|
File renamed without changes.
Oops, something went wrong.