Coder Social home page Coder Social logo

aritra-20 / music-room Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 3.82 MB

Create, maintain and play a playlist with friends in real-time.

Home Page: https://mrdev.herokuapp.com

License: BSD 3-Clause "New" or "Revised" License

Batchfile 0.04% JavaScript 86.16% CSS 13.80%

music-room's Introduction

MusicRoom

logo

Listen to music with friends, together! Colaborate and maintain a playlist with friends real time. Create a room and let friends join you. Built using: React, Django, NodeJs, Socket.io

Try it yourself

friendzone.live (hosted on heroku)

Features

  • Listen to music with friends together, live.
  • Group chat with your friends while enjoying music.
  • Private rooms - Only people you want can join.

Guide

The home page. This will list all the active rooms available to you

home

Let’s create a room

create room

This is how a room looks like

room

Rooms are private, others can join only if they have permission

room access

Group chat in the room

room chat

About the codebase πŸ“

The whole repo is divided into 3 parts

Django Server

  • Location: /server
  • This is the main django server serving files, APIs and implementing most of the features.

Live server

  • Location: /liveServer
  • This is the nodeJS server is used to push realtime updates to clients via websockets and also implements the group chat feature, it listens to updates from the main server via Redis pub/sub feature and relays the updates to appropriate rooms and clients. It uses MongoDB for storing chat messages and socket.io to connecting with clients.

React codebase

  • Location: /webapp
  • This is the React Frontend codebase that gets bundled and served by our main server.

How to start working on the server code βš’

This codebase is in Django

Create a virtualenv 🌎

virtualenv venv

Activate our python virtual environment ✈

venv\Scripts\activate

Install all required packages πŸ“¦

pip install -r requirements.txt

After making changes to static files

python manage.py collectstatic

After modifying database models, generate necessary migration code πŸ’Ύ

python manage.py makemigrations musicroom

Apply any database migration πŸ’Ώ

python manage.py migrate --run-syncdb

Run server in dev mode πŸƒβ€β™€οΈ

python manage.py runserver 0.0.0.0:8000

Run server in production mode 🏁

(This will only work on linux)

gunicorn -b 0.0.0.0:80 musicroom.wsgi

Env variables for django βš™

For local setup, you can also use settings_dev.py file

  • DJ_SECRET_KEY: Django secret key
  • BASE_URLBASE_URL: Root url of the server. eg: https://example.com
  • DATABASE_URL: eg: postgres://user:password@localhost/dbname
  • DOMAIN_NAME: eg: example.com
  • LIVE_ACCESS_KEY: A random string that needs to be same both servers. eg: xx-access-key-xx
  • LIVE_URL: The socket.io url of the live server. eg: https://live.friendzone.live/updates
  • REDIS_URL: eg: redis://user1:[email protected]:31949
  • SNAPKIT_CLIENT_ID: Optional

How to start working on the Live server code βš’

This codebase is in NodeJs

Install all required packages πŸ“¦

npm i

Env variables for NodeJs

For local setup, you can also use .env file

  • MAIN_SERVER_URL: eg: https://example.com if running on same machine as main server, you can use the local address ie localhost:port
  • ACCESS_KEY: Same access key set in the main server.
  • REDIS_URL: Should be same as main server
  • MONGO_URL: eg: mongodb://localhost:27017/mr
  • MAIN_SERVER_PUBLIC_URL: eg: https://example.com

Run server

node index.js

music-room's People

Contributors

aritra-20 avatar

Watchers

 avatar

Forkers

tirthadagr8

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.