docs: add local orbstack setup

This commit is contained in:
TerryM
2026-05-18 08:00:47 +08:00
parent 00540fbb73
commit 590eca39b4
4 changed files with 172 additions and 4 deletions

View File

@@ -4,6 +4,8 @@ Go backend for the ARK Library / ARK Database website.
If Go is new for you: start with **[docs/GO_FOR_BEGINNERS.md](docs/GO_FOR_BEGINNERS.md)**, then read **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)**.
For local Docker/OrbStack development, see **[docs/LOCAL_ORBSTACK.md](docs/LOCAL_ORBSTACK.md)**.
## What this service does
- Serves public library data under `/api`.
@@ -38,7 +40,24 @@ static/ # bundled static assets copied into uploads
## Quick local run
### 1) Start PostgreSQL
### Option A: OrbStack / Docker Compose
```bash
cd Arkie-Library-Backend
docker compose up --build
```
Then check:
```bash
curl http://localhost:8080/healthz
```
See **[docs/LOCAL_ORBSTACK.md](docs/LOCAL_ORBSTACK.md)** for details.
### Option B: Manual PostgreSQL + Go
#### 1) Start PostgreSQL
Example with Docker:
@@ -51,7 +70,7 @@ docker run --name ark-postgres \
-d postgres:16
```
### 2) Apply schema once
#### 2) Apply schema once
`migrations/001_init.sql` is for a fresh empty database. Do not run it twice on the same DB unless you reset the DB first.
@@ -68,7 +87,7 @@ psql "$DATABASE_URL" -f migrations/002_wallet_auth.sql
export RUN_WALLET_AUTH_SCHEMA=false
```
### 3) Configure env
#### 3) Configure env
Copy the example and edit values as needed:
@@ -78,7 +97,7 @@ cp .env.example .env
This project does not auto-load `.env`; either export variables in your shell or run with a dotenv helper.
### 4) Run the server
#### 4) Run the server
```bash
go run ./cmd/server