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
2 changes: 2 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
GEMINI_API_KEY=
RESEND_API_KEY=
BASE_URL=
DB_HOST=
DB_PORT=5432
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ FastAPI automatically generates interactive documentation:
### Processing Large CSV Files

The `/prospects/process` endpoint is designed for robust, scalable ingestion of large CSV files (e.g., 1300+ rows, 300KB+). It follows the same normalization and insertion pattern as `/prospects/seed`, but is optimized for large files:


2 changes: 1 addition & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""NX AI - FastAPI, Python, Postgres, tsvector"""

# Current Version
__version__ = "2.0.4"
__version__ = "2.0.5"
3 changes: 3 additions & 0 deletions app/api/resend/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Resend Routes"""

from .resend import router as prospects_resend
26 changes: 26 additions & 0 deletions app/api/resend/resend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

from app import __version__
import os
from app.utils.make_meta import make_meta

from fastapi import APIRouter, Query, Path, Body, HTTPException

from app.utils.db import get_db_connection


router = APIRouter()
base_url = os.getenv("BASE_URL", "http://localhost:8000")

RESEND_API_KEY = os.getenv("RESEND_API_KEY")

@router.get("/resend")
def root() -> dict:
"""GET /resend endpoint."""
if not RESEND_API_KEY:
meta = make_meta("error", "RESEND_API_KEY is missing from environment. Please set it in your .env file.")
return {"meta": meta}
meta = make_meta("success", "Resend endpoint")
data = [
{"action,": f"send email"},
]
return {"meta": meta, "data": data}
1 change: 1 addition & 0 deletions app/api/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def root() -> dict:
}
endpoints = [
{"name": "docs", "url": f"{base_url}/docs"},
{"name": "resend", "url": f"{base_url}/resend"},
{"name": "health", "url": f"{base_url}/health"},
{"name": "prompts", "url": f"{base_url}/prompts"},
{"name": "prospects", "url": f"{base_url}/prospects"},
Expand Down
2 changes: 2 additions & 0 deletions app/api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from app.api.root import router as root_router
from app.api.health import router as health_router
from app.api.resend.resend import router as resend_router
from app.api.prompts.prompts import router as prompts_router
from app.api.prospects.prospects import router as prospects_router
from app.api.prospects.search import router as prospects_search_router
Expand All @@ -21,6 +22,7 @@
from app.api.prospects.database.process import router as prospects_process_router

router.include_router(root_router)
router.include_router(resend_router)
router.include_router(health_router)
router.include_router(prompts_router)
router.include_router(prospects_search_router)
Expand Down
9 changes: 3 additions & 6 deletions app/utils/make_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ def make_meta(severity: str, title: str) -> dict:
base_url = os.getenv("BASE_URL", "http://localhost:8000")
epoch = int(time.time() * 1000)
return {
"severity": severity,
"title": title,
"version": __version__,
"endpoint": f"{base_url}/prospects",
"base": base_url,
"base_url": base_url,
"message": title,
"time": epoch,
"severity": severity,
"message": title,
"base_url": base_url,
}
Loading