ゲーム感覚で習慣化を楽しむ「Rhythmate」のバックエンドです。
Rhythmate のバックエンドです。
- Express
- TypeScript
- Prisma
- postgresql
- firebase
- biome
- jest
- npm モジュールをインストールする。
$ npm i
.env.example
をコピーして.env
を配置する。
$ cp .env.example .env
http://localhost:3000
で立ち上がります。
$ npm run start:watch
ヘルスチェックのエンドポイントを叩き、サーバー及び DB が起動しているか確認します。
$ curl http://localhost:3000/v1/health
{"status":"ok","message":"Successfully connected to db"}
docker がインストールされていることを前提とします。
- コンテナを起動する。
$ make run
もしくは
$ docker compose up -d
- コンテナに接続し、ログインする
$ make it-db
$ psql -U rhyth_user -d rhyth_db
- マイグレーションを行いたい時
$ npm run migrate
- DB をリセットして、マイグレーションを行いたい時
$ npm run migrate:reset
- prisma studio を立ち上げたい時
$ npm run studio