Skip to content

Commit ac59245

Browse files
authored
Merge pull request #1 from mikros-dev/refactor/update_documentation
Refactor/update documentation
2 parents 9bdb4d3 + 387a773 commit ac59245

Some content is hidden

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

47 files changed

+2109
-2137
lines changed

.vitepress/config.mts

Lines changed: 74 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,82 @@
1-
import { defineConfig, type UserConfig } from 'vitepress'
2-
import { withSidebar } from 'vitepress-sidebar';
3-
import { type VitePressSidebarOptions } from 'vitepress-sidebar/types';
4-
import { withI18n } from 'vitepress-i18n';
5-
import { type VitePressI18nOptions } from 'vitepress-i18n/types';
1+
import { defineConfig } from 'vitepress'
62

7-
// Base VitePress configuration
8-
const vitePressConfig: UserConfig = {
3+
// Uncomment for local tests
4+
//const BASE = '/'
5+
const BASE = `/mikros-docs/`
6+
7+
export default defineConfig({
8+
srcDir: 'src',
9+
base: BASE,
10+
11+
lang: 'en-US',
912
title: 'Mikros',
10-
description: 'Mikros docs',
11-
srcDir: './src',
12-
assetsDir: './public',
13-
rewrites: {
14-
'en/:rest*': ':rest*'
15-
},
16-
base: '/',
17-
ignoreDeadLinks: true,
18-
head: [
19-
['link', { rel: 'icon', href: '/favicon.ico' }]
20-
],
13+
description: 'An opinionated framework for Go and Rust services',
14+
2115
themeConfig: {
2216
logo: 'https://avatars.githubusercontent.com/u/146955355',
17+
nav: [
18+
{ text: 'Guide', link: '/guide/' },
19+
{ text: 'Go', link: '/go/' },
20+
{ text: 'Rust', link: '/rust/' },
21+
{
22+
text: 'Tools',
23+
items: [
24+
{ text: 'CLI', link: '/cli/' },
25+
{ text: 'Protobuf', link: '/protobuf/' },
26+
]
27+
},
28+
{ text: 'Contribute', link: '/contribute/' }
29+
],
30+
sidebar: {
31+
'/guide/': [
32+
{ text: 'What is Mikros', link: '/guide/' },
33+
{ text: 'Service definitions', link: '/guide/service-toml' },
34+
{ text: 'Lifecycle', link: '/guide/lifecycle' },
35+
{ text: 'Extending', link: '/guide/extending' },
36+
],
37+
'/go/': [
38+
{ text: 'Quickstart', link: '/go/quickstart' },
39+
{ text: 'Overview', link: '/go/overview' },
40+
{ text: 'Features', link: '/go/features' },
41+
{ text: 'New service type', link: '/go/new-service-type' },
42+
{ text: 'Testing', link: '/go/testing' },
43+
{ text: 'Examples', link: '/go/examples' },
44+
{ text: 'Roadmap', link: '/go/roadmap' },
45+
{ text: 'Reference (pkg.go.dev)', link: 'https://pkg.go.dev/github.com/mikros-dev/mikros' },
46+
],
47+
'/rust/': [
48+
{ text: 'Quickstart', link: '/rust/quickstart' },
49+
{ text: 'Overview', link: '/rust/overview' },
50+
{ text: 'Features', link: '/rust/features' },
51+
{ text: 'New service type', link: '/rust/new-service-type' },
52+
{ text: 'Macros', link: '/rust/macros' },
53+
{ text: 'Examples', link: '/rust/examples' },
54+
{ text: 'Roadmap', link: '/rust/roadmap' },
55+
{ text: 'Reference (docs.rs)', link: 'https://docs.rs/mikros' },
56+
],
57+
'/protobuf/': [
58+
{ text: 'Extensions', link: '/protobuf/extensions' },
59+
{ text: 'OpenAPI', link: '/protobuf/openapi' },
60+
],
61+
'/contribute/': [
62+
{ text: 'How to contribute', link: '/contribute/' },
63+
]
64+
},
2365
socialLinks: [
2466
{ icon: 'github', link: 'https://github.com/mikros-dev' },
2567
],
26-
}
27-
}
28-
29-
const rootLocale = 'en'
30-
const supportedLocales = [rootLocale, 'pt'];
31-
const commonSidebarConfigs: VitePressSidebarOptions = {
32-
capitalizeFirst: true,
33-
capitalizeEachWords: true,
34-
underscoreToSpace: true,
35-
}
36-
37-
const vitePressSidebarConfig: VitePressSidebarOptions[] =
38-
supportedLocales.map((lang) => {
39-
return {
40-
...commonSidebarConfigs,
41-
...(rootLocale === lang ? {} : { basePath: `/${lang}/` }),
42-
documentRootPath: `src/${lang}`,
43-
resolvePath: rootLocale === lang ? '/' : `/${lang}/`,
44-
};
45-
})
46-
47-
const vitePressI18nConfig: VitePressI18nOptions = {
48-
locales: supportedLocales,
49-
rootLocale: rootLocale,
50-
searchProvider: 'local',
51-
themeConfig: {
52-
en: {
53-
nav: [
54-
{ text: 'Home', link: '/' },
55-
{ text: 'Getting Started', link: '/getting_started/' },
56-
{ text: 'Guides', link: '/guides/service_toml' },
57-
{
58-
text: 'Documentation',
59-
items: [
60-
{ text: 'Core Concepts', link: '/guides/concepts' },
61-
{ text: 'Architecture', link: '/guides/architecture' },
62-
{ text: 'Best Practices', link: '/guides/best_practices' }
63-
]
64-
},
65-
{ text: 'API', link: '/api/' }
66-
],
68+
editLink: {
69+
pattern: 'https://github.com/mikros-dev/mikros-docs/edit/main/src/:path',
70+
text: 'Edit this page on GitHub'
6771
},
68-
pt: {
69-
nav: [
70-
{ text: 'Início', link: '/pt/' },
71-
{ text: 'Primeiros Passos', link: '/pt/getting_started/' },
72-
{ text: 'Guias', link: '/pt/guides/service_toml' },
73-
{
74-
text: 'Documentação',
75-
items: [
76-
{ text: 'Conceitos Básicos', link: '/pt/guides/concepts' },
77-
{ text: 'Arquitetura', link: '/pt/guides/architecture' },
78-
{ text: 'Melhores Práticas', link: '/pt/guides/best_practices' }
79-
]
80-
},
81-
{ text: 'API', link: '/pt/api/' }
82-
],
83-
}
84-
}
85-
};
86-
87-
88-
// https://vitepress.dev/reference/site-config
89-
export default defineConfig(
90-
withSidebar(withI18n(vitePressConfig, vitePressI18nConfig), vitePressSidebarConfig)
91-
);
72+
footer: {
73+
message: 'Mikros is MIT/MPL-2.0 licensed',
74+
copyright: '© Mikros'
75+
},
76+
outline: [2,3]
77+
},
78+
head: [
79+
['meta', { name: 'theme-color', content: '#0b0f19' }],
80+
['link', { rel: 'icon', href: 'favicon.svg' }]
81+
],
82+
})

