FastAPI/Python/Postgres/tsvector. Open Source, production ready Python FastAPI/Postgres app for NX
uvicorn app.main:app
Create an environment file and add Postgres credentials etc
cp .env.sample .env
# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start development server
uvicorn app.main:app --reloadThe API is at http://localhost:8000.
localhost | Public RESTful API
- Python 3.11+
- Postgres
- tsvector - Superfast search
- FastAPI — RESTful API framework
- Uvicorn — ASGI server
- Pytest — testing framework
- HTTPX / TestClient
FastAPI automatically generates interactive documentation:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
app/
__init__.py
main.py # FastAPI application entry point
api/
__init__.py
routes.py # API endpoint definitions
tests/
__init__.py
test_routes.py # Unit and integration tests
requirements.txt
| Method | Path | Description |
|---|---|---|
| GET | / |
Welcome message |
| GET | /health |
Health check — returns ok |
| POST | /echo |
Echoes the JSON message field |