diff --git a/.env-example b/.env-example index a38635b..950b691 100644 --- a/.env-example +++ b/.env-example @@ -1,4 +1,16 @@ VITE_API=https://api.ethoradev.com/v1 +VITE_API_V2=https://api.ethoradev.com/v2 VITE_DOMAIN_NAME=ethora VITE_ROOT_DOMAIN=ethora.com -VITE_SITE_IS_PRODUCTION=true \ No newline at end of file +VITE_SITE_IS_PRODUCTION=true +VITE_STRIPE_PUBLICK_KEY=pk_test_iTgKAZ1WZinSX7NI1UTveLVu + +VITE_APP_ALLOWED_DOMAINS=app.ethora.com,ethora.ethora.com,localhost + +VITE_CLARITY_ID=q85va6v8yj +VITE_GTM_ID=GTM-NTMFZ8P +VITE_GA_ID=G-M8SFB5QEGX + +VITE_APP_XMPP_SERVICE=wss://dev.xmpp.ethoradev.com:5443/ws +VITE_XMPP_SERVICE=conference.dev.xmpp.ethoradev.com +VITE_XMPP_HOST=dev.xmpp.ethoradev.com diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4417de9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: + pull_request: + branches: [ dev ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint -- --max-warnings=0 + + - name: Typecheck + run: npm run typecheck + + - name: Build + run: npm run build + diff --git a/.github/workflows/deploy-server.yml b/.github/workflows/deploy-server.yml new file mode 100644 index 0000000..f0eb287 --- /dev/null +++ b/.github/workflows/deploy-server.yml @@ -0,0 +1,61 @@ +name: Deploy to Server (dev) + +on: + push: + branches: [dev] + pull_request: + branches: [dev] + +jobs: + build_pr: + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint -- --max-warnings=0 + + - name: Typecheck + run: npm run typecheck + + - name: Build + run: npm run build + + deploy_push: + if: github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Deploy over SSH + uses: appleboy/ssh-action@v1.1.0 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USER }} + key: ${{ secrets.SSH_KEY }} + port: ${{ secrets.SSH_PORT || 22 }} + script_stop: true + script: | + set -e + cd ${{ secrets.APP_DIR }} + git fetch --all --prune + git checkout dev || git checkout -b dev + # Force sync local dev to remote state to avoid divergence issues + git reset --hard origin/dev + git clean -fd + # Install devDependencies too (vite/ts), build static assets + npm ci --silent --no-audit --no-fund + npm run build + export NODE_ENV=production diff --git a/.gitignore b/.gitignore index 0276e3d..2bdb7f0 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ lerna-debug.log* node_modules dist +dev-dist dist-ssr *.local @@ -25,4 +26,5 @@ dist-ssr tsconfig.app.tsbuildinfo -.env \ No newline at end of file +.env +.server.data diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..209e3ef --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20 diff --git a/NODE_VERSION_FIX.md b/NODE_VERSION_FIX.md new file mode 100644 index 0000000..87a012c --- /dev/null +++ b/NODE_VERSION_FIX.md @@ -0,0 +1,73 @@ +# Node.js Version Update - dev-tf Branch + +## Changes Made + +### 1. Node.js Version Upgrade +- **Installed Node.js 20.19.6** (via nvm) +- **Previous version:** Node.js 18.19.1 +- **Reason:** `react-router-dom@7.x` (pulled in by `@ethora/ai-chat-widget` and `@ethora/chat-component`) requires Node >=20.0.0 + +### 2. Configuration Files Added +- **`.nvmrc`** - Specifies Node.js 20 for automatic version switching with nvm +- **`package.json`** - Added `engines` field to enforce Node >=20.0.0 and npm >=10.0.0 + +### 3. Results +- ✅ **EBADENGINE warnings resolved** - All Node version mismatch warnings are gone +- ✅ **Dependencies installed successfully** - 992 packages installed +- ⚠️ **15 moderate vulnerabilities remain** - These are in transitive dependencies and require breaking changes to fix: + - `esbuild` (via `vite`) - Would require upgrading to vite 7.2.7 (breaking change) + - `prismjs` (via `react-syntax-highlighter`) - Would require upgrading to react-syntax-highlighter 16.1.0 (breaking change) + - `undici` (via `firebase`) - Would require upgrading to firebase 12.6.0 (breaking change) + +### 4. Deprecated Packages (Non-Critical) +These are transitive dependencies and don't affect functionality: +- `inflight@1.0.6` - Used by older dependencies +- `glob@7.2.3` - Used by older dependencies +- `node-domexception@1.0.0` - Used by older dependencies +- `@mui/base@5.0.0-beta.42` - Replaced by `@base-ui-components/react` (but still works) + +## Usage + +### Automatic Node Version Switching +If you have nvm installed, simply run: +```bash +cd ethora-app-reactjs +nvm use # Automatically uses Node 20 from .nvmrc +``` + +### Manual Setup +If nvm is not installed or you want to use a different Node version manager: +```bash +# Install nvm (if not already installed) +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash + +# Load nvm +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + +# Install and use Node 20 +nvm install 20 +nvm use 20 +nvm alias default 20 +``` + +## Remaining Issues + +### Vulnerabilities +The remaining 15 moderate vulnerabilities are in transitive dependencies. To fix them would require: +1. **Upgrading vite** to 7.x (breaking change - may require code updates) +2. **Upgrading react-syntax-highlighter** to 16.x (breaking change - may require code updates) +3. **Upgrading firebase** to 12.x (breaking change - may require code updates) + +These can be addressed in future updates when ready to handle breaking changes. + +### Deprecated Packages +The deprecated packages are transitive dependencies and don't pose immediate risks. They will be updated automatically when their parent packages are updated. + +## Testing + +After switching to Node 20: +1. Verify Node version: `node --version` (should show v20.x.x) +2. Reinstall dependencies: `npm install` (should have no EBADENGINE warnings) +3. Test the app: `npm run dev` (should start without issues) + diff --git a/README.md b/README.md index 158fdc1..18a6313 100644 Binary files a/README.md and b/README.md differ diff --git a/index.html b/index.html index 7ec4d5a..31aefff 100644 --- a/index.html +++ b/index.html @@ -6,23 +6,28 @@ -