Overview
TrackGeek provides comprehensive media tracking across 6 media types, each powered by industry-leading external APIs. The system automatically fetches, caches, and refreshes media data to ensure accurate and up-to-date information.Supported Media Types
TrackGeek supports tracking across six distinct media categories:Anime
Japanese animation series and movies
Manga
Japanese comics and graphic novels
TV Shows
Television series and episodes
Movies
Feature films and cinema releases
Games
Video games across all platforms
Books
Books and literary works
Data Source Integration
Each media type is powered by a specialized external API that provides comprehensive metadata, imagery, and relationships.Anime & Manga: Jikan API
API Base URL:https://api.jikan.moe/v4
Anime Data Points
Anime Data Points
The Jikan service fetches comprehensive anime data including:
- Basic Info: Title, type, source, episodes, status, rating
- Temporal Data: Aired dates, duration, season, year, broadcast schedule
- Metadata: Synopsis, background, rank, popularity
- Media: Trailer videos, promotional videos, music videos, episode previews
- Production: Producers, licensors, studios
- Classification: Genres, explicit genres, themes, demographics
- Characters: Character profiles with voice actors and roles
- Staff: Production staff with positions
- Relationships: Related anime/manga entries
- External Links: Official and fan sites
src/shared/infra/integrations/jikan.service.ts:111-266Manga Data Points
Manga Data Points
The Jikan service fetches comprehensive manga data including:
- Basic Info: Title, type, chapters, volumes, status, publishing state
- Temporal Data: Published dates, rank, popularity
- Metadata: Synopsis
- Credits: Authors and serializations
- Classification: Genres, explicit genres, themes, demographics
- Characters: Character profiles with roles
- Relationships: Related manga/anime entries
- External Links: Official and fan sites
src/shared/infra/integrations/jikan.service.ts:268-349TV Shows & Movies: TMDB API
API Base URL:https://api.themoviedb.org/3
Movie Data Points
Movie Data Points
The TMDB service fetches comprehensive movie data including:
- Identification: TMDB ID, IMDB ID
- Basic Info: Title, original title, original language, tagline
- Media: Poster, backdrop, videos (trailers, teasers, behind-the-scenes)
- Financial: Budget, revenue
- Release: Release date, status
- Production: Production companies, production countries, spoken languages
- Collection: Belongs to collection (for franchises)
- Credits: Full cast and crew with roles and profile images
- Metadata: Overview, popularity, runtime, genres, homepage
src/shared/infra/integrations/tmdb.service.ts:116-226TV Show Data Points
TV Show Data Points
The TMDB service fetches comprehensive TV show data including:
- Identification: TMDB ID
- Basic Info: Name, original name, original language, tagline, type
- Media: Poster, backdrop
- Production: Created by, production companies, production countries, networks
- Status: In production, status, languages
- Episodes: Number of episodes, episode runtime
- Seasons: Full season and episode breakdown with:
- Season number, name, air date, poster
- Individual episodes with names, overviews, air dates, still images
- Air Dates: First air date, last air date, last episode to air, next episode to air
- Credits: Full cast and crew with roles and profile images
- Metadata: Popularity, homepage, origin country, genres
src/shared/infra/integrations/tmdb.service.ts:228-377Games: IGDB API
API Base URL:https://api.igdb.com/v4
IGDB uses Twitch OAuth2 for authentication. Access tokens are cached and automatically refreshed before expiration.
Game Data Points
Game Data Points
The IGDB service fetches extensive game data including:
- Basic Info: Name, slug, summary, storyline
- Release: First release date, release dates by platform
- Media: Cover art, screenshots, artworks, videos
- Classification: Genres, themes, keywords, player perspectives, game modes
- Ratings: Age ratings with organizations and synopses
- Companies: Involved companies (developers, publishers, porters, supporting)
- Platforms: Supported platforms
- Multiplayer: Detailed multiplayer modes (co-op, LAN, split-screen, online)
- Localization: Game localizations and language support
- Relationships:
- Similar games
- Parent game, forks, ports
- Expansions, DLCs, standalone expansions
- Remakes, remasters
- Bundles
- Collections: Game collections and franchises
- Technical: Game engines, game status, game type
- Alternative Names: Alternative titles and comments
- External Games: Cross-references to other platforms
src/shared/infra/integrations/igdb.service.ts:138-557Books: Hardcover API
API Base URL:https://api.hardcover.app/v1/graphql
Book Data Points
Book Data Points
The Hardcover service fetches comprehensive book data using GraphQL:
- Basic Info: Title, subtitle, alternative titles, slug, state
- Content: Description, headline, pages, audio seconds
- Release: Release date, release year
- Classification: Book category ID, literary type ID, compilation status
- Editions:
- Default audio edition
- Default cover edition
- Default ebook edition
- Default physical edition
- Up to 30 edition variants
- Media: Cover images for all editions
- Series: Featured book series information
- Links: External links to retailers and reviews
- Canonical: Canonical book reference
- Metadata: Curation status, editions count
src/shared/infra/integrations/hardcover.service.ts:83-263Database Schema
Each media type has a dedicated database model that stores the fetched data locally.- Anime
- Manga
- TV Show
- Movie
- Game
- Book
prisma/schema.prisma:356-401Data Flow Architecture
The media tracking system follows a consistent pattern across all media types:Search Flow
- Client Request: User searches for media by query string
- Cache Check: Check if search results are cached (24-hour TTL)
- External API Call: If not cached, fetch from external API
- Cache Results: Store results for 24 hours
- Return Data: Send search results to client
src/modules/anime/anime.service.ts:30-32):
Fetch Flow
- Client Request: User requests specific media by ID
- Cache Check: Check if media is cached (6-hour TTL)
- Database Check: If not cached, check database
- External API Call: If not in database, fetch from external API
- Store in Database: Save fetched data with
lastRefreshedAttimestamp - Cache Data: Cache for 6 hours
- Return Data: Send media details to client
src/modules/anime/anime.service.ts:34-56):
Refresh System
TrackGeek implements an intelligent refresh system to keep media data up-to-date without overwhelming external APIs.Refresh Interval
Media data can be refreshed once every 24 hours per item.
src/shared/constants/refresh-interval.ts:1):
Refresh Flow
- Refresh Request: User or system triggers refresh for specific media
- Existence Check: Verify media exists in database
- Time Check: Ensure 24 hours have passed since
lastRefreshedAt - Cache Invalidation: Delete cached entry if exists
- External API Call: Fetch latest data from external API
- Database Update: Update media record with new data and timestamp
- Re-cache: Cache fresh data for 6 hours
src/modules/anime/anime.service.ts:58-87):
Error Handling
Common Refresh Errors
Common Refresh Errors
ANIME_NOT_FOUND: Media doesn’t exist in databaseANIME_ALREADY_REFRESHED: Less than 24 hours since last refreshJIKAN_SERVICE_UNAVAILABLE: External API is down or rate-limitedTMDB_SERVICE_UNAVAILABLE: TMDB API is unavailableIGDB_SERVICE_UNAVAILABLE: IGDB API is unavailableHARDCOVER_SERVICE_UNAVAILABLE: Hardcover API is unavailable
Caching Strategy
TrackGeek uses a multi-tier caching strategy for optimal performance:| Cache Type | TTL | Use Case |
|---|---|---|
| Search Results | 24 hours | Search queries remain consistent |
| Media Details | 6 hours | Balance freshness with performance |
| External API Data | 24 hours | Reduce API calls to external services |
- Anime:
anime:id:{malId} - Manga:
manga:id:{malId} - Movie:
movie:id:{tmdbId} - TV Show:
tvshow:id:{tmdbId} - Game:
game:id:{igdbId} - Book:
book:id:{hardcoverId}
Best Practices
Cache First
Always check cache before hitting the database or external APIs
Respect Rate Limits
Use the 24-hour refresh interval to avoid overwhelming external APIs
Handle Failures
Implement proper error handling for external API failures
Store Efficiently
Use JSON fields for complex nested data from external APIs