djsiddz / next-book

What's the next book I should read? Your personal book collection management app, built using NextJS with Typescript.
https://next-book-djsiddz.vercel.app
0 stars 0 forks source link

Database Schema #2

Open djsiddz opened 1 year ago

djsiddz commented 1 year ago

We need to store the users and their books.

For users, we need some basic information like:

For books, we need the following information:

We can normalize the books schema so that this data can be shared amongst users, and we reduce data duplication.

We can have a relation table booksOwned, where we can move the below details, as these are specific to the unique book ownership and not the book itself.

For booksOwned we can have the following information:

That leaves the following information in the books schema:


Next Steps

djsiddz commented 1 year ago

If in a future scope, we want to show users their reading progress historically and kind of like a streak on a calendar, how many days they've read, then we will need some additional structure to enable it.

djsiddz commented 10 months ago

Keeping isbn and format fields with books schema instead of booksOwned schema.

djsiddz commented 10 months ago

Added profiles in place of users to avoid confusion with auth.users table. Keeping only first_name, last_name and screen_name fields in the profiles table.

djsiddz commented 10 months ago

Added booksOwned table. Will record final schema created here for future reference.

djsiddz commented 10 months ago

Reference here: https://supabase.com/docs/guides/getting-started/quickstarts/nextjs

djsiddz commented 1 month ago

Rethinking the schema as I have learnt some better things. I am missing a lot of book information that I get from Open Library / Google Books API which I am not capturing. Also missing - book covers, and authors.