- [] Contributing.md
- [] Remove ruff from pre-commit and replace with tox
- [] Add CI workflows for dev, staging and prod branches
- [] Feat: Blog category, Blog Comment, Blog Status, Search and Filter, Add more fields to Blog model
- Change id to uuid
Before you begin, ensure you have the following:
- A Linux environment, or WSL (if using Windows)
- Python 3.10 or later installed
git clone https://github.com/Pythonian/fastapi_web.git
cd fastapi_webmake venv
source .venv/bin/activatemake installUpdate the .env file with your specific configuration values.
Run the migrations to set up your database tables:
make migrateEnsure everything is set up correctly:
make checkmake runTo clean up the project directory:
make cleanYou can run make to see all available commands.
Detailed documentation of available API endpoints.
-
URL:
/v1/blog/ -
Method:
POST -
Request Body:
{ "title": "string", "content": "string", "author": "string" } -
Response:
{ "id": "integer", "title": "string", "content": "string", "author": "string", "created_at": "datetime" }
-
URL:
/v1/blog/ -
Method:
GET -
Response:
[ { "id": "integer", "title": "string", "content": "string", "author": "string", "created_at": "datetime" } ]
-
URL:
/v1/blog/{id} -
Method:
GET -
Response:
{ "id": "integer", "title": "string", "content": "string", "author": "string", "created_at": "datetime" }
-
URL:
/v1/blog/{id} -
Method:
PUT -
Request Body:
{ "title": "string", "content": "string", "author": "string" } -
Response:
{ "id": "integer", "title": "string", "content": "string", "author": "string", "created_at": "datetime" }
-
URL:
/v1/blog/{id} -
Method:
DELETE -
Response:
{ "message": "Blog post deleted successfully" }
The "API Endpoints" page should document the available API endpoints, their purposes, and how to use them. Here's an example:
This page provides detailed documentation of the available API endpoints in the project.
-
URL:
/v1/blog/ -
Method:
POST -
Description: Create a new blog post.
-
Request Body:
{ "title": "string", "content": "string", "author": "string" } -
Response:
{ "id": "integer", "title": "string", "content": "string", "author": "string", "created_at": "datetime" }
-
URL:
/v1/blog/ -
Method:
GET -
Description: Retrieve a list of blog posts.
-
Response:
[ { "id": "integer", "title": "string", "content": "string", "author": "string", "created_at": "datetime" } ]
-
URL:
/v1/blog/{id} -
Method:
GET -
Description: Retrieve a single blog post by its ID.
-
Response:
{ "id": "integer", "title": "string", "content": "string", "author": "string", "created_at": "datetime" }
-
URL:
/v1/blog/{id} -
Method:
PUT -
Description: Update an existing blog post.
-
Request Body:
{ "title": "string", "content": "string", "author": "string" } -
Response:
{ "id": "integer", "title": "string", "content": "string", "author": "string", "created_at": "datetime" }
-
URL:
/v1/blog/{id} -
Method:
DELETE -
Description: Delete a blog post by its ID.
-
Response:
{ "message": "Blog post deleted successfully" }
Rate limiting Caching PATCH to PUT? read_blog - 400 bad request?