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
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

> Production-ready, open-source FastAPI application with PostgreSQL and blazing-fast full-text search.

#### Project Overview
#### Overview

This project provides a scalable API backend using FastAPI and PostgreSQL, featuring:

- Automatic full-text search on all text fields (via tsvector)
- Endpoints for health checks, product management, prompt handling (via `/prompt`), resend email, and prospect management
- Efficient ingestion and processing of large CSV files

#### 🚀 Features
#### Features

- **Python 3.11+**
- **FastAPI** — Modern, high-performance REST API
Expand Down Expand Up @@ -42,7 +42,6 @@ uvicorn app.main:app --reload

Visit [localhost:8000](http://localhost:8000) or [onrender](https://nx-ai.onrender.com)


#### API Documentation

FastAPI auto-generates interactive docs:
Expand Down Expand Up @@ -71,7 +70,6 @@ SELECT * FROM prospects WHERE search_vector @@ plainto_tsquery('english', 'searc
- On every insert/update, `search_vector` is computed using PostgreSQL's `to_tsvector('english', ...)`.
- The GIN index (`idx_prospects_search_vector`) enables efficient search across large datasets.


#### Processing Large CSV Files

The `/prospects/process` endpoint supports robust ingestion of large CSVs (e.g., 1300+ rows, 300KB+), following the same normalization and insertion pattern as `/prospects/seed` but optimized for scale.
Expand Down
4 changes: 2 additions & 2 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Python - FastAPI, Postgres, tsvector"""
"""Python° - FastAPI, Postgres, tsvector"""

# Current Version
__version__ = "1"
__version__ = "3.0.1"
37 changes: 4 additions & 33 deletions app/api/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,15 @@

@router.get("/")
def root() -> dict:
"""NX-AI."""
""""Python°"""
load_dotenv()
base_url = os.getenv("BASE_URL", "http://localhost:8000")
epoch = int(time.time() * 1000)
meta = {
"title": "Python",
"severity": "success",
"title": "Python°",
"version": __version__,
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The root endpoint’s meta payload is diverging further from the project’s standard meta format: most routes use app.utils.make_meta(), which includes keys like severity and base (not base_url). Dropping "severity" and using "base_url" here makes meta inconsistent across endpoints and complicates client handling; consider using make_meta("success", ...) (and/or aligning key names) for consistency.

Suggested change
"version": __version__,
"version": __version__,
"severity": "success",
"base": base_url,

Copilot uses AI. Check for mistakes.
"base_url": base_url,
"time": epoch,
}
endpoints = [
{"name": "health", "url": f"{base_url}/health"},
{
"name": "Queue",
"endpoints": [
{"name": "list", "url": f"{base_url}/queue"},
]
},
{
"name": "Prompt°",
"endpoints": [
{"name": "list", "url": f"{base_url}/prompt"},
]
},
{
"name": "Orders°",
"endpoints": [
{"name": "list", "url": f"{base_url}/orders"},
]
},
{
"name": "Prospects°",
"endpoints": [
{"name": "list", "url": f"{base_url}/prospects"},
]
},

{"name": "Docs", "url": f"{base_url}/docs"},
]
return {"meta": meta, "data": endpoints}

return {"meta": meta}
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the GET / response shape by removing the "data" key. The repo’s tests (tests/test_routes.py) currently assert that "data" is present in the root response, so this will fail CI and may also break existing clients expecting a consistent {meta, data} envelope. Either keep returning a "data" field (e.g., an empty list/object) or update the test/clients as part of this PR.

Suggested change
return {"meta": meta}
return {"meta": meta, "data": {}}

Copilot uses AI. Check for mistakes.
Loading