.vitepress/tsconfig.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compilerOptions": {
3+
"module": "ESNext",
4+
"moduleResolution": "Bundler",
5+
"target": "ESNext",
6+
"lib": ["ESNext"],
7+
"strict": true,
8+
"noEmit": true,
9+
"types": ["node"]
10+
},
11+
"include": [
12+
".vitepress/**/*.ts",
13+
".vitepress/**/*.mts"
14+
]
15+
}

README.md

Lines changed: 1 addition & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -4,118 +4,7 @@
44
<img src="https://avatars.githubusercontent.com/u/146955355" alt="Mikros Logo" width="200">
55
</p>
66

7-
<p align="center">
8-
<strong>Service Orchestration Made Simple</strong>
9-
</p>
10-
11-
<p align="center">
12-
A lightweight microservices framework for modern applications
13-
</p>
14-
15-
<p align="center">
16-
<a href="https://github.com/mikros-dev/mikros/blob/main/LICENSE">
17-
<img src="https://img.shields.io/github/license/mikros-dev/mikros" alt="License">
18-
</a>
19-
<a href="https://github.com/mikros-dev/mikros/releases">
20-
<img src="https://img.shields.io/github/v/release/mikros-dev/mikros" alt="Latest Release">
21-
</a>
22-
<a href="https://github.com/mikros-dev/mikros/stargazers">
23-
<img src="https://img.shields.io/github/stars/mikros-dev/mikros" alt="GitHub stars">
24-
</a>
25-
</p>
26-
27-
## Overview
28-
29-
Mikros is an API built to facilitate and standardize the creation of applications that need to run for an indefinite period, typically running continuously, performing specific operations. It serves as an SDK that simplifies microservices development, providing a consistent approach to building and deploying services.
30-
31-
### Key Features
32-
33-
- **🚀 Easy Deployment** - Deploy your microservices with a single command. Mikros handles the complexity so you can focus on building your application.
34-
- **🔌 Service Discovery** - Automatic service discovery and registration. No need to manually configure service connections.
35-
- **🔒 Built-in Security** - Secure communication between services with built-in authentication and encryption.
36-
- **🔄 Load Balancing** - Intelligent load balancing ensures optimal resource utilization and high availability.
37-
- **📊 Monitoring & Observability** - Comprehensive monitoring tools provide insights into your microservices ecosystem.
38-
- **⚡ High Performance** - Designed for speed and efficiency, Mikros minimizes overhead to maximize your application's performance.
39-
40-
## Service Types
41-
42-
Mikros supports the following service types:
43-
44-
- **gRPC Services**: Applications with APIs defined from a **protobuf** file.
45-
- **HTTP Services**: HTTP server applications with APIs defined from a **protobuf** file.
46-
- **Native Services**: General-purpose applications without a defined API, with the flexibility to execute any code.
47-
48-
## Getting Started
49-
50-
### Prerequisites
51-
52-
- Go 1.18+
53-
- Basic understanding of microservices architecture
54-
55-
### Installation
56-
57-
```bash
58-
go get github.com/mikros-dev/mikros
59-
```
60-
61-
### Basic Usage
62-
63-
Create a simple gRPC service:
64-
65-
```go
66-
package main
67-
68-
import (
69-
"context"
70-
71-
"github.com/mikros-dev/mikros/v2"
72-
"github.com/mikros-dev/mikros/v2/components/options"
73-
)
74-
75-
type server struct {
76-
*mikros.Service
77-
}
78-
79-
func (s *server) YourMethod(ctx context.Context, req *yourpb.Request) (*yourpb.Response, error) {
80-
// Your implementation here
81-
return &yourpb.Response{}, nil
82-
}
83-
84-
func main() {
85-
svc := mikros.NewService(&mikros.ServiceOptions{
86-
Service: map[string]options.ServiceOptions{
87-
"grpc": &options.GrpcServiceOptions{
88-
ProtoServiceDescription: &yourpb.YourService_ServiceDesc,
89-
},
90-
},
91-
})
92-
93-
svc.Start(&server{})
94-
}
95-
```
96-
97-
### Configuration
98-
99-
Mikros uses a `service.toml` file for configuration. Example:
100-
101-
```toml
102-
name = "your-service"
103-
type = "grpc"
104-
version = "v0.1.0"
105-
language = "go"
106-
product = "your-product"
107-
108-
[features.tracing]
109-
enabled = true
110-
```
111-
112-
## Documentation
113-
114-
For complete documentation, visit our [official documentation site](https://mikros-dev.github.io/mikros-docs/).
115-
116-
Available in:
117-
- [English](https://mikros-dev.github.io/mikros-docs/)
118-
- [Portuguese](https://mikros-dev.github.io/mikros-docs/pt/)
7+
<h3 align="center">A lightweight microservices framework for modern applications</h3>
1198

1209
## Contributing
12110

package-lock.json

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"docs:preview": "vitepress preview"
66
},
77
"devDependencies": {
8+
"@types/node": "^24.3.0",
89
"vitepress": "^1.6.3",
910
"vitepress-i18n": "^1.3.2",
1011
"vitepress-sidebar": "^1.31.0"

src/cli/index.md

Whitespace-only changes.

src/contribute/index.md

Whitespace-only changes.

0 commit comments

Comments
 (0)