Main server function for the artist profile module. This is a pure presentation component that receives all data as reactives from the parent app and renders the profile UI components.
modArtistServer(id, artist_data, profile_data, r = NULL)Module ID
Reactive containing artist data (from artutils::get_artist_by_slug)
Reactive containing complete profile data. Expected fields:
collections: data.frame with collection summaries
stats: list with artwork/collection counts
recent_works: data.frame with recent artworks
featured_collection_uuid: UUID of featured collection (optional)
timeline: timeline data from get_artist_timeline() (optional)
insights: insights data from get_artist_unique_insights() (optional)
evolution: evolution data from get_artist_evolution() (optional)
narrative_voice: voice data from get_artist_voice() (optional)
Reactive values object for parent communication (optional)
Reactive values object with internal state (for testing)
Architecture: The parent app loads ALL data at session start and passes it
to this module via the profile_data reactive. The module never accesses the
database directly.
if (FALSE) { # \dontrun{
server <- function(input, output, session) {
# App loads database connection
cn <- artcore::dbc()
onStop(function() {
artcore::dbd(cn)
})
# App loads artist data
artist_data <- reactive({
artutils::get_artist_by_slug("jane-doe", cn)
})
# App loads ALL profile data at session start
profile_data <- reactive({
req(artist_data())
artist_uuid <- artist_data()$artist_uuid[1]
list(
collections = artutils::get_artist_collections_summary(artist_uuid, cn),
stats = get_artist_career_stats(artist_uuid, cn),
recent_works = artutils::get_artist_recent_works(artist_uuid, limit = 9, cn),
timeline = get_artist_timeline(artist_uuid, cn),
insights = get_artist_unique_insights(artist_uuid, cn),
evolution = get_artist_evolution(artist_uuid, cn),
narrative_voice = get_artist_voice(artist_uuid, cn, artist_data())
)
})
# Module receives only data - no database connection
modArtistServer("profile", artist_data, profile_data)
}
} # }