Skip to contents

Authentication and Access Control for Artalytics Platform

artauth provides lead capture and authentication services for the Artalytics platform, including artist waiting list management, whitepaper download tracking, and security utilities for the authentication system.

Installation

# Install from GitHub
remotes::install_github("artalytics/artauth")

# Or using pak
pak::pkg_install("artalytics/artauth")

Features

Artist Waiting List

Manage artist applications for the pilot program:

library(artauth)

# Add an artist to the waiting list
waitlist_id <- create_waitlist_entry(
 email = "artist@example.com",
 full_name = "Jane Artist",
 specialties = "Digital Photography, NFT Art",
 url_portfolio = "https://janeartist.com",
 source = "landing_page"
)

# Review pending applications
pending <- get_pending_waitlist()

# Update status through the workflow
update_waitlist_status(waitlist_id, status = "reviewing")
update_waitlist_status(waitlist_id, status = "invited")

# Convert to user account
user_id <- convert_waitlist_to_user(waitlist_id)

Whitepaper Download Tracking

Track and analyze investor/artist engagement:

# Log a download
download_id <- log_whitepaper_download(
 email = "investor@vc.com",
 user_type = "investor",
 ip_address = request$REMOTE_ADDR
)

# Check prior engagement
has_downloaded_whitepaper("investor@vc.com")

# Get analytics
stats <- get_whitepaper_stats()
recent <- get_recent_downloads(limit = 20, user_type = "investor")

Security Utilities

Cryptographic functions for authentication:

# Generate secure tokens
token <- generate_secure_token(32)

# Hash tokens for storage
hashed <- hash_token(token)

# Validate email format
is_valid_email("user@example.com")  # TRUE

Environment Variables

artauth uses artcore for database connectivity. Configure the marketing database via ..dbc("artsite"):

# Required - Marketing database (artalytics-leads cluster)
ART_PGHOST_SITE=artalytics-leads-do-user-16793376-0.d.db.ondigitalocean.com
ART_PGPORT_SITE=25060
ART_PGUSER_SITE=shiny
ART_PGPASS_SITE=<your-password>
ART_PGDATA_SITE=marketing

Test the connection:

library(artauth)
cn <- artcore::..dbc("artsite")
artcore::..dbd(cn)

Database Schema

artauth manages tables in the leads schema:

  • leads.artist_waitlist - Artist pilot program applications
  • leads.whitepaper_downloads - Whitepaper download tracking

See AGENTS.md for full schema documentation.

Roadmap

Currently Available

  • Artist waiting list management (CRUD, status workflow)
  • Whitepaper download tracking and analytics
  • Security utilities (token generation, hashing, email validation)

TBD: Authentication System

The following features are planned:

  • Magic link generation and verification
  • User account management (CRUD)
  • Role-based access control (artist, collector, investor, admin)
  • Session management
  • Integration with artsend for email delivery

Package Hierarchy

appPlatform / mod* packages (application layer)
        |
    artutils (data access layer)
        |
    artauth (authentication layer)  ← This package
        |
    artcore (infrastructure layer)

artauth depends on artcore (database connections) and rdstools (logging). It provides authentication and lead capture services for application-layer packages.

Documentation

Development

For AI agent instructions and coding standards, see AGENTS.md.

License

Proprietary - Artalytics, Inc.