Skip to content

Commit b36ac2f

Browse files
feat: first commit of new version
1 parent 46dca99 commit b36ac2f

File tree

204 files changed

+16887
-3599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+16887
-3599
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
node_modules
22
.vscode
33
dist.yaml
4-
redoc-static.html
4+
redoc-static.html
5+
.DS_Store
6+
build/

Changelog.md

-10
This file was deleted.

Dockerfile

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1-
ARG APP_PATH_DEFAULT=/usr/src/app
1+
ARG APP_PATH_DEFAULT=/opt/docusaurus
22

3-
FROM node:17.6.0-alpine3.15 AS builder
3+
FROM node:lts-alpine AS base
4+
ENV FORCE_COLOR=0
5+
RUN corepack enable
6+
WORKDIR /opt/docusaurus
47

5-
ARG APP_PATH_DEFAULT
6-
7-
ENV APP_PATH ${APP_PATH_DEFAULT}
8+
FROM base AS dev
9+
WORKDIR /opt/docusaurus
10+
COPY . .
11+
EXPOSE 3000
12+
CMD ["npm", "start", "--", "--poll", "1000", "--host", "0.0.0.0"]
813

9-
RUN mkdir -p ${APP_PATH}
14+
FROM base AS builder
1015

1116
WORKDIR ${APP_PATH}
1217

13-
COPY package* ${APP_PATH}/
14-
RUN npm install
18+
COPY . .
1519

16-
COPY docs ${APP_PATH}/docs
17-
COPY openapi ${APP_PATH}/openapi
18-
COPY public ${APP_PATH}/public
20+
RUN npm ci
1921

2022
RUN npm run build
2123

22-
23-
FROM nginx:1.21.6-alpine
24+
FROM nginx:1.27.2-alpine AS prod
2425

2526
ARG APP_PATH_DEFAULT
2627

27-
COPY --from=builder ${APP_PATH_DEFAULT}/redoc-static.html /usr/share/nginx/html/docs/index.html
28-
COPY --from=builder ${APP_PATH_DEFAULT}/public/favicon.ico /usr/share/nginx/html/docs
28+
COPY --from=builder ${APP_PATH_DEFAULT}/build /usr/share/nginx/html
29+
COPY --from=builder ${APP_PATH_DEFAULT}/static/img/favicon.ico /usr/share/nginx/html/docs
30+

README.md

+8-18
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
1-
# Mconf-api-docs
1+
# Mconf API Docs
22

3-
A repository with the Redoc configuration that reads the `openapi.yaml` file and renders a documentation UI using the OpenAPI structure.
3+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
44

5-
## Code dependencies
5+
### Local Development
66

7-
To install the dependencies, run:
8-
9-
```bash
10-
$ npm install
117
```
12-
13-
## How to run
14-
15-
To run a webserver watching for changes in the OpenAPI resources, run:
16-
17-
```bash
18-
$ npm start
8+
$ docker compose up dev --build
199
```
2010

21-
## How to build
11+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
2212

23-
To build a HTML file from the documentation, run:
13+
### Build
2414

