https://github.com/goldlabelapps/python
Open Source, production ready Python FastAPI/Postgres app for NX
https://github.com/goldlabelapps/python
ai fastapi postgres python render tsvector
Last synced: about 2 months ago
JSON representation
Open Source, production ready Python FastAPI/Postgres app for NX
- Host: GitHub
- URL: https://github.com/goldlabelapps/python
- Owner: goldlabelapps
- License: mit
- Created: 2026-03-18T12:01:51.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2026-04-01T22:03:49.000Z (about 2 months ago)
- Last Synced: 2026-04-02T01:26:47.301Z (about 2 months ago)
- Topics: ai, fastapi, postgres, python, render, tsvector
- Language: Python
- Homepage: https://nx-ai.onrender.com
- Size: 651 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
##  Python
> Python with FastAPI using Postgres & tsvector.
Open Source, production ready Python FastAPI/Postgres app.
[GitHub](https://github.com/goldlabelapps/python) |
[onrender](https://nx-ai.onrender.com) |
[by Goldlabel](https://goldlabel.pro)
- **Python 3.11+**
- **Postgres**
- **tsvector** - Superfast full-text search (with GIN index)
```sh
uvicorn app.main:app --reload
```
#### Install
Create an environment file and add Postgres credentials etc
`cp .env.sample .env`
```bash
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload
```
[localhost](http://localhost:8000) | [onrender](https://nx-ai.onrender.com)
### Full-Text Search (tsvector)
The prospects table includes a `search_vector` column (type: tsvector) that is automatically computed from all text fields on insert. A GIN index is created for this column, enabling fast and scalable full-text search queries.
**How it works:**
- On every insert or update, the `search_vector` is computed from all text columns using PostgreSQL's `to_tsvector('english', ...)`.
- The GIN index (`idx_prospects_search_vector`) allows efficient search queries like:
```sql
SELECT * FROM prospects WHERE search_vector @@ plainto_tsquery('english', 'search terms');
```
This makes searching across all text fields in the prospects table extremely fast, even for large datasets.
- **FastAPI** — RESTful API framework
- **Uvicorn** — ASGI server
- **Pytest** — testing framework
- **HTTPX / TestClient**
#### Docs
FastAPI automatically generates interactive documentation:
- Swagger UI:
- ReDoc:
### 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: