diff options
| author | Adam Soltys <[email protected]> | 2026-03-17 00:38:00 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-03-17 00:38:00 -0700 |
| commit | c389f73c14a7cb12b86168c4db0e9c258ccd8088 (patch) | |
| tree | 520ea67615f031e21540aa9e2b81776c420b8688 | |
| parent | c949d916ba5082fb781e19844abb3f73891d8bf0 (diff) | |
| download | coinos-server-c389f73c14a7cb12b86168c4db0e9c258ccd8088.tar.gz coinos-server-c389f73c14a7cb12b86168c4db0e9c258ccd8088.zip | |
setup script
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | compose.yml.sample | 13 | ||||
| -rwxr-xr-x | setup.sh | 50 |
3 files changed, 61 insertions, 8 deletions
@@ -7,6 +7,12 @@ This repo is the API server. The frontend is at [coinos/coinos-ui](https://githu ## Getting Started ```bash +bash <(curl -s https://raw.githubusercontent.com/coinos/coinos-server/staging/setup.sh) +``` + +Or clone and run manually: + +```bash git clone https://github.com/coinos/coinos-server.git cd coinos-server ./setup.sh diff --git a/compose.yml.sample b/compose.yml.sample index c56c668e..da4d5294 100644 --- a/compose.yml.sample +++ b/compose.yml.sample @@ -1,4 +1,17 @@ services: + ui: + image: ghcr.io/coinos/base + container_name: ui + command: "bun run dev" + environment: + - NODE_ENV=development + - API_URL=http://app:3119 + ports: + - '5173:5173' + - '24678:24678' + volumes: + - ../coinos-ui:/home/bun/app + restart: always app: image: ghcr.io/coinos/base container_name: app @@ -36,6 +36,20 @@ warn() { echo -e " ${YELLOW}!${NC} $*"; } err() { echo -e " ${RED}✗${NC} $*"; } step() { echo -e "\n${BOLD}${GREEN}▸ $*${NC}"; } +# Bootstrap: if run via curl (not from inside the repo), clone first +if [ ! -f "compose.yml.sample" ]; then + REPO_DIR="${COINOS_DIR:-$HOME/coinos-server}" + if [ ! -d "$REPO_DIR" ]; then + echo -e " ${BLUE}•${NC} Cloning coinos-server..." + git clone https://github.com/coinos/coinos-server.git "$REPO_DIR" + cd "$REPO_DIR" + git checkout staging 2>/dev/null || true + else + cd "$REPO_DIR" + fi + exec bash "$REPO_DIR/setup.sh" "$@" +fi + DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$DIR" @@ -275,18 +289,38 @@ setup_network() { install_deps() { step "Installing application dependencies" + # Server deps if [ -d node_modules ] && [ -d node_modules/.cache ]; then - ok "node_modules exists (run 'bun i' manually to update)" - return + ok "Server node_modules exists" + else + info "Running bun install for server..." + docker run --rm \ + -v "$DIR":/home/bun/app \ + -w /home/bun/app \ + ghcr.io/coinos/base bun i + ok "Server dependencies installed" fi - info "Running bun install (via Docker)..." - docker run --rm \ - -v "$DIR":/home/bun/app \ - -w /home/bun/app \ - ghcr.io/coinos/base bun i + # UI deps + local ui_dir="$DIR/../coinos-ui" + if [ ! -d "$ui_dir" ]; then + info "Cloning coinos-ui..." + git clone https://github.com/coinos/coinos-ui.git "$ui_dir" 2>/dev/null || { + warn "Could not clone coinos-ui — skipping frontend setup" + return + } + fi - ok "Dependencies installed" + if [ -d "$ui_dir/node_modules" ]; then + ok "UI node_modules exists" + else + info "Running bun install for UI..." + docker run --rm \ + -v "$ui_dir":/home/bun/app \ + -w /home/bun/app \ + ghcr.io/coinos/base bun i + ok "UI dependencies installed" + fi } # ── phase 7: pull images ──────────────────────────────────────────── |
