diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..9107b3f --- /dev/null +++ b/.github/dependabot.yml @@ -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" \ No newline at end of file diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml new file mode 100644 index 0000000..9b8128b --- /dev/null +++ b/.github/workflows/docs-deploy.yml @@ -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 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6879dab --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ + +docs/docs/swagger +docs/site + +.idea \ No newline at end of file diff --git a/docs/Pipfile b/docs/Pipfile new file mode 100644 index 0000000..8a121dd --- /dev/null +++ b/docs/Pipfile @@ -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" diff --git a/docs/docs/index.md b/docs/docs/index.md new file mode 100644 index 0000000..e8325b3 --- /dev/null +++ b/docs/docs/index.md @@ -0,0 +1,46 @@ +# Member portalとは +kstmメンバーであることを確認し、また事務処理を簡潔化するためのポータルサイトです。 + +## Common +### Redoc(OpenAPI)にアクセスするには +[Redoc](redoc) + +## Frontend +### Dockerでの起動方法 +#### Localでビルドする場合 +1. Dockerfileのあるディレクトリに移動 +2. `docker build -t .` を実行(image_nameは自由に設定) +3. `docker run -p 3000:3000 -d ` を実行 +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は自由に設定) +3. `docker run -p 3001:8080 -d ` を実行 +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` にアクセス diff --git a/docs/docs/redoc/index.html b/docs/docs/redoc/index.html new file mode 100644 index 0000000..bb55c31 --- /dev/null +++ b/docs/docs/redoc/index.html @@ -0,0 +1,10 @@ + + + + + Redoc Sample + + + + + \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 0000000..4f040cb --- /dev/null +++ b/docs/mkdocs.yml @@ -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 © 2024 kstm \ No newline at end of file diff --git a/docs/start.sh b/docs/start.sh new file mode 100644 index 0000000..c8d3dc9 --- /dev/null +++ b/docs/start.sh @@ -0,0 +1,3 @@ +rm -r docs/swagger 2> /dev/null +cp -r -f ../swagger docs/swagger +pipenv shell mkdocs serve diff --git a/swagger/components/auth/token-data.yml b/swagger/components/auth/token-data.yml index 52124e7..0098f81 100644 --- a/swagger/components/auth/token-data.yml +++ b/swagger/components/auth/token-data.yml @@ -13,7 +13,7 @@ TokenData: type: string expires_in: type: integer - state: + scope: type: string refresh_token: type: string \ No newline at end of file