v2.2.1: frontend closed-source + Docker one-click deploy
- Remove frontend source code (now in private repo) - Add pre-built frontend/dist/ with Nginx serving - Simplify docker-compose.yml (no Node.js build needed) - Update README with docs index and Docker deploy guide - Add admin order list and AI analysis stats tabs - Add quick trade API routes - Clean up redundant files (package-lock.json, yarn.lock, .iml) - Add GitHub Actions workflow for frontend update automation
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# ======================================================
|
||||
# QuantDinger Frontend Build Script
|
||||
# Run this in your PRIVATE frontend repo to build and
|
||||
# sync compiled files to the open-source repo.
|
||||
#
|
||||
# Usage:
|
||||
# ./scripts/build-frontend.sh
|
||||
#
|
||||
# Prerequisites:
|
||||
# - Node.js >= 16
|
||||
# - quantdinger_vue/ source code available
|
||||
# ======================================================
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
VUE_DIR="$PROJECT_ROOT/quantdinger_vue"
|
||||
DIST_TARGET="$PROJECT_ROOT/frontend/dist"
|
||||
|
||||
echo "============================================"
|
||||
echo " QuantDinger Frontend Build"
|
||||
echo "============================================"
|
||||
|
||||
# Check if source exists
|
||||
if [ ! -d "$VUE_DIR" ]; then
|
||||
echo "ERROR: quantdinger_vue/ directory not found!"
|
||||
echo "This script should be run in the dev environment with frontend source."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build frontend
|
||||
echo "[1/3] Installing dependencies..."
|
||||
cd "$VUE_DIR"
|
||||
npm install --legacy-peer-deps
|
||||
|
||||
echo "[2/3] Building production bundle..."
|
||||
npm run build
|
||||
|
||||
# Sync dist
|
||||
echo "[3/3] Syncing dist to frontend/dist/..."
|
||||
rm -rf "$DIST_TARGET"/*
|
||||
cp -r "$VUE_DIR/dist/"* "$DIST_TARGET/"
|
||||
|
||||
echo ""
|
||||
echo "============================================"
|
||||
echo " Build complete!"
|
||||
echo " Output: frontend/dist/"
|
||||
echo " Files: $(find "$DIST_TARGET" -type f | wc -l)"
|
||||
echo " Size: $(du -sh "$DIST_TARGET" | cut -f1)"
|
||||
echo "============================================"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo " cd $PROJECT_ROOT"
|
||||
echo " git add frontend/dist/"
|
||||
echo " git commit -m 'chore: update frontend build'"
|
||||
echo " git push"
|
||||
@@ -0,0 +1,63 @@
|
||||
# ======================================================
|
||||
# [TEMPLATE] Place this in your PRIVATE frontend repo:
|
||||
# .github/workflows/build-and-deploy.yml
|
||||
#
|
||||
# This builds the Vue.js frontend and triggers the
|
||||
# open-source repo to update its frontend/dist/.
|
||||
# ======================================================
|
||||
|
||||
name: Build & Deploy Frontend
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout frontend source
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install --legacy-peer-deps
|
||||
|
||||
- name: Build production
|
||||
run: npm run build
|
||||
|
||||
- name: Package dist
|
||||
run: |
|
||||
cd dist
|
||||
tar -czf /tmp/dist.tar.gz .
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: build-${{ github.run_number }}
|
||||
files: /tmp/dist.tar.gz
|
||||
generate_release_notes: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Trigger open-source repo update
|
||||
# Replace OWNER/QuantDinger with your open-source repo
|
||||
run: |
|
||||
curl -X POST \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-H "Authorization: token ${{ secrets.OPENSOURCE_REPO_TOKEN }}" \
|
||||
https://api.github.com/repos/OWNER/QuantDinger/dispatches \
|
||||
-d '{
|
||||
"event_type": "frontend-updated",
|
||||
"client_payload": {
|
||||
"version": "'${{ github.run_number }}'",
|
||||
"sha": "'${{ github.sha }}'"
|
||||
}
|
||||
}'
|
||||
Reference in New Issue
Block a user