-
Notifications
You must be signed in to change notification settings - Fork 1
Demo e2e annotations #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
caio-pizzol
merged 14 commits into
main
from
andrii/sd-1182-create-demo-of-e-sign-component-e2e
Dec 23, 2025
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1fc5d7f
feat: enhance demo with signature functionality and API integration
andrii-harbour 7ca80bd
fix: fixed payload
andrii-harbour 0ba4707
feat: added proxy-server for the demo and basic workflow to test depl…
andrii-harbour f511612
test: temporary changing existing workflow for testing
andrii-harbour e575784
fix: used wrong workflow
andrii-harbour 171c337
fix: replaced key var with secret
andrii-harbour ef7b9a4
fix: added cors, fixed ci/cd process
andrii-harbour a0df722
fix: fixed linter config for server
andrii-harbour 0b72b26
fix: fixed workflows for github
andrii-harbour 5d07b75
fix: fixed linter for node server
andrii-harbour 43f68a5
chore: cleaning
andrii-harbour 73610f4
chore: server using pnpm instead of npm
andrii-harbour afb066f
docs: update README with demo integration details and setup instructions
andrii-harbour c602ecd
feat: add demo user and IP address handling in server and update sign…
andrii-harbour File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| name: Deploy Proxy Server | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| PROJECT_ID: ${{ vars.GCP_PROJECT_ID }} | ||
| REGION: ${{ vars.GCP_REGION }} | ||
| SERVICE_NAME: ${{ vars.GCP_SERVICE_NAME }} | ||
| SUPERDOC_SERVICES_API_KEY: ${{ secrets.SUPERDOC_SERVICES_API_KEY }} | ||
| SUPERDOC_SERVICES_BASE_URL: ${{ vars.SUPERDOC_SERVICES_BASE_URL }} | ||
|
|
||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Auth to Google Cloud | ||
| uses: google-github-actions/auth@v2 | ||
| with: | ||
| credentials_json: ${{ secrets.GCP_SA_KEY }} | ||
|
|
||
| - name: Setup gcloud | ||
| uses: google-github-actions/setup-gcloud@v2 | ||
| with: | ||
| project_id: ${{ env.PROJECT_ID }} | ||
|
|
||
| - name: Build and push container with Cloud Build | ||
| run: | | ||
| REGION="${REGION:-us-central1}" | ||
| SERVICE_NAME="${SERVICE_NAME:-esign-demo-proxy-server}" | ||
| IMAGE="gcr.io/${PROJECT_ID}/${SERVICE_NAME}:${GITHUB_SHA}" | ||
|
|
||
| echo "REGION=${REGION}" >> $GITHUB_ENV | ||
| echo "SERVICE_NAME=${SERVICE_NAME}" >> $GITHUB_ENV | ||
| echo "IMAGE=${IMAGE}" >> $GITHUB_ENV | ||
|
|
||
| gcloud builds submit demo/server --tag "${IMAGE}" | ||
| env: | ||
| PROJECT_ID: ${{ env.PROJECT_ID }} | ||
| REGION: ${{ env.REGION }} | ||
| SERVICE_NAME: ${{ env.SERVICE_NAME }} | ||
|
|
||
| - name: Deploy container to Cloud Run | ||
| run: | | ||
| REGION="${REGION:-us-central1}" | ||
| SERVICE_NAME="${SERVICE_NAME:-esign-demo-proxy-server}" | ||
| IMAGE="${IMAGE}" | ||
| SUPERDOC_SERVICES_BASE_URL="${SUPERDOC_SERVICES_BASE_URL:-https://api.superdoc.dev}" | ||
|
|
||
| gcloud run deploy "${SERVICE_NAME}" \ | ||
| --image "${IMAGE}" \ | ||
| --region "${REGION}" \ | ||
| --memory=1Gi \ | ||
| --cpu=1 \ | ||
| --allow-unauthenticated \ | ||
| --set-env-vars SUPERDOC_SERVICES_BASE_URL="${SUPERDOC_SERVICES_BASE_URL}" \ | ||
| --set-secrets="SUPERDOC_SERVICES_API_KEY=esign-demo-sd-services-api-key:latest" | ||
| env: | ||
| IMAGE: ${{ env.IMAGE }} | ||
| REGION: ${{ env.REGION }} | ||
| SERVICE_NAME: ${{ env.SERVICE_NAME }} | ||
| SUPERDOC_SERVICES_API_KEY: ${{ env.SUPERDOC_SERVICES_API_KEY }} | ||
| SUPERDOC_SERVICES_BASE_URL: ${{ env.SUPERDOC_SERVICES_BASE_URL }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Demo | ||
|
|
||
| This demo shows how to integrate `@superdoc-dev/esign` into a React application. The frontend sends signing and download requests to a proxy server, which securely communicates with the SuperDoc Services API. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| You'll need a SuperDoc Services API key. [Get your API key here](https://docs.superdoc.dev/api-reference/authentication/register). | ||
|
|
||
| ## Setup | ||
|
|
||
| 1. Build the main package (from repo root): | ||
| ```bash | ||
| pnpm build | ||
| ``` | ||
|
|
||
| 2. Install dependencies: | ||
| ```bash | ||
| cd demo | ||
| pnpm install | ||
| cd server | ||
| pnpm install | ||
| ``` | ||
|
|
||
| 3. Create `.env` file in `demo/server/`: | ||
| ``` | ||
| SUPERDOC_SERVICES_API_KEY=your_key_here | ||
| ``` | ||
|
|
||
| 4. Update `demo/vite.config.ts` to proxy to localhost: | ||
| ```ts | ||
| proxy: { | ||
| '/v1': { | ||
| target: 'http://localhost:3001', | ||
| changeOrigin: true, | ||
| }, | ||
| }, | ||
| ``` | ||
|
|
||
| ## Running | ||
|
|
||
| Start the proxy server: | ||
| ```bash | ||
| cd demo/server | ||
| pnpm start | ||
| ``` | ||
|
|
||
| In a separate terminal, start the frontend: | ||
| ```bash | ||
| cd demo | ||
| pnpm dev | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| node_modules | ||
| npm-debug.log | ||
| .env | ||
| .env.* | ||
| Dockerfile | ||
| .dockerignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| PORT=3003 | ||
| SUPERDOC_SERVICES_API_KEY=replace-with-your-superdoc-api-key | ||
| SUPERDOC_SERVICES_BASE_URL=https://api.superdoc.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| FROM node:20-alpine | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY package.json ./ | ||
| RUN corepack enable && pnpm install --prod --no-lockfile | ||
|
|
||
| COPY . . | ||
|
|
||
| # Cloud Run/Functions set PORT; default to 8080 | ||
| ENV PORT=8080 | ||
|
|
||
| CMD ["pnpm", "start"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "name": "esign-proxy-server", | ||
| "private": true, | ||
| "type": "module", | ||
| "main": "server.js", | ||
| "scripts": { | ||
| "start": "node server.js", | ||
| "dev": "node server.js" | ||
| }, | ||
| "dependencies": { | ||
| "cors": "^2.8.5", | ||
| "dotenv": "^16.4.5", | ||
| "express": "^4.19.2" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.