Skip to content
Draft
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
46 changes: 46 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# OpenAI Configuration
OPENAI_API_KEY=sk-your-openai-api-key-here
OPENAI_MODEL=gpt-4

# Slack Integration
SLACK_BOT_TOKEN=xoxb-your-slack-bot-token-here
SLACK_APP_TOKEN=xapp-your-slack-app-token-here
SLACK_SIGNING_SECRET=your-slack-signing-secret-here

# Gmail Integration
# Option 1: OAuth 2.0 credentials file path
GMAIL_CREDENTIALS_FILE=path/to/credentials.json
GMAIL_TOKEN_FILE=path/to/token.json
# Option 2: SMTP configuration (alternative)
GMAIL_SMTP_USER=your-email@gmail.com
GMAIL_SMTP_PASSWORD=your-app-password-here

# Notion Integration
NOTION_API_KEY=secret_your-notion-integration-token-here
NOTION_DATABASE_ID=your-database-id-here

# Database Configuration
DATABASE_URL=postgresql://user:password@localhost:5432/rag7_db
# For development, can use SQLite:
# DATABASE_URL=sqlite:///./rag7.db

# Redis Configuration
REDIS_URL=redis://localhost:6379/0

# ChromaDB Configuration
CHROMA_HOST=localhost
CHROMA_PORT=8000
CHROMA_PERSISTENCE_DIR=./chroma_data

# API Configuration
API_HOST=0.0.0.0
API_PORT=8000
API_RELOAD=True
CORS_ORIGINS=http://localhost:3000,http://localhost:5173

# Frontend Configuration
VITE_API_URL=http://localhost:8000

# Environment
ENVIRONMENT=development
LOG_LEVEL=INFO
84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI

on:
push:
branches: [ main, develop, feature/* ]
pull_request:
branches: [ main, develop ]

jobs:
lint-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Lint with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 src tests --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings
flake8 src tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Type check with mypy
run: |
mypy src --ignore-missing-imports || true

- name: Run tests
env:
OPENAI_API_KEY: sk-test-key
SLACK_BOT_TOKEN: xoxb-test-token
GMAIL_SMTP_USER: test@gmail.com
GMAIL_SMTP_PASSWORD: test-password
NOTION_API_KEY: secret_test_key
run: |
pytest tests/ -v --tb=short

- name: Check code formatting
run: |
black --check src tests || true

frontend-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Cache Node modules
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install frontend dependencies
working-directory: ./frontend
run: npm ci || npm install

- name: Build frontend
working-directory: ./frontend
run: npm run build
70 changes: 70 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Environment variables
.env
.env.local

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
venv/
ENV/
env/

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/

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

# ChromaDB
chroma_data/
*.db

# Credentials
credentials.json
token.json
*.pem
*.key

# Logs
*.log
logs/

# Frontend
node_modules/
frontend/dist/
frontend/build/
frontend/.vite/

# OS
.DS_Store
Thumbs.db

# Docker
*.pid
frontend/package-lock.json
Loading