Skip to content

Commit

Permalink
docs: init mkdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
tc-imba committed Jun 8, 2024
1 parent 847e757 commit fa31da5
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ci
on:
push:
branches:
- master
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
1 change: 1 addition & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Configuration
43 changes: 43 additions & 0 deletions docs/deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Deployment

## Clone the repositories

First, we need to clone `brick-server-minimal`, `brick-server-playground`, `brick-server-frontend`, and `genie-brickified` repos into a same directory.

```bash
mkdir brick
git clone https://github.com/BrickSchema/brick-example-server
git clone https://github.com/BrickSchema/playground
git clone
```

## Configuration

Create a `.env` file in the playground directory. The file can be used to configure the playground server.
The detailed configurable items can be found [here](config.md).

```bash
cd playground
touch .env

```

## Deploy the server

=== "Docker (recommended)"

In the playground directory, run

```bash
docker-compose up --build -d # (1)!
```

1. make sure the context is correct if not using `docker-compose` but `docker build`
and make sure the `docker-compose` version is at least `v2`

=== "Direct"

(Not yet completed)

Then, open `http://localhost:9000/brickapi/v1/docs`. If the swagger API page is shown, congratulations!
Now you can move to the [next step](init.md) in initialize playground.
Empty file added docs/index.md
Empty file.
29 changes: 29 additions & 0 deletions docs/init.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Initialization

## Register admin user

=== "Username / Password"



=== "Google OAuth2"

Before using this, ensure that you have setup [Google OAuth2](config.md) in the configuration.

Use the API `/brickapi/v1/auth/cookie/google/authorize` and the API will return a json response in the format

```json
{
"authorization_url": "https://accounts.google.com/o/oauth2/v2/auth?foo=bar"
}
```

Open `authorization_url` in the browser and continue with your google account.
The page will be redirected back to the `FRONTEND_URL` entry in configuration.
By default, it is the url of the Swagger API if you didn't set it.

!!! note

You can also register the admin user in the frontend.
We recommand to do it in the Swagger API for convenience of debugging the setup.

20 changes: 20 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
theme:
name: material
features:
- content.code.copy
- content.code.annotate
site_name: Brick Server Playground
docs_dir: docs
markdown_extensions:
- admonition
- pymdownx.details
- pymdownx.highlight:
anchor_linenums: true
use_pygments: true
pygments_lang_class: true
# auto_title: true
# linenums: true
- pymdownx.inlinehilite
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true

0 comments on commit fa31da5

Please sign in to comment.