Skip to content

Pilestin/Harmoni

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Harmoni

It is a social music application where you can listen to music, create lists, see your friends and what they are listening to.

Achievement

Installation and Run

How to play music (local)

Goals

Koleksiyonlar (Collections)

Achievement :

  • Sign up and login
  • Ability to listen to music
  • Music search
  • Ability to see music categories
  • Ability to create favourite music lists
  • Ability to follow users
  • See what your friends are listening now
  • Ability to listen to what your friends are listening to

Installations and Run :

> git clone https://github.com/Pilestin/Harmoni
> cd Harmoni
> npm install
> meteor

How to play music (local) :

The music uploaded in the project is copied in the public/musics folder (like public/images in images). The feature of this folder is that it can be accessed from the url.

Using this, the music is taken from the url (saved with the id) and turned into a playable content.

e.x : http://localhost:3000/musics/C4tb7b62sYRndiApJ.mp3

on server :

  WebApp.connectHandlers.use('/musics', (req, res) => {
  const musicFile = Assets.absoluteFilePath('musics/' + req.url.slice(1));
  res.setHeader('Content-Type', 'audio/mpeg');
  res.setHeader('Content-Disposition', 'attachment');
  res.writeHead(200);
  const readStream = fs.createReadStream(musicFile);
  readStream.pipe(res);
});

on client :

const playMusic = function (music) {
  const musicFile = MusicFiles.findOne({ _id: music.fileId });

  const musicUrl = 'http://localhost:3000/musics/' + musicFile._id + musicFile.extensionWithDot; // Sunucudan alacağınız müzik dosyasının URL'si

  const audioContext = new (window.AudioContext || window.webkitAudioContext)();

  fetch(musicUrl)
      .then(response => response.arrayBuffer())
      .then(buffer => audioContext.decodeAudioData(buffer))
      .then(decodedData => {
          const audioElement = document.getElementById('audioPlayer');
          audioElement.src = musicUrl; // Audio etiketine URL'yi atıyoruz
          audioElement.play(); // Müziği çalıyoruz
      })
      .catch(error => console.error('Error loading audio: ', error));


  Meteor.call('user_currentPlay', music, function (err, res) {
      if (err) {
          console.log("err : ", err)
      }
      console.log("res : ", res)
  });
}

Goals:

  • Sign up and login
  • Ability to listen to music
  • Music search
  • Ability to see music categories
  • Ability to create music lists
  • Ability to add friends
  • See what your friends are listening now
  • Ability to listen live to what your friends are listening to

Koleksiyonlar (Collections) : :

Untitled

  1. Kullanıcılar (Users) :
  • Kullanıcıların kimlik bilgilerini, e-posta, şifre gibi giriş bilgilerini içerir.
  • Ayrıca kullanıcıya özel bilgiler, arkadaş listesi gibi ek özellikleri de içerebilir.
  • Kullanıcıların müzik listelerine ve arkadaşlarına erişimini sağlamak için (ID) oluşturulabilir.

temp code :

  1. Müzik Listeleri (Playlists)

    • Kullanıcıların oluşturduğu müzik listelerini temsil eder.
    • Her müzik listesi, bir başlık, açıklama ve müziklerin bir listesini içerebilir.
    • Ayrıca müzik listesine sahip olan kullanıcının kimliği ile ilişkilendirilebilir.
  2. Müzik Kategorileri (Music Categories)

    • Müzik listelerini belirli kategorilere ayırmak için kullanılabilir.
    • Her müzik kategorisi, bir ad ve açıklama içerebilir.
  3. Canlı Dinleme (Live Listening)

    • Kullanıcıların arkadaşlarının canlı olarak ne dinlediklerini takip etmek için kullanılabilir.
    • Canlı dinleme durumu, kullanıcının kimliği ve dinlenen müziğin kimliği ile ilişkilendirilebilir.
{
  "User" : {
    "_id" : "_??",
    "firstName": "Yasin",
    "lastName": "Ünal",
    "email" : "yasin@test.com",
    "password" : "123",
    "favoriteList" : [
      "_mId"
    ],
    "currentPlay" : "musicId",
    "friendList" : ["_uId"],
    "createdAt" : "DATE"
  },

  "Music" : {
    "_id" : "_??", 
    "name" : "",
    "artist": "",
    "link" : "",
    "duration" : "",
    "cId" : ""
  },

  "Categories" : {
    "_id" : "_??",
    "name" : "",
    "description": ""
  }

}

About

It is a social music application where you can listen to music, create lists, and see your friends and what they are listening to.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published