Git Product home page Git Product logo

mr-unred-back's Introduction

MR-UNRED-BACK

会議室予約システムのバックエンドサーバー

MR-UNRED-BACKは会議室予約システムのバックエンドサーバーを提供します。
フロントエンドにはこちらをご利用ください。

提供中API

会議室予約API
会議室情報API

環境構築

  1. Sailを使ってコンテナを起動
  2. データベースの構築

aliasの登録

オプションですが、sailコマンドを簡単に使えるようにaliasを設定しておくと良いです。
以降では、alias設定がされている前提で記述します。
以前追加したaliasがある場合、削除してから行ってください
使用しているshell毎に保存先は変更してください。(Ubuntuのデフォルトはbashです)

echo "alias sail='[ -f sail ] && bash sail'" >> ~/.bashrc

使っているshellの設定ファイルを再読込します。

source ~/.bashrc

Sailを使ってコンテナを起動

src/.envを作成

`.env`のサンプル
APP_NAME=MR-UNRED
APP_SERVICE="mr-unred"
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://mr-unred
CLIENT_BASE_URL=http://localhost:3000

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=mr_unred
DB_USERNAME=mr_unred
DB_PASSWORD='mr_unred'

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=memcached

REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=

AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

SCOUT_DRIVER=meilisearch
MEILISEARCH_HOST=http://meilisearch:7700

サンプル内のパスワード等は変更することをおすすめします。

ビルド

Sailコマンドを使ってDockerイメージを作成します。

sail build --no-cache

コンテナの起動

Sailコマンドを使ってDockerコンテナを起動します。
途中でError laravel.testみたいに出てきますが、問題ないので無視して下さい。

sail up -d

laravelのインストール

Sail + Composer を使ってlaravelをインストールします・

sail composer install

APP_KEYの生成

Sail + Artisan を使用して.env内のAPP_KEYを生成します。

sail artisan key:generate

コンテナの再起動

Sailを使用して、コンテナを再起動してください。

sail restart

データベースの構築

sailコマンドを使ってデータベースを構築します。
コンテナが起動している状態で、

sail artisan migrate
sail artisan db:seed

を行ってください。

データベースの再構築

sailコマンドを使ってデータベースを再構築します。
コンテナが起動している状態で、

sail artisan migrate:fresh
sail artisan db:seed

を行ってください。

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.