Skip to content

Looop-content-Dapp/LOOOP__SERVER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LOOOP Server 🎡

A comprehensive music streaming platform backend with NFT integration and community features.

πŸš€ Features

Core Features (MVP)

  • 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

Future Features

  • Advanced analytics and recommendations
  • Referral and gift systems
  • Editorial playlists
  • Advanced search functionality
  • Real-time notifications

πŸ›  Tech Stack

  • 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

πŸ“ Project Structure

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

🚦 Getting Started

Prerequisites

  • Node.js >= 18.0.0
  • PostgreSQL database
  • npm or yarn package manager

Installation

  1. Clone the repository

    git clone <repository-url>
    cd LOOOP_SERVER
  2. Install dependencies

    npm install
  3. Environment Setup

    cp .env.example .env
    # Edit .env with your configuration
  4. Database Setup

    # Generate Prisma client
    npm run db:generate
    
    # Run database migrations
    npm run db:migrate
    
    # (Optional) Open Prisma Studio
    npm run db:studio
  5. Start Development Server

    npm run dev

The server will start on http://localhost:5000

Using Docker (Recommended for Development)

  1. 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

πŸ“‹ Available Scripts

  • npm run dev - Start development server with hot reload
  • npm run build - Build production bundle
  • npm start - Start production server
  • npm test - Run test suite
  • npm run test:coverage - Run tests with coverage
  • npm run lint - Lint code
  • npm run lint:fix - Fix linting issues
  • npm run format - Format code with Prettier
  • npm run db:generate - Generate Prisma client
  • npm run db:push - Push schema to database
  • npm run db:migrate - Run database migrations
  • npm run db:studio - Open Prisma Studio

πŸ— Development Roadmap

Phase 1: Core Foundation (Current MVP)

  • Project scaffolding and basic setup
  • User authentication system
  • Basic music upload and streaming
  • Artist profile management
  • Database schema implementation

Phase 2: Community Features

  • Community creation and management
  • NFT integration for community access
  • Social features (follow, like, comment)
  • Real-time features with WebSocket

Phase 3: Advanced Features

  • Analytics dashboard
  • Recommendation engine
  • Advanced search functionality
  • Notification system
  • Admin dashboard

Phase 4: Optimization & Scaling

  • Performance optimization
  • Caching layer (Redis)
  • CDN integration
  • Advanced monitoring

πŸ”§ Environment Variables

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-key

πŸ§ͺ Testing

Run 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

API documentation will be available at /docs once implemented.

Available Endpoints

  • GET /health - Health check
  • GET /api/v1/auth/health - Auth module health
  • GET /api/v1/users/health - User module health
  • GET /api/v1/music/health - Music module health
  • GET /api/v1/artists/health - Artist module health
  • GET /api/v1/communities/health - Community module health
  • GET /api/v1/nfts/health - NFT module health
  • GET /api/v1/social/health - Social module health

πŸš€ Deployment

Production Build

npm run build
npm start

Docker Production

docker build -t looop-server .
docker run -p 5000:5000 looop-server

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License.

πŸ†˜ Support

For support, email support@looop.music or create an issue in the repository.


Built with ❀️ by the LOOOP Team

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors