Skip to content

Yuguda999/Audiora

Repository files navigation

Audiora - Music and Video Streaming Platform

Audiora is a Django-based API for a music and video streaming platform that connects content creators with users. The platform allows creators to run campaigns for their content and rewards users for streaming.

Features

User Management

  • User registration and authentication with JWT
  • Email verification
  • User profiles with creator/regular user roles
  • Password reset functionality

Wallet System

  • Digital wallet for both creators and users
  • Secure transactions with PIN verification
  • Top-up functionality via Paystack integration
  • Withdrawal to bank accounts
  • Transaction history

Campaign Management

  • Creators can create music or video campaigns
  • Campaign funding from creator's wallet
  • Campaign analytics (streams, balance)
  • Automatic campaign deactivation when balance is depleted

Streaming Rewards

  • Users earn rewards for streaming content
  • Progress tracking for streams
  • Reward distribution based on view percentage
  • Session-based playback tracking

Tech Stack

  • Backend: Django, Django REST Framework
  • Database: PostgreSQL (configured via DATABASE_URL)
  • Authentication: JWT (JSON Web Tokens)
  • Payment Integration: Paystack
  • Deployment: Google Cloud Platform (App Engine)
  • Documentation: Swagger/ReDoc

Project Structure

audiora/
├── audiora/            # Main Django project folder
├── users/              # User management app
├── wallet/             # Wallet and transaction management
├── campaign/           # Campaign and streaming functionality
├── templates/          # Email templates
├── media/              # User uploaded files
├── requirements.txt    # Project dependencies
├── Dockerfile          # Docker configuration
├── docker-compose.yml  # Docker Compose configuration
└── app.yaml            # Google App Engine configuration

API Endpoints

User Management

  • POST /api/user/register/ - Register a new user
  • POST /api/user/login/ - User login
  • GET /api/user/profile/ - Get user profile
  • PUT /api/user/profile/ - Update user profile
  • POST /api/user/change-password/ - Change password

Wallet

  • GET /api/wallet/ - Get wallet information
  • POST /api/wallet/top-up/ - Top up wallet
  • POST /api/wallet/withdraw/ - Withdraw funds
  • GET /api/wallet/balance/ - Get wallet balance
  • POST /api/wallet/set-pin/ - Set wallet PIN
  • GET /api/wallet/transactions/ - Get transaction history
  • GET /api/wallet/bank-accounts/ - Get bank accounts
  • POST /api/wallet/bank-accounts/ - Add bank account

Campaign

  • POST /api/campaign/create/ - Create a campaign
  • GET /api/campaign/ - List active campaigns
  • GET /api/campaign/creator/ - List creator's campaigns
  • POST /api/campaign/<id>/fund/ - Fund a campaign
  • POST /api/campaign/<id>/start-playback/ - Start streaming a campaign
  • POST /api/campaign/<id>/update-progress/ - Update stream progress

Setup and Installation

Prerequisites

  • Python 3.9+
  • PostgreSQL
  • Docker (optional)

Environment Variables

Create a .env file with the following variables:

DEBUG=1
DATABASE_URL=postgres://user:password@localhost:5432/audiora
PAYSTACK_SECRET_KEY=your_paystack_secret_key
PAYSTACK_PUBLIC_KEY=your_paystack_public_key
PAYSTACK_CALLBACK_URL=https://yourdomain.com/api/wallet/callback/
FRONTEND_URL=https://yourdomain.com
EMAIL_HOST=smtp.example.com
EMAIL_PORT=587
EMAIL_HOST_USER=your_email@example.com
EMAIL_HOST_PASSWORD=your_email_password

Local Development

  1. Clone the repository
git clone https://github.com/yourusername/audiora.git
cd audiora
  1. Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies
pip install -r requirements.txt
  1. Run migrations
python manage.py migrate
  1. Start the development server
python manage.py runserver

Using Docker

docker-compose up

Deployment

The project is configured for deployment to Google App Engine:

# Authenticate with Google Cloud
gcloud auth login

# Deploy to App Engine
gcloud app deploy --project audiora-446612

API Documentation

API documentation is available at:

  • Swagger UI: /swagger/
  • ReDoc: /redoc/

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors