docs: add prepare markdown

This commit is contained in:
moonrailgun 2024-05-31 22:43:39 +08:00
parent 0c5c993236
commit 98a887825f
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,4 @@
{
"label": "Develop",
"position": 99
}

View File

@ -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`