A Flask 3 CRUD API starter in Python 3.12, served by Gunicorn, that stores one resource, items, in PostgreSQL through psycopg 3 and a connection pool. It is for developers who want an application factory with blueprints, input validation, JSON errors, limit and offset paging and a database /health check, ready to rename.
by Light CloudCRUD APIs
main.py calls create_app() once and exposes main:app for Gunicorn, and the tests call the same factory with Flask's test client. Because the factory opens the database before it builds the app, an unreachable database stops the process at start rather than failing the first request. The SQL sits in a few lines per route in app/routes/items.py, so adding Flask-SQLAlchemy later only changes those functions. PORT is read by Gunicorn itself, which binds 127.0.0.1:8000 when it is unset, and the connection uses TLS unless DB_SSLMODE says otherwise. On Light Cloud the deploy installs requirements.txt and runs gunicorn main:app with PORT and the DB_* variables set, redeploying on every push to your copy.
This starter uses psycopg 3 and psycopg-pool: app/config.py builds the connection from DB_HOST, DB_NAME, DB_USER, DB_PASSWORD and DB_SSLMODE, and each route borrows a connection with pool.connection(). You can add Flask-SQLAlchemy later without changing the blueprints' routes.
Add a blueprint in app/routes/ modelled on items.py and its CREATE TABLE in app/db.py, then register the blueprint in create_app() in app/__init__.py.
flask run starts Flask's development server, which is not meant for live traffic. gunicorn main:app serves the same app with 4 threads per worker, as set in gunicorn.conf.py.
Press Deploy on this template: Light Cloud copies the repo into your GitHub account, creates a PostgreSQL database and sets DB_HOST, DB_NAME, DB_USER and DB_PASSWORD on the app. Databases need a paid plan.
Yes. Any host with Python 3.12 and a reachable PostgreSQL runs it: install requirements.txt, set the DB_* variables and start gunicorn main:app --bind 0.0.0.0:$PORT.
Start a Flask JSON API with an app factory and a real WSGI server, not flask run

Start a Python CRUD API on PostgreSQL with FastAPI, live docs and pytest set up
Start a Python CRUD API on PostgreSQL with Django REST framework, migrations and tests