Skip to content

Commit

Permalink
docs: switched to docusaurus;
Browse files Browse the repository at this point in the history
  • Loading branch information
alexronquillo authored and j4k4 committed Sep 11, 2023
1 parent 9b64c30 commit 77cc3b1
Show file tree
Hide file tree
Showing 120 changed files with 25,735 additions and 911 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/docusaurus-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy to GitHub Pages

on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:

defaults:
run:
working-directory: docs

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
cache-dependency-path: '**/package-lock.json'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: docs/build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

permissions:
id-token: write
contents: read
pages: write
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
- name: Static code analysis (golangci-lint)
uses: golangci/golangci-lint-action@v3
with:
version: v1.51.2
version: v1.54.2
args: --timeout 5m --print-issued-lines --print-linter-name --disable structcheck --disable unused

go-test:
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/update_md.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
golangci-lint 1.45.2
golangci-lint 1.54.2
mockery 2.22.1
52 changes: 42 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,37 @@ challenges like configuration, logging, structured code execution, handling
http requests, asynchronous message processing, writing integration tests and
much more.

## Why use it?

- Provides an all-in-one solution for the primary use cases
- Out-of-the-box solutions for many AWS services
- Reduces a lot of needed glue and boilerplate code
- Uses a lot of sane default values to to just run code from the IDE (e.g. uses localstack instead of AWS)
- Makes it easy to build a microservice-based architecture which uses a lot of asynchronous event processing

## Key Features

- Configuration management
- Logging
- Metrics
- Tracing
- Fixture loading
- Integration tests
- Application lifecycle management
- Api server
- Consumer and producer applications
- Integrates well with AWS

## Documentation

Read our [documentation](https://justtrackio.github.io/gosoline/) to learn how to use gosoline.

## Quickstart
Every application consists of at least a main.go and config.dist.yml file. The
main file

#### main.go
Every application consists of at least a main.go and config.dist.yml file.

### main.go

[embedmd]:# (examples/application/main.go)
```go
package main
Expand Down Expand Up @@ -48,15 +74,17 @@ func (h HelloWorldModule) Run(ctx context.Context) error {
}
```

#### config.dist.yml
### config.dist.yml

```yaml
env: dev
app_project: gosoline
app_family: example
app_name: application
```
#### Output
### Output
```
14:10:10.242 main info applied priority 8 config post processor 'gosoline.log.handler_main' application: application
14:10:10.242 kernel info starting kernel application: application
Expand Down Expand Up @@ -112,20 +140,24 @@ app_name: application
14:10:10.245 kernel info leaving kernel application: application
```
#### Integration test execution
##### Linux
## Integration test execution
### Linux
On linux it's very straight to execute the integration tests:
```shell
go test -tags integration,fixtures ./test
```
##### macOS

### macOS

To run them on macOS you will (once initially and after each system update) have to execute this:

```shell
sudo ifconfig lo0 alias 172.17.0.1
```

Afterwards simply execute:

```shell
go test -tags integration,fixtures ./test
```

![Gosoline Logo](http://cdn.applike-services.info/public/2019/10/23/gosoline.svg)
20 changes: 20 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
66 changes: 66 additions & 0 deletions docs/docs/components.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import React from 'react';
import Card from '@mui/material/Card';
import CardActions from '@mui/material/CardActions';
import CardHeader from '@mui/material/CardHeader';
import CardContent from '@mui/material/CardContent';
import Button from '@mui/material/Button';
import LayersIcon from '@mui/icons-material/Layers';
import TerminalIcon from '@mui/icons-material/Terminal';
import Grid from '@mui/material/Grid';
import CloudQueueIcon from '@mui/icons-material/CloudQueue';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import { useColorMode } from '@docusaurus/theme-common'

export default function PrimaryUseCases() {
const { isDarkTheme } = useColorMode();

const darkTheme = createTheme({
palette: {
mode: isDarkTheme ? 'dark' : 'light',
}
})

return (
<ThemeProvider theme={darkTheme}>
<Grid container spacing={4}>

<Grid item xs={12} s={12} md={4}>
<Card style={{ height: '100%' }}>
<CardHeader title="API Gateway" avatar={<CloudQueueIcon />} titleTypographyProps={{variant:'h6'}} />
<CardContent>
Build REST web services with HTTP handling, caching, OAuth, and much more.
</CardContent>
<CardActions>
<Button size="small" href="/gosoline/category/api-gateway">Get started</Button>
</CardActions>
</Card>
</Grid>

<Grid item xs={12} md={4}>
<Card style={{ height: '100%' }}>
<CardHeader title="Message Queues" avatar={<LayersIcon />} titleTypographyProps={{variant:'h6'}} />
<CardContent>
Process asynchronous messages from Kafka, Redis, or any other queuing or streaming system.
</CardContent>
<CardActions>
<Button size="small" href="/gosoline/quickstart/create-a-consumer">Get started</Button>
</CardActions>
</Card>
</Grid>

<Grid item xs={12} md={4}>
<Card style={{ height: '100%' }}>
<CardHeader title="Kernel Module" avatar={<TerminalIcon />} titleTypographyProps={{variant:'h6'}} />
<CardContent>
Implement a kernel module with which you can do anything, using gosoline's logging, configuration, and other solutions.
</CardContent>
<CardActions>
<Button size="small" href="/gosoline/quickstart/create-an-application">Get started</Button>
</CardActions>
</Card>
</Grid>

</Grid>
</ThemeProvider>
)
}
8 changes: 8 additions & 0 deletions docs/docs/how-to/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "How-to guides",
"position": 3,
"link": {
"type": "generated-index",
"description": "Here, you'll learn how to do common tasks with gosoline:"
}
}
Loading

0 comments on commit 77cc3b1

Please sign in to comment.