This is a simple RESTful API built using Flask and PostgreSQL with SQLAlchemy ORM. It includes endpoints to create, read, update, and delete (CRUD) venue data, and it's ready for extension with additional resources like users. The project can use Alembic for database migrations.
Flask_app/
โโโ app.py # Main Flask app with API routes
โโโ config.py # Configuration settings (including DB URI)
โโโ models.py # SQLAlchemy models and serialization
โโโ migration/ # Alembic migration scripts (created later)
โโโ alembic.ini # Alembic configuration file
โโโ README.md # Project documentation
Install required packages in your virtual environment:
pip install -r requirements.txtconfig.py defines the database connection
Defined in models.py. Example: Venue model with serialize() method for JSON response.
Start the app (after activating your virtual environment):
flask run or python app.py| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Health check |
| POST | /venues |
Create a new venue |
| GET | /venues |
Get all venues |
| GET | /venues/<id> |
Get a single venue |
| PUT | /venues/<id> |
Update a venue |
| DELETE | /venues/<id> |
Delete a venue |
You can use Postman to send requests to http://localhost:5000.
If using raw Alembic:
-
Initialize:
alembic init migrations
-
Configure
alembic.iniwith your database URI or modifyenv.pyto import fromConfig. -
Create and apply migration:
alembic revision --autogenerate -m "Create Venue table" alembic upgrade head

