Musicroom Documentation

Brief guide on how to start working on the project.

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


Install all required packages πŸ“¦

pip install -r requirements.txt

After making changes to static files

python collectstatic

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

python makemigrations musicroom

Apply any database migration πŸ’Ώ

python migrate --run-syncdb

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

python runserver

Run server in production mode 🏁

(This will only work on linux)

gunicorn -b musicroom.wsgi

Env variables for django βš™

For local setup, you can also use file

  • DJ_SECRET_KEY: Django secret key
  • BASE_URL: Root url of the server. eg:
  • DATABASE_URL: eg: postgres://user:password@localhost/dbname
  • DOMAIN_NAME: eg:
  • LIVE_ACCESS_KEY: A random string that needs to be same both servers. eg: xx-access-key-xx
  • LIVE_URL: The url of the live server. eg:
  • REDIS_URL: eg: redis://

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

Run server

node index.js