Skip to content
Draft
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
db572f0
feat: add Blend Token Studio implementation and deployment setup
vinitkhandal717 Apr 8, 2026
f047917
feat: implement branch management API and UI for Blend Token Studio
vinitkhandal717 Apr 8, 2026
9f0f567
feat: migrate Blend Token Studio to Vite
vinitkhandal717 Apr 9, 2026
79bf3f1
feat: enhance Blend Token Studio with Prisma integration and Firestor…
vinitkhandal717 Apr 10, 2026
19f0d6f
feat: add backend configuration for Blend Token Studio
vinitkhandal717 Apr 13, 2026
dd700ac
feat(backend): add token upload API with validation and file storage
vinitkhandal717 Apr 13, 2026
f9ac878
feat: refactor token management with new upload API
vinitkhandal717 Apr 13, 2026
0e5a686
chore: remove table from changes
vinitkhandal717 Apr 13, 2026
64fd0bc
feat: add initial database migration and configuration for PostgreSQL
vinitkhandal717 Apr 14, 2026
14adecf
feat: add home page
vinitkhandal717 Apr 14, 2026
64bb55b
feat: add new panels and import wizard to the editor
vinitkhandal717 Apr 15, 2026
c0edb5b
feat: implement organization and API key management features in backend
vinitkhandal717 Apr 16, 2026
96265ce
feat: enhance Blend Token Studio cli
vinitkhandal717 Apr 16, 2026
e360204
feat: implement PII handling in audit logs and user management
vinitkhandal717 Apr 17, 2026
8a6fece
feat: update audit log schema and actions for enhanced tracking
vinitkhandal717 Apr 17, 2026
30a897c
feat: migrate icon library from Lucide to Phosphor for consistent UI
vinitkhandal717 Apr 17, 2026
d01f8b9
feat: implement token locking and merge request features for enhanced…
vinitkhandal717 Apr 17, 2026
1cefc85
feat: add Blend Token Studio CLI setup guide and enhance backend depl…
vinitkhandal717 Apr 20, 2026
7f11d6c
feat: introduce mock governance API and user role management for demo…
vinitkhandal717 Apr 21, 2026
e18dcb6
refactor: docs and imports
vinitkhandal717 Apr 22, 2026
457ba28
chore: run lint
vinitkhandal717 Apr 22, 2026
c0e1fcd
chore: rename Blend Token Studio to Blend Studio in CLI package
vinitkhandal717 Apr 23, 2026
99aa00a
feat: add staging deployment workflow for Blend Studio and Backend
vinitkhandal717 Apr 23, 2026
cdcb667
ci: add permissions block to publish-cli.yml
vinitkhandal717 Apr 23, 2026
2f453d5
fix: generate prisma client before build in Dockerfile
vinitkhandal717 Apr 23, 2026
a095ac5
chore: update Dockerfile to approve builds and install dependencies
vinitkhandal717 Apr 23, 2026
864d195
fix: use pnpm config for built deps and include all workspace packages
vinitkhandal717 Apr 24, 2026
5de0e60
fix: remove custom service account from Cloud Run deploy
vinitkhandal717 Apr 24, 2026
e99900e
fix: remove PORT env var reserved by Cloud Run
vinitkhandal717 Apr 24, 2026
67b63d2
fix: use localhost in DATABASE_URL for Cloud SQL socket
vinitkhandal717 Apr 24, 2026
262ce39
chore: update deployment workflow and Dockerfile
vinitkhandal717 Apr 24, 2026
6cd99c0
fix: remove unused substitutions _DATABASE_NAME, _DATABASE_USER
vinitkhandal717 Apr 24, 2026
f779ef5
fix: add tsconfig-paths for runtime path resolution
vinitkhandal717 Apr 24, 2026
44a42a4
chore: add .dockerignore file and update pnpm-lock.yaml; enhance depl…
vinitkhandal717 Apr 24, 2026
876a1ae
chore: run lint
vinitkhandal717 Apr 24, 2026
bf3f5ac
chore: update deploy-staging workflow to improve permissions
vinitkhandal717 Apr 24, 2026
d9dee7e
chore: update pnpm-lock.yaml, modify deploy-staging workflow,
vinitkhandal717 Apr 24, 2026
79c85cf
chore: update deploy-staging workflow, enhance Dockerfile
vinitkhandal717 Apr 24, 2026
f93775e
chore: enhance deploy-staging workflow
vinitkhandal717 Apr 24, 2026
08562ff
chore: update environment variables in cloudbuild.yaml for deployment
vinitkhandal717 Apr 24, 2026
967354f
chore: add FIREBASE_CLIENT_EMAIL to environment variables in cloudbui…
vinitkhandal717 Apr 24, 2026
2959e05
chore: remove FIREBASE_CLIENT_EMAIL from environment variable
vinitkhandal717 Apr 24, 2026
3314f99
chore: update delimiter for environment variables in cloudbuild.yaml
vinitkhandal717 Apr 24, 2026
e9fe07f
refactor: implement database connection retry logic
vinitkhandal717 Apr 24, 2026
1484000
chore: enhance health check logic in deploy-staging workflow
vinitkhandal717 Apr 24, 2026
dd643d3
chore: add validation for staging URL secrets in deploy-staging workflow
vinitkhandal717 Apr 24, 2026
12fbebd
chore: add STUDIO_URL to environment variables and update frontend UR…
vinitkhandal717 Apr 24, 2026
c927abc
chore: update substitutions in deploy workflows
vinitkhandal717 Apr 24, 2026
07fb177
chore: add DATABASE_URL handling in deployment workflows
vinitkhandal717 Apr 24, 2026
2119dcd
chore: remove DATABASE_URL handling from deployment workflows
vinitkhandal717 Apr 24, 2026
84109b0
chore: increase timeout and add startup timeout
vinitkhandal717 Apr 24, 2026
8bc5dba
chore: remove startup timeout from cloudbuild configuration
vinitkhandal717 Apr 24, 2026
612bb72
chore: implement backend database migration steps in deployment workf…
vinitkhandal717 Apr 24, 2026
713e6e4
chore: enhance deployment workflows with environment-specific configu…
vinitkhandal717 Apr 24, 2026
9e6c9d9
chore: update pnpm setup in deployment workflows to use version 5
vinitkhandal717 Apr 24, 2026
6336b10
chore: modify entrypoint script to conditionally apply database migra…
vinitkhandal717 Apr 24, 2026
b824a07
refactor: replace useNavigate with Navigate for authentication redirects
vinitkhandal717 Apr 24, 2026
df43c13
chore: enhance database configuration to support Cloud SQL
vinitkhandal717 Apr 25, 2026
fd429e3
chore: enhance deployment workflows with validation for explicit ports
vinitkhandal717 Apr 25, 2026
e4a8eba
chore: remove DATABASE_URL secret version refresh from deployment wor…
vinitkhandal717 Apr 25, 2026
c8845d2
chore: update deployment workflows to streamline environment
vinitkhandal717 Apr 25, 2026
1e82415
chore: simplify database configuration in deployment workflows
vinitkhandal717 Apr 25, 2026
e39139d
chore: update deployment workflows to include db connection
vinitkhandal717 Apr 25, 2026
11d7b97
refactor: adjust server startup to connect to the db
vinitkhandal717 Apr 25, 2026
f75d60a
chore: enhance database connection settings with configurable parameters
vinitkhandal717 Apr 25, 2026
798618a
refactor: wrap authentication route handlers with asyncHandler
vinitkhandal717 Apr 26, 2026
290b859
chore: update nginx configuration to disable port and absolute redirects
vinitkhandal717 Apr 27, 2026
dcab214
refactor: improve Google OAuth callback handling and enhance error lo…
vinitkhandal717 Apr 27, 2026
42dc509
refactor: standardize SameSite cookie attribute handling in auth routes
vinitkhandal717 Apr 27, 2026
48a4bc4
refactor: enhance backend API integration with version
vinitkhandal717 Apr 28, 2026
2eecbdf
docs: add comprehensive integration guide for Blend Design System
vinitkhandal717 Apr 28, 2026
058172c
refactor: enhance frontend integration with api calls
vinitkhandal717 Apr 28, 2026
1378d3a
refactor: rename blend-token-studio to blend-studio and update relate…
vinitkhandal717 Apr 29, 2026
0d69100
chore: bump version to 0.1.2 in package.json
vinitkhandal717 Apr 29, 2026
5e4fc9e
chore: bump version to 0.1.3 in package.json
vinitkhandal717 Apr 29, 2026
e6a3ea1
chore: run lint
vinitkhandal717 Apr 29, 2026
239e730
refactor: update doc and cli
vinitkhandal717 Apr 29, 2026
91a793b
refactor: update brand configuration and enhance API client tests
vinitkhandal717 Apr 30, 2026
6f2a60a
chore: bump version to 0.1.5 in package.json
vinitkhandal717 Apr 30, 2026
1dca84f
feat: add CLI Help route and integrate into Studio page
vinitkhandal717 Apr 30, 2026
494e14c
refactor: update brand configuration, enhance CLI argument handling
vinitkhandal717 May 1, 2026
8ee9eb7
refactor: improve route definitions and enhance ColorPaletteGenerator
vinitkhandal717 May 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
71 changes: 71 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# -----------------------------------------------------------------------------
# Root .dockerignore — applied to every `docker build` whose context is the
# repo root (Cloud Build uses the repo root as context).
# Keep this list tight: anything NOT excluded here ends up in the build
# context and slows every build step.
# -----------------------------------------------------------------------------

# VCS / CI metadata
.git
.github
.gitignore
.gitattributes
.husky
.changeset
.turbo
.vscode
.idea
.cursor
.cursorrules
.cursorignore

# Node / package managers
**/node_modules
**/.pnpm-store
**/.pnpm-debug.log*
**/npm-debug.log*
**/yarn-debug.log*
**/yarn-error.log*

# Build output — re-created inside the image
**/dist
**/build
**/.next
**/out
**/storybook-static
**/coverage
**/.nyc_output
**/.turbo

# Local env files — secrets must come from Cloud Run / Secret Manager
**/.env
**/.env.*
!**/.env.example

# Editor / OS artifacts
**/.DS_Store
**/*.log
**/*.tsbuildinfo
**/*.swp

# Docs & large non-runtime assets we don't need in the image
**/*.md
!packages/cli/README.md
!packages/blend/README.md
**/CHANGELOG.md
apps/ascent
apps/site
apps/storybook
apps/tokenizer-sandbox
apps/firebase-app
apps/blend-monitor
packages/mcp
packages/blend-telemetry

# Test artifacts
**/playwright-report
**/test-results

# Docker context: don't re-include Dockerfiles we don't need
**/Dockerfile.dev
**/docker-compose*.yml
272 changes: 272 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
name: Deploy Studio & Backend (Staging)

on:
push:
branches:
- staging
paths:
- 'apps/backend/**'
- 'apps/blend-studio/**'
- 'packages/token-engine/**'
- 'packages/blend/**'
- 'pnpm-lock.yaml'
- '.github/workflows/deploy-staging.yml'
workflow_dispatch:
inputs:
deploy_backend:
description: 'Deploy backend to Cloud Run'
required: false
default: true
type: boolean
deploy_studio:
description: 'Deploy studio to Firebase Hosting'
required: false
default: true
type: boolean

concurrency:
group: deploy-staging
cancel-in-progress: false

env:
PROJECT_ID: storybook-452807
REGION: us-central1
PNPM_VERSION: 10.21.0
NODE_VERSION: '20'

jobs:
# ------------------------------------------------------------------------
# 0. Preflight — fail fast if any required secret is missing. Cheaper to
# stop here than halfway through a Cloud Build.
# ------------------------------------------------------------------------
preflight:
name: Preflight (validate secrets)
runs-on: ubuntu-latest
steps:
- name: Check required secrets
env:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
STAGING_DB_PASSWORD: ${{ secrets.STAGING_DB_PASSWORD }}
STAGING_DATABASE_NAME: ${{ secrets.STAGING_DATABASE_NAME }}
DATABASE_USER: ${{ secrets.DATABASE_USER }}
CLOUD_SQL_CONNECTION_NAME: ${{ secrets.CLOUD_SQL_CONNECTION_NAME }}
STAGING_FRONTEND_URL: ${{ secrets.STAGING_FRONTEND_URL }}
STAGING_API_BASE_URL: ${{ secrets.STAGING_API_BASE_URL }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
FIREBASE_AUTH_DOMAIN: ${{ secrets.FIREBASE_AUTH_DOMAIN }}
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }}
FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
FIREBASE_DATABASE_URL: ${{ secrets.FIREBASE_DATABASE_URL }}
FIREBASE_CLIENT_EMAIL: ${{ secrets.FIREBASE_CLIENT_EMAIL }}
FIREBASE_CI_TOKEN: ${{ secrets.FIREBASE_CI_TOKEN }}
run: |
set -euo pipefail
missing=0
for key in \
GCP_SA_KEY STAGING_DB_PASSWORD STAGING_DATABASE_NAME DATABASE_USER \
CLOUD_SQL_CONNECTION_NAME STAGING_FRONTEND_URL STAGING_API_BASE_URL \
GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET \
FIREBASE_API_KEY FIREBASE_AUTH_DOMAIN FIREBASE_PROJECT_ID \
FIREBASE_STORAGE_BUCKET FIREBASE_MESSAGING_SENDER_ID \
FIREBASE_APP_ID FIREBASE_DATABASE_URL FIREBASE_CLIENT_EMAIL \
FIREBASE_CI_TOKEN
do
if [ -z "${!key:-}" ]; then
echo "::error::Required secret '$key' is empty or not set"
missing=$((missing+1))
fi
done
if [ "$missing" -gt 0 ]; then
echo "::error::$missing required secret(s) missing. Aborting."
exit 1
fi

# ------------------------------------------------------------------------
# 1. Build & deploy backend via Cloud Build. Studio image is still built
# inside the same Cloud Build (see cloudbuild.yaml) for parity.
# ------------------------------------------------------------------------
deploy-backend:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
name: Build & deploy backend (Cloud Run)
runs-on: ubuntu-latest
needs: preflight
if: >-
github.event_name == 'push' ||
github.event.inputs.deploy_backend != 'false'
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Compute derived values
id: env
env:
DB_USER: ${{ secrets.DATABASE_USER }}
DB_NAME: ${{ secrets.STAGING_DATABASE_NAME }}
DB_PASSWORD: ${{ secrets.STAGING_DB_PASSWORD }}
DB_HOST_SOCK: /cloudsql/${{ secrets.CLOUD_SQL_CONNECTION_NAME }}
API_BASE_URL: ${{ secrets.STAGING_API_BASE_URL }}
run: |
set -euo pipefail
ENCODED_PASS=$(python3 -c "import os, urllib.parse; print(urllib.parse.quote(os.environ['DB_PASSWORD'], safe=''))")
DATABASE_URL="postgresql://${DB_USER}:${ENCODED_PASS}@localhost:5432/${DB_NAME}?host=${DB_HOST_SOCK}"
GOOGLE_REDIRECT_URI="${API_BASE_URL%/}/api/auth/google/callback"
# Mask the derived URL so it does not appear in logs
echo "::add-mask::${DATABASE_URL}"
{
echo "DATABASE_URL=${DATABASE_URL}"
echo "GOOGLE_REDIRECT_URI=${GOOGLE_REDIRECT_URI}"
} >> "$GITHUB_OUTPUT"

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ env.PROJECT_ID }}

- name: Configure Docker for Artifact Registry
run: gcloud auth configure-docker gcr.io --quiet

