library(artcore)
# Check all at once
check_env_dba() # Database
check_env_cdn() # CDN (DigitalOcean Spaces)
check_env_app() # Application modeGet up and running with artcore in 5 minutes.
Prerequisites
Environment variables must be configured. See Environment Variables.
-
Install the package:
pak::pkg_install("artalytics/artcore")
Check Your Environment
Before doing anything, verify your credentials are set:
If any check fails, you’ll see exactly which variables are missing.
Connect to Database
# Open connection
cn <- dbc()
# Run a query
result <- DBI::dbGetQuery(cn, "SELECT COUNT(*) FROM app.artist_index")
print(result)
# Close connection
dbd(cn)Generate UUIDs
When creating new entities, use the platform UUID generators:
# Each entity type has a recognizable prefix
artist <- gen_artist_id() # Starts with "88"
artwork <- gen_artwork_id() # Starts with "99"
collection <- gen_collection_id() # Starts with "77"
# For testing, use extended prefixes
test_art <- gen_artwork_id(test = TRUE) # Starts with "90000000"Check CDN Assets
# Check if an object exists
has_object("art-public", "thumbnails/88xxx.../99xxx....jpeg")
# Check if any objects exist under a prefix
has_prefix("art-vault", "uploads/88xxx.../99xxx.../")
# List all objects under a prefix
keys <- cdn_list_keys("art-data", "processed/88xxx.../99xxx.../")Upload to CDN
artist <- "88xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
artwork <- gen_artwork_id()
# Upload a directory to the vault
write_art_vault(artist, artwork, local_path = "path/to/bundle/")
# Upload processed data
write_art_data(artist, artwork, local_path = "path/to/processed/")
# Upload a thumbnail
write_art_public(artist, artwork, local_path = "thumbnail.jpeg")Next Steps
- Get Started - Full walkthrough of a complete workflow
- CDN Operations - Deep dive into CDN features
- Reference - Complete function documentation
