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
- 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
- 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/
β β β β βββ 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
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
feat/your-featureorfix/your-bugfix - Make your changes following our code standards
- Test thoroughly:
npm run lint npm run format npm run test npm run test:e2e - Commit with clear messages following Conventional Commits
- Push to your fork
- Open a Pull Request with a detailed description
See CONTRIBUTING.md for detailed guidelines.
- TypeScript strict mode enabled
- ESLint and Prettier enforced via pre-commit hooks
- All public functions must have JSDoc comments
- Components should be accessible (WCAG 2.1 AA)
- Tests required for new features
The project uses GitHub Actions for continuous integration:
- On PR & Push to
main:- Lint checking
- TypeScript compilation
- Unit tests
- Build verification
Workflow file: .github/workflows/ci.yml
This project prioritizes accessibility:
- WCAG 2.1 AA compliance target
- Screen reader tested
- Keyboard navigation support
- Color contrast verified
- Toast notifications announced via ARIA live regions
Note: Full WCAG compliance requires manual testing with assistive technologies.
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!