Skip to content

Conversation

ronnenga
Copy link
Member

@ronnenga ronnenga commented Oct 9, 2026

Added a functioning Google API Fetch that imports to Database
Works by running " npx tsx --env-file=.env src/scripts/importBooks.ts " in /server/ directory

Files Created:

  • server/src/scripts/importBooks.ts - Bulk importing, main function. Needs improving (Issue Improve Google Data Importing #60 )

  • server/src/scripts/testBookImport.ts - Tests api inserting to database, 1 entry

  • server/src/scripts/testGoogleBooks.ts - Tests Google API, prints output

  • server/src/utils/fetchGoogleBooks.ts - sends API fetch to google, handles errors, and auto retry

  • server/src/utils/genreMapping.ts - Currently Unused, needs to be fixed for future mappings ( Issue Fix Category Mappings #58 )

  • server/src/utils/transformBooks.ts - edits API data from google, to usable .json format for the database

  • server/src/utils/validateBooks - Checks API data if its acceptable for the database. Needs finalizing (Issue Decide Info (meeting) #59 )

Files Edited:

  • server/src/models/book.ts - Added another genre for future mapping (not in use currently, issue Fix Category Mappings #58)
  • server/package.json - Removed MockTest import run

Files Removed:

  • server/src/scripts/importMockBooks.ts - Dont need any more

@ronnenga ronnenga requested a review from a team as a code owner October 9, 2026 15:30
@ronnenga ronnenga linked an issue Oct 9, 2026 that may be closed by this pull request
Copy link
Member

@adriach adriach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ser bra ut!

@adriach adriach merged commit 5481579 into main Oct 13, 2026
@adriach adriach deleted the ronny-51-google-api branch October 13, 2026 09:34
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set up google API for importing data
2 participants