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
38 changes: 38 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# API Configuration
API_HOST=0.0.0.0
API_PORT=8000
API_ENV=development

# LLM Provider API Keys
OPENAI_API_KEY=your_openai_api_key_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here

# Vector Database Configuration
PINECONE_API_KEY=your_pinecone_api_key_here
PINECONE_ENVIRONMENT=your_pinecone_environment_here

# Weaviate Configuration
WEAVIATE_URL=http://localhost:8080
WEAVIATE_API_KEY=optional_api_key

# ChromaDB Configuration
CHROMA_HOST=localhost
CHROMA_PORT=8000

# Database Configuration
DATABASE_URL=postgresql://user:password@localhost:5432/rag7
REDIS_URL=redis://localhost:6379

# Security
SECRET_KEY=your_secret_key_here_change_in_production
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30

# Logging
LOG_LEVEL=INFO
LOG_FORMAT=json

# Enterprise Features
ENABLE_METRICS=true
ENABLE_TRACING=true
METRICS_PORT=9090
103 changes: 103 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CI/CD Pipeline

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

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3

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

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

- name: Run tests
run: |
pytest tests/ --cov=app --cov-report=xml

- name: Upload coverage
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml

lint:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black flake8 mypy

- name: Run Black
run: black --check app/ tests/

- name: Run Flake8
run: flake8 app/ tests/ --max-line-length=100

- name: Run MyPy
run: mypy app/ --ignore-missing-imports

build:
runs-on: ubuntu-latest
needs: [test, lint]
permissions:
contents: read

steps:
- uses: actions/checkout@v3

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

- name: Build Docker image
run: |
docker build -t rag7:${{ github.sha }} .

- name: Test Docker image
run: |
docker run -d --name test-container rag7:${{ github.sha }}
sleep 10
docker logs test-container
docker stop test-container

deploy:
runs-on: ubuntu-latest
needs: [build]
if: github.ref == 'refs/heads/main'
permissions:
contents: read

steps:
- uses: actions/checkout@v3

- name: Deploy to production
run: |
echo "Deployment step - configure based on your infrastructure"
# Add your deployment commands here
87 changes: 87 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# 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

# Virtual Environment
venv/
ENV/
env/
.venv

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

# IDE
.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store

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

# Logs
*.log
logs/

# Database
*.db
*.sqlite
*.sqlite3

# Vector Database
chroma_data/
pinecone_data/

# Jupyter
.ipynb_checkpoints/
*.ipynb

# Node (for frontend)
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Build artifacts
dist/
build/

# Temporary files
tmp/
temp/
*.tmp

# Docker
.dockerignore

# Data files
data/raw/
data/processed/
*.csv
*.parquet
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM python:3.11-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*

# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY app/ ./app/
COPY README.md .

# Create logs directory
RUN mkdir -p logs

# Expose API port
EXPOSE 8000

# Run the application
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
Loading