- name: Build & Deploy via Cloud Build
env:
DATABASE_URL: ${{ steps.env.outputs.DATABASE_URL }}
GOOGLE_REDIRECT_URI: ${{ steps.env.outputs.GOOGLE_REDIRECT_URI }}
FRONTEND_URL: ${{ secrets.STAGING_FRONTEND_URL }}
API_BASE_URL: ${{ secrets.STAGING_API_BASE_URL }}
run: |
set -euo pipefail
gcloud builds submit \
--config=apps/blend-studio/cloudbuild.yaml \
--region="${REGION}" \
--substitutions="^@^\
_BACKEND_SERVICE=blend-backend-staging@\
_STUDIO_SERVICE=blend-studio-staging@\
_REGION=${REGION}@\
_INSTANCE_CONNECTION_NAME=${{ secrets.CLOUD_SQL_CONNECTION_NAME }}@\
_DATABASE_URL=${DATABASE_URL}@\
_FRONTEND_URL=${FRONTEND_URL}@\
_API_BASE_URL=${API_BASE_URL}@\
_GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }}@\
_GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }}@\
_GOOGLE_REDIRECT_URI=${GOOGLE_REDIRECT_URI}@\
_FIREBASE_API_KEY=${{ secrets.FIREBASE_API_KEY }}@\
_FIREBASE_AUTH_DOMAIN=${{ secrets.FIREBASE_AUTH_DOMAIN }}@\
_FIREBASE_PROJECT_ID=${{ secrets.FIREBASE_PROJECT_ID }}@\
_FIREBASE_STORAGE_BUCKET=${{ secrets.FIREBASE_STORAGE_BUCKET }}@\
_FIREBASE_MESSAGING_SENDER_ID=${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}@\
_FIREBASE_APP_ID=${{ secrets.FIREBASE_APP_ID }}@\
_FIREBASE_DATABASE_URL=${{ secrets.FIREBASE_DATABASE_URL }}@\
_FIREBASE_CLIENT_EMAIL=${{ secrets.FIREBASE_CLIENT_EMAIL }}" \
.

- name: Smoke test deployed backend
env:
API_BASE_URL: ${{ secrets.STAGING_API_BASE_URL }}
run: |
set -euo pipefail
url="${API_BASE_URL%/}/health"
echo "Probing ${url}"
# Cloud Run can take a few seconds after deploy; retry briefly.
for attempt in 1 2 3 4 5 6; do
status=$(curl -s -o /tmp/health.json -w "%{http_code}" "${url}" || echo "000")
if [ "${status}" = "200" ]; then
echo "Backend healthy: $(cat /tmp/health.json)"
exit 0
fi
echo "Attempt ${attempt} got status ${status}; retrying in $((attempt * 5))s..."
sleep $((attempt * 5))
done
echo "::error::Backend /health did not return 200 after retries"
exit 1

# ------------------------------------------------------------------------
# 2. Build + deploy Studio to Firebase Hosting in parallel with the
# backend. Isolated so a backend Cloud Build failure does not block
# frontend deploys.
# ------------------------------------------------------------------------
deploy-studio:
name: Build & deploy studio (Firebase Hosting)
runs-on: ubuntu-latest
needs: preflight
if: >-
github.event_name == 'push' ||
github.event.inputs.deploy_studio != 'false'
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: false

- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ~/.local/share/pnpm/store
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-

- name: Install dependencies (filtered to studio)
run: pnpm install --frozen-lockfile --filter 'blend-studio...'

- name: Build studio
env:
VITE_FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
VITE_FIREBASE_AUTH_DOMAIN: ${{ secrets.FIREBASE_AUTH_DOMAIN }}
VITE_FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
VITE_FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }}
VITE_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}
VITE_FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
VITE_FIREBASE_DATABASE_URL: ${{ secrets.FIREBASE_DATABASE_URL }}
VITE_API_BASE_URL: ${{ secrets.STAGING_API_BASE_URL }}
run: pnpm --filter blend-studio build

- name: Deploy to Firebase Hosting (staging)
run: |
npx firebase-tools@latest deploy \
--only hosting:blend-staging \
--project "${PROJECT_ID}" \
--token "${FIREBASE_TOKEN}" \
--non-interactive
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CI_TOKEN }}

# ------------------------------------------------------------------------
# 3. Summary (always runs, even on partial failure).
# ------------------------------------------------------------------------
summary:
name: Deployment summary
runs-on: ubuntu-latest
needs: [deploy-backend, deploy-studio]
if: always()
steps:
- name: Write summary
run: |
{
echo "## Staging deployment"
echo ""
echo "| Component | Status |"
echo "|-----------|--------|"
echo "| Backend (Cloud Run) | ${{ needs.deploy-backend.result }} |"
echo "| Studio (Firebase Hosting) | ${{ needs.deploy-studio.result }} |"
} >> "$GITHUB_STEP_SUMMARY"

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Loading
Loading