Skip to content
Merged
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
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,12 @@ assist-frontend/public/swe-worker-*.js
assist-frontend/public/workbox-*.js
assist-frontend/public/workbox-*.js.map
scripts/eval/results/*.md

# AI Coding Assistants / code-review-graph
.cursorrules
.mcp.json
.opencode.json
.windsurfrules
AGENTS.md
CLAUDE.md
GEMINI.md
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies = [
"python-jose[cryptography]>=3.3",
"bcrypt>=4.0",
"email-validator>=2.0",
"psycopg2-binary>=2.9.11",
Comment thread
zweadfx marked this conversation as resolved.
]

[project.optional-dependencies]
Expand Down
12 changes: 12 additions & 0 deletions render.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
databases:
- name: assist-db
plan: free
databaseName: assist
user: assist

services:
- type: web
name: assist-api
Expand All @@ -8,6 +14,12 @@ services:
envVars:
- key: OPENAI_API_KEY
sync: false
- key: SECRET_KEY
sync: false
- key: DATABASE_URL
fromDatabase:
name: assist-db
property: connectionString
- key: CHROMA_DB_PATH
value: ./data/chroma
- key: PYTHON_VERSION
Expand Down
13 changes: 9 additions & 4 deletions src/db/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@

from src.core.config import settings

if settings.DATABASE_URL.startswith("sqlite"):
db_path = settings.DATABASE_URL.replace("sqlite:///", "")
database_url = settings.DATABASE_URL
# Render provides "postgres://" but SQLAlchemy requires "postgresql://"
if database_url.startswith("postgres://"):
database_url = database_url.replace("postgres://", "postgresql://", 1)

if database_url.startswith("sqlite"):
db_path = database_url.replace("sqlite:///", "")
Path(db_path).parent.mkdir(parents=True, exist_ok=True)

engine = create_engine(
settings.DATABASE_URL,
database_url,
connect_args=(
{"check_same_thread": False}
if settings.DATABASE_URL.startswith("sqlite")
if database_url.startswith("sqlite")
else {}
),
)
Expand Down
5 changes: 4 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ async def lifespan(app: FastAPI):

app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:3000"],
allow_origins=[
"http://localhost:3000",
"https://assist-frontend-plum.vercel.app",
],
allow_methods=["GET", "POST", "OPTIONS"],
allow_headers=["*"],
)
Expand Down
Loading
Loading