Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,293 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MusicSalesApp

A Blazor Server application with authentication and authorization.

Setup

Database Configuration

The application uses SQL Server LocalDB for development. You need to create an appsettings.Development.json file with your connection string.

  1. Copy MusicSalesApp/appsettings.Development.json.sample to MusicSalesApp/appsettings.Development.json
  2. Adjust the connection string if needed

Note: appsettings.Development.json is not checked into source control for security reasons.

SignalR Connection Management

The application uses SignalR for real-time features and implements automatic connection management to provide a seamless user experience:

Keep-Alive Configuration

  • Keep-alive interval: 15 seconds - Server sends ping to keep connection active
  • Client timeout: 60 seconds - Connection considered dead if no response
  • Circuit retention: 3 minutes - Server retains inactive circuit state
  • Handshake timeout: 15 seconds - Time allowed for initial connection

Automatic Reconnection

  • Silent reconnection: No modal dialogs shown to users
  • Exponential backoff: Retries at 2s, 5s, and 10s intervals
  • Auto-reload: Page automatically reloads after 3 failed attempts
  • SEO friendly: Reconnection UI hidden from search engines

This configuration ensures:

  • Connections stay alive during normal usage
  • Minimal disruption during temporary network issues
  • Automatic recovery without user intervention
  • No reconnection text appearing in search engine results

Running the Application

dotnet restore
dotnet build
dotnet run --project MusicSalesApp

The database will be created automatically on first run with seed data.

Default Users

After running the application for the first time, you can log in with:

  • Admin User:

    • Email: admin@app.com
    • Password: Password_123
    • Role: Admin
    • Permissions: ManageUsers, ValidatedUser
  • Regular User:

    • Email: user@app.com
    • Password: Password_123
    • Role: User
    • Permissions: ValidatedUser

Testing

dotnet test

Permissions

The application uses a custom permissions system:

  • ManageUsers - Assigned to Admin role
  • ValidatedUser - Assigned to Admin and User roles
  • NonValidatedUser - Reserved for future use

Features

Music Library and Playback

  • Browse music library with albums and individual songs
  • 60-second preview for non-subscribers
  • Full playback for active subscribers
  • Create and manage playlists (requires an active subscription — see below)

Subscription-Only Access

Individual song and album purchases have been removed — there is no cart and no permanent per-song ownership. All full-length streaming and playlist access is gated behind the monthly subscription described below. CartController still exists but its mutating endpoints are intentionally disabled (they return an error directing users to subscribe).

The subscription checkout flow uses PayPal Expanded Checkout (multiple payment options, 3D Secure authentication) as well as in-app purchase via Google Play Billing / Apple StoreKit on the mobile app. For detailed information about the PayPal Expanded Checkout integration, see PAYPAL_EXPANDED_CHECKOUT.md.

Monthly Subscription

The application supports a monthly subscription model that provides unlimited streaming access to all music.

Subscription Features

  • Monthly Price: Determined by the PayPal plans selected for the web subscription offer
  • Unlimited Access: Subscribers can stream all music in full without purchasing
  • Flexible Cancellation: Cancel anytime, access continues until end of paid period
  • PayPal Integration: Secure subscription management through PayPal

Configuration

Add the following to your appsettings.json:

"PayPal": {
  "ClientId": "YOUR_PAYPAL_CLIENT_ID",
  "Secret": "YOUR_PAYPAL_SECRET",
  "ApiBaseUrl": "https://api-m.sandbox.paypal.com/",
  "ReturnBaseUrl": "https://localhost:7144"
}
  • Use sandbox URL for testing: https://api-m.sandbox.paypal.com/
  • Use production URL for live: https://api-m.paypal.com/
  • Update ReturnBaseUrl to match your application's base URL
  • In Admin Settings, select the active PayPal plan (and a matching no-trial plan when required) that the web app should advertise and use for checkout

Using Subscriptions

  1. Navigate to "Manage Subscription" from the menu (requires login)
  2. Review subscription terms
  3. Check "I agree to the subscription terms and conditions"
  4. Click "Sign Up for Monthly Subscription"
  5. Complete payment through PayPal
  6. Enjoy unlimited streaming!

To cancel:

  1. Navigate to "Manage Subscription"
  2. Click "Cancel Subscription"
  3. Confirm cancellation
  4. Access continues until the end of your current billing period

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages