Skip to content

A REST API that matches users with similar tastes based on the APIs.

Notifications You must be signed in to change notification settings

musicbud/backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MusicBud API - FastAPI Version

A high-performance REST API built with FastAPI for the MusicBud platform.

🚀 Quick Start

Installation

# Install dependencies
pip install -r requirements.txt

# Run the server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8001

Access the API

📋 Features

🎯 COMPLETE CORE FUNCTIONALITY - Production Ready!

50+ API Endpoints - Full MusicBud platform functionality
Public Discovery System - 15+ guest endpoints (no auth required)
User Management - Complete profile & settings system
Matching Engine - Full swiping & discovery functionality
Chat System - Comprehensive messaging & content sharing
Auto-generated Documentation - Swagger UI & ReDoc
Type Safety - Pydantic models for validation
High Performance - Async/await support
CORS Enabled - Cross-origin requests supported
Comprehensive Testing - All endpoints tested & passing

📝 API Endpoints

🌟 Complete API Coverage (50+ Endpoints)

Public Discovery (No Authentication)

  • GET /v1/discover/public/ - Get discover content
  • GET /v1/discover/public/trending/ - Get trending content
  • GET /v1/discover/public/genres/ - Get available genres
  • GET /v1/recommendations/public/ - Get public recommendations
  • GET /v1/content/public/{type}/{id}/ - Get content details

User Management

  • GET /v1/users/profile - Get current user profile
  • PUT /v1/users/profile - Update user profile
  • GET/PUT /v1/users/preferences - User preferences
  • GET/PUT /v1/users/settings/* - Privacy, notifications, app settings
  • GET /v1/users/stats - User statistics

Matching & Discovery

  • GET /v1/matching/discover - Get potential matches
  • POST /v1/matching/swipe - Swipe on users (like/pass/super_like)
  • GET /v1/matching/matches - Get user matches
  • GET /v1/matching/connections - Get connections/friends
  • GET /v1/matching/compatibility/{user_id} - Compatibility details
  • GET /v1/matching/stats - Matching statistics

Chat & Messaging

  • GET /v1/chat/conversations - Get conversations
  • POST /v1/chat/conversations - Create conversations
  • GET /v1/chat/conversations/{id}/messages - Get messages
  • POST /v1/chat/messages - Send messages
  • POST /v1/chat/share/{type} - Share content (tracks/playlists/movies/anime)
  • GET /v1/chat/stats - Chat statistics

🧪 Testing

# Run all comprehensive tests
pytest tests/ -v

# Run specific test categories
pytest tests/test_api_endpoints.py::TestPublicEndpoints -v
pytest tests/test_api_endpoints.py::TestUserEndpoints -v
pytest tests/test_api_endpoints.py::TestMatchingEndpoints -v
pytest tests/test_api_endpoints.py::TestChatEndpoints -v

# Test single endpoint
curl http://localhost:8001/v1/discover/public/genres/

📦 Project Structure

fastapi_backend/
├── app/
│   ├── main.py                     # FastAPI application
│   ├── api/
│   │   └── routers/
│   │       ├── public.py          # Public discovery endpoints
│   │       ├── recommendations.py # Recommendation system
│   │       ├── auth.py            # Authentication endpoints  
│   │       ├── users.py           # User management
│   │       ├── matching.py        # Matching & swiping system
│   │       └── chat.py            # Chat & messaging system
│   ├── core/
│   │   ├── config.py              # Settings & configuration
│   │   ├── auth.py                # Authentication utilities
│   │   └── database.py            # Database connections
│   └── schemas/
│       └── auth.py                # Authentication schemas
├── tests/
│   ├── test_api_endpoints.py      # Comprehensive API tests
│   ├── test_public_endpoints.py   # Public endpoint tests
│   └── test_matching_endpoints.py # Matching system tests
├── requirements.txt
├── WORK_HISTORY.md               # Development progress tracking
├── README.md
└── FASTAPI_MIGRATION.md

🔧 Configuration

Create a .env file:

PROJECT_NAME=MusicBud API
VERSION=2.0.0-fastapi
HOST=0.0.0.0
PORT=8001
SECRET_KEY=your-secret-key-here

📖 Documentation

  • Development History: See WORK_HISTORY.md for complete progress tracking
  • Migration Guide: See FASTAPI_MIGRATION.md
  • API Docs: Visit /docs when server is running
  • ReDoc: Visit /redoc for alternative documentation

🎯 Why FastAPI?

  • Fast: High performance, comparable to NodeJS and Go
  • 📚 Automatic Docs: Interactive API documentation
  • 🔒 Type Safe: Pydantic validation catches errors early
  • 🚀 Modern: Uses Python 3.6+ type hints
  • 🔄 Async: Native async/await support

📊 Performance & Status

Current Development Status

  • 🎯 Phase 4 Complete: All core functionality implemented
  • 50+ API Endpoints: Full platform coverage
  • 🧪 All Tests Passing: Comprehensive test coverage
  • 🚀 Production Ready: Core features ready for deployment

FastAPI Performance Benefits

  • ⚡ High-performance async implementation
  • 🔄 Native async/await support
  • 📦 Efficient JSON serialization
  • 🛡️ Built-in data validation

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests
  5. Submit a pull request

📄 License

MIT License

🔗 Links


Version: 2.0.0-fastapi
Development Phase: Phase 4 Complete ✅
Status: 🟢 PRODUCTION READY - Full Core Functionality
Last Updated: October 13, 2025

Releases

No releases published

Packages

No packages published