AudioBlocks is a comprehensive artist dashboard for managing music, earnings, analytics, events, merchandise, and fan engagement on the blockchain. This repository contains the Next.js frontend application that empowers artists to take control of their music career.
- Music Management: Upload, organize, and distribute your tracks
- Analytics Dashboard: Real-time insights into streams, downloads, and revenue
- Event Management: Create and manage concerts, meet-and-greets, and virtual events
- Merchandise Store: Set up and track merchandise sales
- Fan Messaging: Direct communication with your fanbase
- Team & Staff Access: Invite managers and viewers to the workspace, with an activity log that also records the attempts a role was not allowed to make
- Web3 Integration: Stellar blockchain integration for transparent payments and NFTs
- Premium Features: Enhanced tools for verified artists
- Responsive Design: Optimized for desktop, tablet, and mobile devices
- Dark/Light Mode: User-preference based theming
- Keyboard Shortcuts: Jump between dashboard sections without leaving the keyboard
- Accessibility: WCAG 2.1 AA compliance with screen reader support
Before you begin, ensure you have the following installed:
- Node.js: Version 20.x or higher (LTS recommended)
- npm: Version 9.x or higher (bundled with Node.js)
- Git: For version control
- Modern Browser: Chrome, Firefox, Safari, or Edge (latest versions)
Optional:
- Docker: For containerized development
- Playwright: For E2E testing (installed as dev dependency)
git clone https://github.com/AudioBitsStellar/AudioBlocks_For_Artist.git
cd AudioBlocks_For_Artistcd app
npm installCreate a .env.local file in the app directory:
# API Configuration
NEXT_PUBLIC_API_BASE_URL=https://api.audioblocks.com
NEXT_PUBLIC_API_URL=https://api.audioblocks.com
# Sentry Configuration (optional for error tracking)
SENTRY_DSN=your-sentry-dsn
SENTRY_ORG=your-org
SENTRY_PROJECT=your-project
# Stellar Configuration
NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_STELLAR_HORIZON_URL=https://horizon-testnet.stellar.orgSee app/.env.example for a complete list of available environment variables.
npm run devOpen http://localhost:3000 in your browser. The app will hot-reload as you make changes.
Run these commands from the app directory:
| Command | Description |
|---|---|
npm run dev |
Start development server on port 3000 |
npm run build |
Build production-optimized bundle |
npm start |
Run production server (requires build first) |
npm run lint |
Run ESLint for code quality checks |
npm run format |
Format code with Prettier |
npm run test |
Run unit tests with Vitest |
npm run test:ui |
Open Vitest UI for interactive testing |
npm run test:coverage |
Generate test coverage report |
npm run test:e2e |
Run end-to-end tests with Playwright |
npm run storybook |
Start Storybook component explorer |
npm run storybook:build |
Build static Storybook |
AudioBlocks_For_Artist/
βββ .github/ # GitHub configuration
β βββ workflows/ # CI/CD pipelines
β βββ ISSUE_TEMPLATE/ # Issue templates
βββ app/ # Next.js application
β βββ public/ # Static assets (images, fonts)
β βββ src/
β β βββ app/ # Next.js App Router pages
β β β βββ dashboard/ # Dashboard routes
β β β β βββ overview/
β β β β βββ my-music/
β β β β βββ analytics/
β β β β βββ events/
β β β β βββ merches/
β β β β βββ messages/
β β β β βββ team/
β β β β βββ premium/
β β β β βββ settings/
β β β βββ layout.tsx # Root layout
β β βββ components/ # Reusable React components
β β β βββ Sidebar.tsx
β β β βββ TopHeader.tsx
β β β βββ ...
β β βββ context/ # React Context providers
β β β βββ PlaybackContext.tsx
β β β βββ playbackReducer.ts
β β β βββ provider.tsx
β β βββ hooks/ # Custom React hooks
β β βββ services/ # API client and data services
β β β βββ messageService.ts
β β β βββ ...
β β βββ api/ # Axios configuration
β β βββ lib/ # Utility libraries
β β βββ types/ # TypeScript type definitions
β β βββ utils/ # Helper functions
β β βββ theme/ # Theme configuration
β β βββ __tests__/ # Unit and integration tests
β β βββ __mocks__/ # Test mocks
β βββ e2e/ # Playwright E2E tests
β βββ .storybook/ # Storybook configuration
β βββ package.json
β βββ next.config.ts
βββ docs/ # Additional documentation
βββ CONTRIBUTING.md # Contribution guidelines
βββ CODE_OF_CONDUCT.md # Code of conduct
βββ README.md # This file
- Next.js 16.1.5 - React framework with App Router
- React 19.2.0 - UI library
- TypeScript 5 - Type-safe JavaScript
- Tailwind CSS 4 - Utility-first CSS framework
- Framer Motion 12 - Animation library
- Lucide React - Icon library
- React Context + useReducer - Local state management
- @tanstack/react-query 5 - Server state management
- React Hook Form 7 - Form handling
- Zod 3 - Schema validation
- Axios 1 - HTTP client
- @stellar/freighter-api 6 - Stellar wallet integration
- Radix UI - Accessible component primitives
- Recharts 3 - Data visualization
- Sonner - Toast notifications
- Vitest 3 - Unit testing framework
- @testing-library/react 16 - Component testing utilities
- Playwright 1 - E2E testing
- Storybook 8 - Component development environment
- ESLint 9 - Linting
- Prettier 3 - Code formatting
- Husky 9 - Git hooks
- lint-staged 15 - Staged file linting
- @sentry/nextjs 9 - Error tracking and performance monitoring
The application uses a hybrid state management approach:
-
React Context + useReducer: For global UI state (playback, theme, auth)
PlaybackContextuses a reducer pattern with actions for predictable state transitions- Reducers are extracted to separate files for testability
-
TanStack Query: For server state caching and synchronization
- Automatic refetching and invalidation
- Optimistic updates for better UX
-
Local State: For component-specific state using
useState
- Atomic Design: Components organized by complexity
- Client Components: Marked with
"use client"directive where interactivity is needed - Server Components: Default for better performance and SEO
- Compound Components: For complex UI like dialogs and tabs
Next.js App Router with file-based routing:
/dashboard/*- Protected routes requiring authentication/- Public landing page- Middleware handles route protection
- Centralized Axios instance in
src/api/axios.ts - API endpoints defined in
src/api/api-endpoint.ts - Service layer abstracts API calls from components
- Semantic HTML elements
- ARIA labels and roles where needed
- Keyboard navigation support
- Focus management
- Screen reader announcements via live regions
- Color contrast compliance (WCAG AA)
cd app
npm run build
npm startDevelopment:
docker-compose upProduction:
docker build -f Dockerfile -t audioblocks-artist .
docker run -p 3000:3000 audioblocks-artistEnsure production environment variables are set:
- Update API URLs to production endpoints
- Configure Sentry DSN for error tracking
- Set Stellar network to
public(mainnet)
- Component logic testing with Vitest
- React Testing Library for component testing
- Aim for >80% code coverage on critical paths
- Context provider testing
- API service mocking with MSW
- Critical user flows with Playwright
- Authentication, music upload, event creation
- Visual regression with Storybook + Chromatic
- Isolated component development
Storybook is set up for isolated component development and visual documentation.
cd app
npm run storybook
# β http://localhost:6006npm run storybook:build
# Output: app/storybook-static/| Storybook path | Component |
|---|---|
Layout/TopHeader |
TopHeader.tsx β header bar with notification badge and role chip |
Layout/Sidebar |
Sidebar.tsx β collapsible navigation sidebar |
Layout/DashboardLayout |
Full dashboard layout shell |
Dashboard/OverviewCards |
KPI summary card grid |
Dashboard/EarningsRoyalties |
Earnings area chart + platform breakdown |
Dashboard/MyMusicContent |
Music library management surface |
Dashboard/MyAlbums |
Album grid |
Dashboard/MerchesContent |
Merchandise catalog manager |
Web3/ContractUpgradePanel |
Soroban contract upgrade admin panel (#295) |
Stories live alongside their components as ComponentName.stories.tsx inside app/src/components/.
The project uses GitHub Actions for continuous integration (.github/workflows/ci.yml).
| Job | Trigger | Description |
|---|---|---|
| Lint | Every push / PR | ESLint + Prettier format check |
| Type-check | Every push / PR | tsc --noEmit β zero TS errors required |
| Unit tests | Every push / PR | Vitest with verbose reporter |
| Build | After lint + typecheck + tests pass | Next.js production build |
| Storybook build | After lint + typecheck pass | Validates all story files compile correctly |
Concurrent runs for the same branch are automatically cancelled to conserve CI minutes.
The artist dashboard integrates with Stellar via the Freighter browser wallet.
- Install the Freighter browser extension (Chrome, Firefox, Brave).
- Create or import a Stellar account.
- Switch to Testnet for local development:
- Open Freighter β Settings β Network β Select Testnet.
# Fund an account on Stellar Testnet via Friendbot
curl "https://friendbot.stellar.org?addr=<YOUR_G_ADDRESS>"Admin users can upgrade Soroban smart contracts in-place using the ContractUpgradePanel:
import ContractUpgradePanel from "@/components/ContractUpgradePanel";
import { signTransactionXdr } from "@stellar/freighter-api";
<ContractUpgradePanel
contractId="CDLZFC..." // Target contract (C-address)
adminAddress={connectedAddress} // Must match on-chain admin
onSign={(xdr, { networkPassphrase }) =>
signTransactionXdr(xdr, { networkPassphrase })
}
/>See docs/SOROBAN_CONTRACT_UPGRADE_DESIGN.md for the full upgrade flow, Rust contract interface, and API endpoint details.
npm install --legacy-peer-depsThe project uses React 19, which some dev tooling packages have not yet published peer-dep ranges for. --legacy-peer-deps is the project standard for clean installs.
- Ensure the Freighter extension is installed and unlocked.
- Allow the extension on
localhost(Freighter may block non-HTTPS origins by default in some versions β check the extension's site permissions).
Make sure dependencies are installed first:
cd app && npm install --legacy-peer-depsThen retry npm run storybook:build.
Next.js only exposes NEXT_PUBLIC_* variables to the browser bundle. Variables without this prefix are server-only. Restart the dev server after changing .env.local.
Run npx tsc --noEmit from the app/ directory to see the full error list, then address them before committing. The CI typecheck job requires zero errors.
We welcome contributions! Please follow these steps:
- Fork the repository on GitHub.
- Sync your fork with the upstream:
git remote add upstream https://github.com/AudioBitsStellar/AudioBlocks_For_Artist.git git fetch upstream git merge upstream/main
- Create a feature branch:
git checkout -b feat/your-feature-name
- Make your changes following our code standards.
- Test thoroughly:
cd app npm run lint npx tsc --noEmit npm run test -- --run npm run build
- Commit with clear messages following Conventional Commits:
git commit -m "feat: add subscription tier selector to premium page" - Push to your fork (not to
upstream/main):git push origin feat/your-feature-name
- Open a Pull Request against
AudioBitsStellar/AudioBlocks_For_Artist:mainwith a detailed description.
See CONTRIBUTING.md for detailed guidelines.
- TypeScript strict mode enabled.
- ESLint and Prettier enforced via pre-commit hooks (Husky + lint-staged).
- All exported functions must have JSDoc comments.
- Components must meet WCAG 2.1 AA accessibility requirements.
- New features require unit tests and, where applicable, Storybook stories.
Press ? anywhere in the dashboard to list these in place. Section jumps are
two-key sequences: tap g, then the second key.
g oOverview βg mMy Music βg aAnalytics βg eEvents βg cMerchesg iMessages βg tTeam βg uUpload music βg pProfile βg gSettings?shows or hides the shortcut list, andEsccloses it along with any dialogβ/Ctrl Kopens the header search box; the shortcut registry advertises it butTopHeaderanswers it, so nothing here duplicates that listener
Shortcuts pause while a text field has focus, so typing a track title never
moves the page, and β/Ctrl/Alt combinations are always left to the browser. The
definitions live in app/src/utils/keyboardShortcuts.ts; the resolver there is
pure, so the sequence rules are covered by unit tests without a DOM.
This project is licensed under the ISC License.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Code of Conduct: CODE_OF_CONDUCT.md
Built with β€οΈ by the AudioBits team for artists worldwide.
Ready to revolutionize music distribution? Start building with AudioBlocks today!