Skip to content

Commit

Permalink
Merge pull request #12 from kstm-su/feat/add-docs
Browse files Browse the repository at this point in the history
Add redoc docs
  • Loading branch information
nona-takahara authored Oct 2, 2024
2 parents 1f19508 + 240aac5 commit 5d12d41
Show file tree
Hide file tree
Showing 9 changed files with 165 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: gomod
directory: "/member-portal-backend"
schedule:
interval: "weekly"
- package-ecosystem: npm
directory: "/member-portal-frontend"
schedule:
interval: "weekly"
36 changes: 36 additions & 0 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: deploy docs

on:
push:
branches:
- main

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: "pipenv"
- name: install pipenv
run: |
python -m pip install --upgrade pip
python -m pip install pipenv
- name: lock package version
run: pipenv lock

- name: install packages
run: pipenv sync --dev

- name: copy swagger
run: |
rm -r docs/docs/swagger 2> /dev/null
cp -r -f swagger docs/docs/swagger
- run: pipenv shell mkdocs gh-deploy --force --config-file ./docs/mkdocs.yml
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

docs/docs/swagger
docs/site

.idea
14 changes: 14 additions & 0 deletions docs/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
mkdocs-material = "*"

[dev-packages]

[scripts]
serve = "mkdocs serve"
build = "mkdocs build"
deploy = "mkdocs gh-deploy"
46 changes: 46 additions & 0 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Member portalとは
kstmメンバーであることを確認し、また事務処理を簡潔化するためのポータルサイトです。

## Common
### Redoc(OpenAPI)にアクセスするには
[Redoc](redoc)

## Frontend
### Dockerでの起動方法
#### Localでビルドする場合
1. Dockerfileのあるディレクトリに移動
2. `docker build -t <image_name> .` を実行(image_nameは自由に設定)
3. `docker run -p 3000:3000 -d <image_name>` を実行
4. `http://localhost:3000` にアクセス

#### GitHub container registryからpullする場合
1. `docker pull ghcr.io/kstm-su/member-portal/frontend:latest` を実行
2. `docker run -p 3000:3000 -d ghcr.io/kstm-su/member-portal/frontend:latest` を実行
3. `http://localhost:3000` にアクセス

### Nodeでローカルで起動する場合
1. `cd member-portal-frontend` でディレクトリに移動
2. `npm install` を実行
3. `npm run dev` を実行
4. `http://localhost:3000` にアクセス


## Backend

### Dockerでの起動方法
#### Localでビルドする場合

1. Dockerfileのあるディレクトリに移動
2. `docker build -t <image_name> .` を実行(image_nameは自由に設定)
3. `docker run -p 3001:8080 -d <image_name>` を実行
4. `http://localhost:3001` にアクセス

#### GitHub container registryからpullする場合
1. `docker pull ghcr.io/kstm-su/member-portal/backend:latest` を実行
2. `docker run -p 3001:8080 -d ghcr.io/kstm-su/member-portal/backend:latest` を実行
3. `http://localhost:3001` にアクセス

### Goでローカルで起動する場合
1. `cd member-portal-backend` でディレクトリに移動
2. `go run main.go` を実行
3. `http://localhost:8080` にアクセス
10 changes: 10 additions & 0 deletions docs/docs/redoc/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Redoc Sample</title>
</head>
<body>
<redoc spec-url="../swagger/documentation.yml"></redoc>
<script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"> </script></body>
</html>
36 changes: 36 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
site_name: MemberPortal Docs
site_url: https://kstm-su.github.io/member-portal/
theme:
name: material
language: ja
logo: https://kstm.shinshu-u.ac.jp/kstm.svg
icon:
repo: fontawesome/brands/git-alt
features:
- navigation.tabs
- content.code.copy
palette:
- scheme: default
primary: amber
accent: orange
toggle:
icon: material/brightness-7
name: Switch to dark mode
- scheme: slate
primary: orange
accent: yellow
toggle:
icon: material/brightness-4
name: Switch to light mode
markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.superfences

plugins:
- search:
lang: ja
repo_url: https://github.com/kstm-su/member-portal
repo_name: kstm-su/member-portal
copyright: Copyright &copy; 2024 kstm
3 changes: 3 additions & 0 deletions docs/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rm -r docs/swagger 2> /dev/null
cp -r -f ../swagger docs/swagger
pipenv shell mkdocs serve
2 changes: 1 addition & 1 deletion swagger/components/auth/token-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ TokenData:
type: string
expires_in:
type: integer
state:
scope:
type: string
refresh_token:
type: string

0 comments on commit 5d12d41

Please sign in to comment.