From 98a887825f5df8385dc14c45e7e8ce2bc49c4b87 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Fri, 31 May 2024 22:43:39 +0800 Subject: [PATCH] docs: add prepare markdown --- website/docs/dev/_category_.json | 4 ++++ website/docs/dev/prepare.md | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 website/docs/dev/_category_.json create mode 100644 website/docs/dev/prepare.md diff --git a/website/docs/dev/_category_.json b/website/docs/dev/_category_.json new file mode 100644 index 0000000..5d70c6a --- /dev/null +++ b/website/docs/dev/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Develop", + "position": 99 +} diff --git a/website/docs/dev/prepare.md b/website/docs/dev/prepare.md new file mode 100644 index 0000000..80eb562 --- /dev/null +++ b/website/docs/dev/prepare.md @@ -0,0 +1,39 @@ +--- +sidebar_position: 1 +--- + +# Prepare To Develop + +## Prepare Database which using docker + +```bash +docker run --name tianji-pg -e POSTGRES_DB=tianji -e POSTGRES_USER=tianji -e POSTGRES_PASSWORD=tianji -d postgres:15.4-alpine +``` + + +## Prepare .env file + +```bash +cp .env.example src/server/.env +``` + +config `DATABASE_URL` with `postgresql://tianji:tianji@localhost:5432/tianji?schema=public` + +Like this: + +```ini +DATABASE_URL="postgresql://tianji:tianji@localhost:5432/tianji?schema=public" +ALLOW_OPENAPI=true +``` + +## Prepare Database struct + +Now you can visit database, and you can visit + +```bash +cd src/server && pnpm db:migrate:apply +``` + +## Default Account + +Default Account is `admin`/`admin`