Skip to content

Commit 827f504

Browse files
committed
Update README.md
1 parent 5c85b1a commit 827f504

1 file changed

Lines changed: 85 additions & 31 deletions

File tree

README.md

Lines changed: 85 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,119 @@
1-
## ![Python](/app/static/repoicon.png) Python
1+
## Python FastAPI/Postgres App
22

3-
> With FastAPI using Postgres & tsvector.
3+
**Production-ready, open-source FastAPI application with PostgreSQL and blazing-fast full-text search.**
44

5-
Open Source, production ready Python FastAPI/Postgres app.
5+
---
66

7-
[GitHub](https://github.com/goldlabelapps/python) |
8-
[onr]Render](https://nx-ai.onrender.com) |
9-
[by Goldlabel](https://goldlabel.pro)
7+
### 🚀 Features
108

119
- **Python 3.11+**
12-
- **Postgres**
13-
- **tsvector** - Superfast full-text search (with GIN index)
10+
- **FastAPI** — Modern, high-performance REST API
11+
- **PostgreSQL** — Robust relational database
12+
- **tsvector + GIN** — Superfast full-text search
13+
- **Uvicorn** — Lightning-fast ASGI server
14+
- **Pytest** — Comprehensive testing
1415

15-
```sh
16-
uvicorn app.main:app --reload
17-
```
16+
---
17+
18+
## Project Overview
19+
20+
This project provides a scalable API backend using FastAPI and PostgreSQL, featuring:
1821

19-
#### Install
22+
- Automatic full-text search on all text fields (via tsvector)
23+
- Endpoints for health checks, product management, prompt handling, and prospect management
24+
- Efficient ingestion and processing of large CSV files
2025

21-
Create an environment file and add Postgres credentials etc
26+
---
2227

23-
`cp .env.sample .env`
28+
## Getting Started
29+
30+
### 1. Clone & Setup Environment
2431

2532
```bash
33+
git clone <repo-url>
34+
cd python
35+
cp .env.sample .env # Add your Postgres credentials and settings
2636
python -m venv venv
2737
source venv/bin/activate
2838
pip install -r requirements.txt
39+
```
40+
41+
### 2. Run the App
42+
43+
```bash
2944
uvicorn app.main:app --reload
3045
```
3146

32-
[localhost](http://localhost:8000) | [onrender](https://nx-ai.onrender.com)
47+
Visit [localhost:8000](http://localhost:8000) or [onrender](https://nx-ai.onrender.com)
3348

49+
---
3450

35-
### Full-Text Search (tsvector)
51+
## API Documentation
3652

37-
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.
53+
FastAPI auto-generates interactive docs:
3854

39-
**How it works:**
55+
- [Swagger UI](http://localhost:8000/docs)
56+
- [ReDoc](http://localhost:8000/redoc)
4057

41-
- On every insert or update, the `search_vector` is computed from all text columns using PostgreSQL's `to_tsvector('english', ...)`.
42-
- The GIN index (`idx_prospects_search_vector`) allows efficient search queries like:
58+
---
59+
60+
## Full-Text Search (tsvector)
61+
62+
The `prospects` table includes a `search_vector` column (type: tsvector) computed from all text fields on insert/update. A GIN index enables fast, scalable full-text search:
4363

4464
```sql
4565
SELECT * FROM prospects WHERE search_vector @@ plainto_tsquery('english', 'search terms');
4666
```
4767

48-
This makes searching across all text fields in the prospects table extremely fast, even for large datasets.
49-
- **FastAPI** — RESTful API framework
50-
- **Uvicorn** — ASGI server
51-
- **Pytest** — testing framework
52-
- **HTTPX / TestClient**
68+
**How it works:**
69+
- On every insert/update, `search_vector` is computed using PostgreSQL's `to_tsvector('english', ...)`.
70+
- The GIN index (`idx_prospects_search_vector`) enables efficient search across large datasets.
71+
72+
---
73+
74+
## Processing Large CSV Files
75+
76+
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.
77+
78+
---
79+
80+
## Directory Structure
81+
82+
```
83+
app/
84+
main.py # FastAPI entrypoint
85+
api/ # API endpoints & schemas
86+
health.py
87+
root.py
88+
routes.py
89+
products/
90+
prompts/
91+
prospects/
92+
resend/
93+
utils/
94+
static/ # Static assets (e.g., repoicon.png)
95+
utils/ # Utility scripts
96+
tests/ # Pytest test suite
97+
requirements.txt # Python dependencies
98+
render.yaml # Deployment config (Render.com)
99+
```
100+
101+
---
102+
103+
## Contributing
104+
105+
Contributions are welcome! Please open issues or submit pull requests.
106+
107+
---
53108

54-
#### Docs
109+
## License
55110

56-
FastAPI automatically generates interactive documentation:
111+
This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.
57112

58-
- Swagger UI: <http://localhost:8000/docs>
59-
- ReDoc: <http://localhost:8000/redoc>
113+
---
60114

61-
### Processing Large CSV Files
115+
## Contact
62116

63-
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:
117+
For questions or support, open an issue or contact the maintainer.
64118

65119

0 commit comments

Comments
 (0)