Giter Site home page Giter Site logo

sls-web-template's Introduction

インストール

# nvm install
# https://github.com/nvm-sh/nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

# node.jsの最新のltsをインストール
nvm install --lts
nvm use --lts
node -v
npm -v

# npm update
npm update -g npm

# serverless install
cd sls-web-template
npm install

デプロイ

STAGE_NAME=mi1

# プロファイル作成
cp ./profile/sample.yml ./profile/${STAGE_NAME}.yml
vim ./profile/${STAGE_NAME}.yml

# デプロイ
./bin/deploy.sh --stage mi1

開発環境

開発サーバー起動

# 開発用イメージビルド
./bin/build.sh

# 開発用データベース起動
./bin/run-mysql.sh -d

# テスト
./bin/test.sh

# アプリ起動
./bin/run.sh -e local.env

# アクセス
# http://localhost:3000/
# http://localhost:8000/api/docs

テスト

# 開発用イメージビルド
./bin/build.sh

# 開発用データベース起動
./bin/run-mysql.sh -d

# テスト
./bin/test.sh

運用

オペレーションshell起動

# 開発用データベース起動
./bin/run-mysql.sh -d

# オペレーション用shell起動
./bin/shell.sh -e <ENV_PATH>

マイグレーション(オペレーションshell内での操作)

# DB作成
./bin/lib/create-database.sh

# マイグレーション: 履歴確認
./bin/lib/alembic.sh history -v

# マイグレーション: 最新バージョンにアップグレード
./bin/lib/alembic.sh upgrade head

# マイグレーション: 次のバージョンにアップグレード
./bin/lib/alembic.sh upgrade +1

# マイグレーション: 最初のバージョンにダウングレード
./bin/lib/alembic.sh downgrade base

# マイグレーション: 次のバージョンにダウングレード
./bin/lib/alembic.sh downgrade -1

# マイグレーション: マイグレーションファイル生成
./bin/lib/alembic.sh revision --autogenerate -m "message"

DBログイン(オペレーションshell内での操作)

# DB作成
./bin/lib/create-database.sh

# mysql ログイン
./bin/lib/mysql.sh

マネジメントコマンド(オペレーションshell内での操作)

# ヘルプ
./bin/lib/manage.sh

# スーパーユーザー作成
./bin/lib/manage.sh create_user admin --superuser

# 通常ユーザー作成
./bin/lib/manage.sh create_user user1
./bin/lib/manage.sh create_user user2

# ロール作成
./bin/lib/manage.sh create_role ItemAdminRole

# ロールのアタッチ
./bin/lib/manage.sh attach_role user1 ItemAdminRole

# ロールのデタッチ
./bin/lib/manage.sh detach_role user1 ItemAdminRole

sls-web-template's People

Contributors

ng3rdstmadgke avatar

Stargazers

shimada avatar

Watchers

James Cloos avatar  avatar

Forkers

vallack5296

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.