https://github.com/themusharraf/fastapibooks
A REST API built with Python and FastAPI, integrating with PostgreSQL for CRUD operations (Create, Read, Update, Delete) on books.
https://github.com/themusharraf/fastapibooks
api architecture data-structures database fastapi render server sqlalchemy
Last synced: 5 months ago
JSON representation
A REST API built with Python and FastAPI, integrating with PostgreSQL for CRUD operations (Create, Read, Update, Delete) on books.
- Host: GitHub
- URL: https://github.com/themusharraf/fastapibooks
- Owner: themusharraf
- Created: 2024-06-14T05:14:22.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-07-06T21:59:23.000Z (about 1 year ago)
- Last Synced: 2024-12-30T15:29:56.951Z (7 months ago)
- Topics: api, architecture, data-structures, database, fastapi, render, server, sqlalchemy
- Language: Python
- Homepage:
- Size: 58.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BookAPI Project architecture
## Author: Musharraf 👽## BooksAPI endpoints

## BooksAPI ORM

## runner
```shell
uvicorn main:app --reload
```## Example Endpoint for test User:
```python
def test_get_user():
requests = client.get("/users/1")
assert requests.status_code == 200
assert type(requests.json()['email']) == str
assert type(requests.json()['is_active']) == bool```
## Example Endpoint for test Books:```python
def test_get_books():
requests = client.get("/books/")
assert requests.status_code == 200
assert type(requests.json()) == list
```
## Example Request for Updating User:
### http```http
PUT /users/1
Content-Type: application/json{
"username": "new_username",
"email": "[email protected]",
"is_active": true,
"password": "new_password"
}
```
## Example Request for Updating Book:
### http```http
PUT /books/1
Content-Type: application/json{
"title": "Updated Title",
"language": "English",
"isbn": "978-3-16-148410-0",
"pages": 250
}
```