Skip to content

hibikine/kigurumi-app

Repository files navigation

Kigu App

Vercel

This is a Next.js project bootstrapped with create-next-app.

サーバー側MySQL設定

create database if not exists kiguapp character set utf8mb4 collate utf8mb4_ja_0900_as_cs_ks;
create database if not exists kiguapp_shadow character set utf8mb4 collate utf8mb4_ja_0900_as_cs_ks;
create user if not exists kiguapp@'%' identified by 'password';
grant all privileges on kiguapp.* to kiguapp@'%';
grant all privileges on kiguapp_shadow.* to kiguapp@'%';

開発ブランチ

create database if not exists kiguapp_dev character set utf8mb4 collate utf8mb4_ja_0900_as_cs_ks;
create database if not exists kiguapp_dev_shadow character set utf8mb4 collate utf8mb4_ja_0900_as_cs_ks;
create user if not exists kiguapp_dev@'%' identified by 'password';
grant all privileges on kiguapp_dev.* to kiguapp_dev@'%';
grant all privileges on kiguapp_dev_shadow.* to kiguapp_dev@'%';

リリースブランチ

create database if not exists kiguapp_release character set utf8mb4 collate utf8mb4_ja_0900_as_cs_ks;
create database if not exists kiguapp_release_shadow character set utf8mb4 collate utf8mb4_ja_0900_as_cs_ks;
create user if not exists kiguapp_release@'%' identified by 'password';
grant all privileges on kiguapp_release.* to kiguapp_release@'%';
grant all privileges on kiguapp_release_shadow.* to kiguapp_release@'%';

アップデートテストブランチ

create database if not exists kiguapp_release_test character set utf8mb4 collate utf8mb4_ja_0900_as_cs_ks;
create database if not exists kiguapp_release_test_shadow character set utf8mb4 collate utf8mb4_ja_0900_as_cs_ks;
create user if not exists kiguapp_release_test@'%' identified by 'password';
grant all privileges on kiguapp_release_test.* to kiguapp_release_test@'%';
grant all privileges on kiguapp_release_test_shadow.* to kiguapp_release_test@'%';

Prisma Studioの起動

yarn prisma studio

マイグレーションファイルの生成

Schemaを変更した場合

  1. yarn prisma migrate dev --create-only でマイグレーションファイルだけを生成させる
  2. %s/COLLATE utf8mb4_ /COLLATE utf8mb4_ja_0900_as_cs_ks/g で置き換えする
  3. yarn prisma migrate dev を実行する

開発環境用のSSL証明書の生成

mkcertを入れる

Ubuntu環境の場合は以下の通り

sudo apt install libnss3-tools

curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
chmod +x mkcert-v*-linux-amd64
sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert

その後、認証局を生成する

cd kigurumi-app
mkcert -install

localhostの証明書を発行する

mkcert localhost

テーブル

Program

イベント内イベントなどを管理する。

原則論理削除

リンク

使用ライブラリ

Getting Started

First, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.tsx. The page auto-updates as you edit the file.

Prisma Studioの起動

yarn prisma studio

マイグレーションファイルの生成

Schemaを変更した場合

  1. yarn prisma migrate dev --create-only でマイグレーションファイルだけを生成させる
  2. %s/COLLATE utf8mb4_ /COLLATE utf8mb4_ja_0900_as_cs_ks/g で置き換えする
  3. yarn prisma migrate dev を実行する

開発環境用のSSL証明書の生成

mkcertを入れる

Ubuntu環境の場合は以下の通り

sudo apt install libnss3-tools

curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
chmod +x mkcert-v*-linux-amd64
sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert

その後、認証局を生成する

cd kigurumi-app
mkcert -install

localhostの証明書を発行する

mkcert localhost

リンク

使用ライブラリ

Getting Started

First, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.tsx. The page auto-updates as you edit the file.

API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.ts.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.