GithubHelp home page GithubHelp logo

online-othelo's Introduction

online-othello

フロントエンドは src ディレクトリの Next.js 、バックエンドは server ディレクトリの frourio で構築された TypeScript で一気通貫開発が可能なモノレポサービス

デモ環境リンク

https://solufa.github.io/next-frourio-starter/

ローカル開発

Node.js のインストール

ローカルマシンに直接インストールする

https://nodejs.org/ja/ の左ボタン、LTS をダウンロードしてインストール

リポジトリのクローンと npm モジュールのインストール

フロントとバックエンドそれぞれに package.json があるので 2 回インストールが必要

$ npm i
$ npm i --prefix server

環境変数ファイルの作成

.env ファイルを 4 つ作成する
prisma 用の.env には自分で起動した PostgreSQL の設定を書く

$ cp .env.example .env
$ cp server/.env.example server/.env
$ cp docker/dev/.env.example docker/dev/.env
$ echo "API_DATABASE_URL=postgresql://root:root@localhost:5432/online-othello" >> server/prisma/.env

ミドルウェアのセットアップ

$ docker-compose up -d

Firebase Emulator

http://localhost:4000/auth

MinIO Console

http://localhost:9001/

PostgreSQL UI

$ cd server
$ npx prisma studio

開発サーバー起動

次回以降は以下のコマンドだけで開発できる

$ npm run notios

Web ブラウザで http://localhost:3000 を開く

開発時のターミナル表示は notios で制御している

Node.js モノレポ開発のターミナルログ混雑解消のための新作 CLI ツール notios

閉じるときは Ctrl + C を 2 回連続で入力

開発中のバグの早期発見

開発サーバー起動後のターミナルで dev > [run-p] dev:* > dev:typecheckClient (あるいはtypecheckServer) の順に開いて Enter を押すと型検査の結果が表示される
ファイルを保存するたびに更新されるのでブラウザで動かす前に型エラーを解消するとほとんどのバグがなくなる

online-othelo's People

Contributors

solufa avatar yossuli avatar

Watchers

 avatar

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.