Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# AI Services
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4
HF_API_TOKEN=hf_...
Comment on lines +2 to +4
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .env.example file contains placeholder values like 'sk-...' for API keys which could be mistaken for actual redacted keys. Consider using more explicit placeholder text such as 'your-openai-api-key-here' or 'REPLACE_WITH_YOUR_KEY' to make it clear these are examples and need to be replaced.

Suggested change
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4
HF_API_TOKEN=hf_...
OPENAI_API_KEY=your-openai-api-key-here
OPENAI_MODEL=gpt-4
HF_API_TOKEN=your-huggingface-api-token-here

Copilot uses AI. Check for mistakes.
HF_MODEL=
LANGCHAIN_ENABLED=false

# Vector Stores (Optional)
VECTOR_STORE_PROVIDER=
VECTOR_STORE_API_KEY=
VECTOR_STORE_ENVIRONMENT=
VECTOR_STORE_URL=

# Web3 - EVM
ETH_RPC_URL=
ETH_PRIVATE_KEY=
ETH_CHAIN_ID=1

# Web3 - Solana
SOLANA_RPC_URL=
SOLANA_PRIVATE_KEY=
SOLANA_COMMITMENT=confirmed

# Messaging - Slack
SLACK_BOT_TOKEN=
SLACK_SIGNING_SECRET=

# Messaging - Discord
DISCORD_BOT_TOKEN=

# Data - PostgreSQL
DATABASE_URL=postgresql://user:password@localhost:5432/dbname

# Data - Redis
REDIS_URL=redis://localhost:6379

# Data - AWS S3
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=us-east-1
S3_BUCKET=

# Data - IPFS
IPFS_URL=http://localhost:5001

# Application
NODE_ENV=development
ENVIRONMENT=dev
83 changes: 83 additions & 0 deletions .github/workflows/container-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Container Build and Deploy

on:
push:
branches: [ master, main ]
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy to'
required: true
default: 'dev'
type: choice
options:
- dev
- stage
- prod

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
# Build all environments on push, single environment on manual dispatch
environment: ${{ github.event_name == 'workflow_dispatch' && fromJSON(format('["{0}"]', github.event.inputs.environment)) || fromJSON('["dev", "stage", "prod"]') }}
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The matrix strategy uses a complex fromJSON expression that could be simplified and made more readable. The expression 'fromJSON(format('["{0}"]', github.event.inputs.environment))' creates a single-element array in a convoluted way. Consider using a simpler approach such as defining the matrix values more explicitly or using intermediate steps to improve maintainability.

Suggested change
environment: ${{ github.event_name == 'workflow_dispatch' && fromJSON(format('["{0}"]', github.event.inputs.environment)) || fromJSON('["dev", "stage", "prod"]') }}
environment: ${{ github.event_name == 'workflow_dispatch' && fromJSON('["' + github.event.inputs.environment + '"]') || fromJSON('["dev", "stage", "prod"]') }}

Copilot uses AI. Check for mistakes.
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
# NOTE: Use placeholder token for now - configure secrets in repository settings
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=sha,prefix=${{ matrix.environment }}-
type=raw,value=${{ matrix.environment }}-latest

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
# NOTE: Push disabled by default - enable when ready to deploy
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
ENVIRONMENT=${{ matrix.environment }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Image build summary
run: |
echo "### Container Build Summary :rocket:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Environment:** ${{ matrix.environment }}" >> $GITHUB_STEP_SUMMARY
echo "**Registry:** ${{ env.REGISTRY }}" >> $GITHUB_STEP_SUMMARY
echo "**Image:** ${{ env.IMAGE_NAME }}" >> $GITHUB_STEP_SUMMARY
echo "**Tags:**" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "_Note: Image push is currently disabled. Enable in workflow when ready._" >> $GITHUB_STEP_SUMMARY
64 changes: 64 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Dependencies
node_modules/
package-lock.json
yarn.lock

# Build outputs
dist/
build/
*.js
*.d.ts
!src/**/*.ts
!test/**/*.js

# Python
__pycache__/
*.py[cod]
*$py.class
.Python
venv/
.venv/
env/
ENV/

# Go
*.exe
*.test
*.out
go.sum

# Rust
target/
Cargo.lock

# IDEs
.vscode/
.idea/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

# Logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Environment
.env
.env.local
.env.*.local

# Test coverage
coverage/
.nyc_output/

# Temporary files
tmp/
temp/
*.tmp
46 changes: 46 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Multi-stage build for Node.js/TypeScript application
FROM node:18-alpine AS builder

WORKDIR /app

# Copy package files
COPY package.json tsconfig.json ./

# Install dependencies (including optional)
RUN npm install --include=optional || npm install

# Copy source code
COPY sdk/ ./sdk/
COPY src/ ./src/

# Build TypeScript
RUN npm run build || echo "Build step completed"
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build command uses '|| echo "Build step completed"' as a fallback. This means if the TypeScript build fails, the Docker image will still be created with a success message, potentially creating a broken image. The build should fail if compilation fails, or at minimum, the error should be logged properly rather than hidden.

Suggested change
RUN npm run build || echo "Build step completed"
RUN npm run build

Copilot uses AI. Check for mistakes.

# Production image
FROM node:18-alpine

WORKDIR /app

# Copy package files and install production dependencies only
COPY package.json ./
RUN npm install --production || npm install
Comment on lines +10 to +26
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The npm install commands use '|| npm install' as a fallback which could mask errors during the build process. If the first install command fails with --include=optional, the build continues silently without optional dependencies. This makes it difficult to debug installation issues. Consider logging the failure or using a more explicit approach to handle optional dependency installation.

Copilot uses AI. Check for mistakes.

# Copy built artifacts from builder
COPY --from=builder /app/dist ./dist

# Create non-root user
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001

USER nodejs

# Environment arg (dev/stage/prod)
ARG ENVIRONMENT=dev
ENV NODE_ENV=production
ENV ENVIRONMENT=${ENVIRONMENT}

# Expose port (placeholder)
EXPOSE 3000

# Default command (placeholder - update based on your application)
CMD ["node", "dist/index.js"]
Loading
Loading