| Field |
Type |
Notes |
authorUID |
String |
Primary Key |
firstName |
String |
|
middleName |
String |
Nullable |
lastName |
String |
|
dateOfBirth |
Date |
|
hometown |
String |
|
country |
String |
|
| Field |
Type |
Notes |
publisherUID |
String |
Primary Key |
name |
String |
|
location |
String |
|
| Field |
Type |
Notes |
iSBN |
String |
Primary Key / UID |
title |
String |
|
authorIDs |
String |
FK → Author |
publishYear |
Int |
|
publisherUIDs |
String |
FK → Publisher |
locale |
String |
e.g. "en", "fr" |
Base URL: https://{backend_url}:{port}/api
GET /api/books
POST /api/books/add
PUT /api/books/<isbn>
DELETE /api/books/<isbn>
routes below don't exist but was in original plan
GET /api/books?search=%s&lang=en&publish_year>{date}
GET /api/books?limit=%d&page=%d
GET /api/authors
routes below don't exist but was in original plan
GET /api/authors?search=%s
GET /api/authors?limit=%d&page=%d
GET /api/publishers
routes below don't exist but was in original plan
GET /api/publishers?search=%s
GET /api/publishers?limit=%d&page=%d
GET /books/import?url=<wikipedia_url>
GET https://{backend_url}:{port}/api/books?search="lang=en,publish_year=>2018-5-2"
User clicks button on Frontend
│
▼
Frontend sends GET request to backend
│ GET {backend_url}/api/books
▼
[Anthony] Flask Route calls DBAPI.GetBooks()
│
▼
[Brian] PyMongo runs db.books.find() against MongoDB
│
▼
[Backend] Results serialized to JSON
│
[Anthony] Flask Returns JSON to frontend
│
▼
React renders the book list
Search is handled on the client-side in React. Then the frontend fetches all teh books from the GET /api/books and filters by title using JS Array.filter()