- Node.js (v16.14 LTS)
- Yarn
- PlanetScale CLI
VSCode Extension (option)
- Type
pscale auth login
in your terminal to login to PlanetScale. - Type
pscale database create <DB name> --region ap-northeast
in your terminal to create DB. - Type
pscale connect <DB name>
in your ternimal to connect DB.If MySQL is running, there is port conflict, so type
pscale connect <DB name> --port <port number except 3306>
. - Add
DATABASE_URL="mysql://127.0.0.1:<port>/<DB name>"
andSESSION_PASSWORD=<String of 32 or more characters>
into.env
file. - Run
yarn install
in project folder. - Run
npx prisma db push
. - Run
yarn dev
and access http://localhost:3000 with your browser.Before running
yarn dev
, you should connect DB first.
To use all functionality (e.g. image upload, chat, stream), add followings into
.env
file.
NEXT_PUBLIC_CHAT_API=<Ably token>
CF_ID=<CloudFlare ID>
CF_IMAGES_TOKEN=<CloudFlare image token>
CF_STREAM_TOKEN=<CloudFlare stream token>
NEXT_PUBLIC_KAKAO_MAP=<Kakao map token>