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
2 changes: 2 additions & 0 deletions apps/truthlens-guard/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Frontend Environment Variables
VITE_API_URL=http://localhost:3001/api
7 changes: 7 additions & 0 deletions apps/truthlens-guard/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Frontend Environment Variables

# API Configuration
VITE_API_URL=http://localhost:3001/api

# Optional: Analytics, etc.
# VITE_ANALYTICS_ID=your-analytics-id
103 changes: 103 additions & 0 deletions apps/truthlens-guard/.github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Deploy to Vercel and Render

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
deploy-frontend:
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build frontend
run: npm run build

- name: Deploy to Vercel
run: |
npm install -g vercel
vercel --prod --yes
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VITE_API_URL: ${{ secrets.VITE_API_URL }}

deploy-backend:
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install backend dependencies
run: |
cd backend
npm ci

- name: Build backend
run: |
cd backend
npm run build

- name: Deploy to Render
run: |
npm install -g render-cli
render deploy
env:
RENDER_API_KEY: ${{ secrets.RENDER_API_KEY }}
NODE_ENV: production
CORTENSOR_API_KEY: ${{ secrets.CORTENSOR_API_KEY }}
CORTENSOR_SUBNET_UID: ${{ secrets.CORTENSOR_SUBNET_UID }}
CORS_ORIGIN: ${{ secrets.CORS_ORIGIN }}
RATE_LIMIT_WINDOW_MS: ${{ secrets.RATE_LIMIT_WINDOW_MS }}
RATE_LIMIT_MAX_REQUESTS: ${{ secrets.RATE_LIMIT_MAX_REQUESTS }}
LOG_LEVEL: ${{ secrets.LOG_LEVEL }}

test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Install backend dependencies
run: |
cd backend
npm ci

- name: Run frontend tests
run: npm test -- --watchAll=false

- name: Run backend tests
run: |
cd backend
npm test

- name: Run API tests
run: node test-api.js
49 changes: 49 additions & 0 deletions apps/truthlens-guard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Environment variables
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Data files (contains user data and fact checks)
backend/src/data/
*.db
*.sqlite
*.sqlite3

# Build outputs
dist/
build/
.next/
out/

# Testing
coverage/
.nyc_output/

# IDE
.vscode/settings.json
.idea/

# OS
.DS_Store
Thumbs.db

# Temporary files
*.tmp
*.temp
.cache/
Loading