25-
```bash
26-
$ npm run build
15+
```
16+
$ docker compose up prod --build
2717
```

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

blog/2024-10-17-first-post.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: New API Docs
3+
authors: matheus-mcosta
4+
description: API Docs are now using Docusaurus
5+
---
6+
Welcome to this blog. This blog is created with [**Docusaurus 2**](https://docusaurus.io/).
7+
8+
<!-- truncate -->
9+
10+
This is my first post on Docusaurus.

blog/authors.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
matheus-mcosta:
2+
name: Matheus Costa
3+
title: LB Team
4+
url: https://github.com/matheus-mcosta
5+
image_url: https://avatars.githubusercontent.com/u/82053045?v=4
6+
# email:
7+
socials:
8+
github: matheus-mcosta

blog/tags.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
docusaurus:
2+
label: Docusaurus
3+
permalink: /docusaurus
4+
description: Docusaurus tag description

docker-compose.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "mconf-api-docs"
2+
services:
3+
dev:
4+
build:
5+
context: .
6+
target: dev
7+
image: mconf/mconf-api-docs:dev
8+
ports:
9+
- "3000:3000"
10+
volumes:
11+
- .:/opt/docusaurus
12+
environment:
13+
- NODE_ENV=development
14+
prod:
15+
build:
16+
context: .
17+
target: prod
18+
image: mconf/mconf-api-docs:latest
19+
ports:
20+
- "80:80"
21+
environment:
22+
- NODE_ENV=production

docusaurus.config.js

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
// @ts-check
2+
// `@type` JSDoc annotations allow editor autocompletion and type checking
3+
// (when paired with `@ts-check`).
4+
// There are various equivalent ways to declare your Docusaurus config.
5+
// See: https://docusaurus.io/docs/api/docusaurus-config
6+
7+
import { themes as prismThemes } from "prism-react-renderer";
8+
9+
/** @type {import('@docusaurus/types').Config} */
10+
// Read the OpenAPI spec from a local file
11+
12+
const config = {
13+
title: "Mconf",
14+
tagline: "API Documentation",
15+
favicon: "img/favicon.ico",
16+
17+
// Set the production url of your site here
18+
url: "https://api.h.elos.dev",
19+
// Set the /<baseUrl>/ pathname under which your site is served
20+
// For GitHub pages deployment, it is often '/<projectName>/'
21+
baseUrl: "/",
22+
23+
onBrokenLinks: "throw",
24+
onBrokenMarkdownLinks: "warn",
25+
26+
// Even if you don't use internationalization, you can use this field to set
27+
// useful metadata like html lang. For example, if your site is Chinese, you
28+
// may want to replace "en" with "zh-Hans".
29+
i18n: {
30+
defaultLocale: "en",
31+
locales: ["en"],
32+
},
33+
34+
presets: [
35+
[
36+
"classic",
37+
/** @type {import('@docusaurus/preset-classic').Options} */
38+
({
39+
docs: {
40+
sidebarPath: "./sidebars.js",
41+
},
42+
blog: {
43+
showReadingTime: true,
44+
feedOptions: {
45+
type: ["rss", "atom"],
46+
xslt: true,
47+
},
48+
// Useful options to enforce blogging best practices
49+
onInlineTags: "warn",
50+
onInlineAuthors: "warn",
51+
onUntruncatedBlogPosts: "warn",
52+
},
53+
theme: {
54+
customCss: "./src/css/custom.css",
55+
},
56+
}),
57+
],
58+
[
59+
"redocusaurus",
60+
{
61+
// Plugin Options for loading OpenAPI files
62+
specs: [
63+
// Pass it a path to a local OpenAPI YAML file
64+
{
65+
// Redocusaurus will automatically bundle your spec into a single file during the build
66+
spec: "/opt/docusaurus/static/openapi/openapi.yaml",
67+
route: "/api/",
68+
},
69+
],
70+
theme: {
71+
// Change with your site colors
72+
primaryColor: "#1890ff",
73+
},
74+
},
75+
],
76+
],
77+
78+
themeConfig:
79+
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
80+
({
81+
// Replace with your project's social card
82+
image: "img/docusaurus-social-card.jpg",
83+
navbar: {
84+
title: "Mconf",
85+
logo: {
86+
alt: "Mconf Logo",
87+
src: "img/logo.svg",
88+
},
89+
items: [
90+
{ to: "/blog", label: "What's new", position: "left" },
91+
{ to: "/guide", label: "Guide", position: "left" },
92+
{ to: "/api", label: "API Docs", position: "left" },
93+
],
94+
},
95+
footer: {
96+
style: "dark",
97+
links: [
98+
{
99+
title: "Links",
100+
items: [
101+
{
102+
label: "LinkedIn",
103+
href: "https://www.linkedin.com/company/mconf",
104+
},
105+
{
106+
label: "X",
107+
href: "https://x.com/mconfoficial",
108+
},
109+
{
110+
label: "Facebook",
111+
href: "https://www.facebook.com/mconfoficial/",
112+
},
113+
],
114+
},
115+
{
116+
title: "More",
117+
items: [
118+
{
119+
label: "GitHub",
120+
href: "https://github.com/mconf",
121+
},
122+
],
123+
},
124+
],
125+
copyright: `Copyright © ${new Date().getFullYear()} Mconf, Inc. Built with Docusaurus.`,
126+
},
127+
prism: {
128+
theme: prismThemes.github,
129+
darkTheme: prismThemes.dracula,
130+
},
131+
}),
132+
};
133+
134+
export default config;

openapi/openapi.yaml

-68
This file was deleted.

openapi/paths/root.yaml

-17
This file was deleted.

0 commit comments

Comments
 (0)