A comprehensive music streaming platform backend with NFT integration and community features.
- User Authentication - JWT-based auth with OAuth support
- Music Streaming - Track upload, playback, and management
- Artist Platform - Artist profiles and verification system
- Community System - Artist communities with NFT-gated access
- Social Features - Following, likes, comments, and feed
- NFT Integration - Starknet blockchain integration for community access
- Advanced analytics and recommendations
- Referral and gift systems
- Editorial playlists
- Advanced search functionality
- Real-time notifications
- Backend: Express.js with TypeScript
- Database: PostgreSQL with Prisma ORM
- Authentication: JWT + OAuth (Google, Apple)
- File Storage: Cloudinary
- Blockchain: Starknet for NFT functionality
- Real-time: Socket.io
- Testing: Mocha + Chai
- Logging: Winston
- Containerization: Docker & Docker Compose
LOOOP_SERVER/
βββ src/
β βββ config/ # Database and app configuration
β βββ controllers/ # Request handlers
β β βββ auth/ # Authentication controllers
β β βββ music/ # Music-related controllers
β β βββ user/ # User management controllers
β β βββ artist/ # Artist platform controllers
β β βββ community/ # Community controllers
β β βββ nft/ # NFT controllers
β β βββ analytics/ # Analytics controllers
β β βββ social/ # Social features controllers
β βββ middleware/ # Express middleware
β βββ models/ # Data models and types
β βββ routes/ # API route definitions
β βββ services/ # Business logic services
β βββ utils/ # Utility functions
β βββ types/ # TypeScript type definitions
β βββ index.ts # Application entry point
βββ prisma/ # Database schema and migrations
βββ tests/ # Test files
βββ docs/ # Documentation
βββ uploads/ # File upload directory
βββ logs/ # Application logs
βββ docker-compose.yml # Development environment
- Node.js >= 18.0.0
- PostgreSQL database
- npm or yarn package manager
-
Clone the repository
git clone <repository-url> cd LOOOP_SERVER
-
Install dependencies
npm install
-
Environment Setup
cp .env.example .env # Edit .env with your configuration -
Database Setup
# Generate Prisma client npm run db:generate # Run database migrations npm run db:migrate # (Optional) Open Prisma Studio npm run db:studio
-
Start Development Server
npm run dev
The server will start on http://localhost:5000
- Start with Docker Compose
docker-compose up -d
This will start:
- PostgreSQL database on port 5432
- Application server on port 5000
- WebSocket server on port 5001
npm run dev- Start development server with hot reloadnpm run build- Build production bundlenpm start- Start production servernpm test- Run test suitenpm run test:coverage- Run tests with coveragenpm run lint- Lint codenpm run lint:fix- Fix linting issuesnpm run format- Format code with Prettiernpm run db:generate- Generate Prisma clientnpm run db:push- Push schema to databasenpm run db:migrate- Run database migrationsnpm run db:studio- Open Prisma Studio
- Project scaffolding and basic setup
- User authentication system
- Basic music upload and streaming
- Artist profile management
- Database schema implementation
- Community creation and management
- NFT integration for community access
- Social features (follow, like, comment)
- Real-time features with WebSocket
- Analytics dashboard
- Recommendation engine
- Advanced search functionality
- Notification system
- Admin dashboard
- Performance optimization
- Caching layer (Redis)
- CDN integration
- Advanced monitoring
Key environment variables to configure:
# Server
NODE_ENV=development
PORT=5000
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/looop_db"
# JWT
JWT_SECRET=your-secret-key
JWT_EXPIRES_IN=7d
# OAuth
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# File Upload
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret
# Blockchain
STARKNET_PROVIDER_URL=your-starknet-provider
STARKNET_PRIVATE_KEY=your-private-keyRun the test suite:
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run specific test file
npm test -- --grep "Auth"API documentation will be available at /docs once implemented.
GET /health- Health checkGET /api/v1/auth/health- Auth module healthGET /api/v1/users/health- User module healthGET /api/v1/music/health- Music module healthGET /api/v1/artists/health- Artist module healthGET /api/v1/communities/health- Community module healthGET /api/v1/nfts/health- NFT module healthGET /api/v1/social/health- Social module health
npm run build
npm startdocker build -t looop-server .
docker run -p 5000:5000 looop-server- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License.
For support, email support@looop.music or create an issue in the repository.
Built with β€οΈ by the LOOOP Team