Codebase overview

From MMS Wiki
Jump to: navigation, search

Main overview

  • All UI/Frontend code is in /client/app/
 - views/ - contains html templates
 - scripts/ - contains the JS code
 - skins/ - contains CSS and images for skins
  • All server code is in /server/
 - models/ - Database model
 - views/ - api request targets
  • Audio (HaXe) code is in /scripts/haxe/core

Everything else is support code:

  • client/build/ - Grunt build scripts for frontend/ui code
  • ansible/ - Ansible deployment scripts for getting the system to run on the cloud and updating it there
  • db/ - Alembic database migration scripts (usually autogenerated, see below)
  • OneOffs/ - python scripts, usually for database refactoring/recalculation, that were meant for single situational use - kept around as examples.
  • scripts/cli/ - local runscripts for manage.py
  • cordova/ and mobile/ - Cordova things for making our system run on iOS and Android

Useful commands to know

  • Running the environment:

./manage.py start - starts everything except ui (db, redis, celery, api)

./manage.py start dclient - starts the ui without haxe - use 'client' if you want haxe to be compiled too

  • Accessing the local database directly:
 psql -h localhost -U matchmysound matchdb
  • Creating a new DB revision
 alembic revision --autogenerate -m "My comment"

creates a file with my_comment in the name in db/versions/. To apply the revision, run:

 alembic upgrade head
  • Updating all dependencies
 pip install -r requirements.txt
 cd client
 npm install
 bower install