Giter Club home page Giter Club logo

moment-track's Introduction

Moment Track

Moment Track wants to let users search text into audio and video files to know when such text has been pronounced.

Requirements

  • Python 2.7
  • Django 1.11
  • MySQL-compliant DBMS (MySQL, MariaDB, …)
  • RabbitMQ 3.6.10

Getting Started

Extract the moment-track.tar.gz archive and move to the project folder:

$ tar -zxvf moment-track.tar.gz
$ cd moment-track

Build the documentation

Move to documentation folder and prepare the environment to run Sphinx:

$ cd docs
$ virtualenv2 venv
$ source venv/bin/activate
$ (venv) pip2 install -r requirements.txt

Build the documentation as PDF and/or HTML:

$ (venv) make      # with no parameters will show you all the available options
$ (venv) make html # documentation files will be located at "dist/html/"
$ (venv) make pdf  # documentation file will be located at "dist/manual.pdf"

Setting up Google Cloud Platform environment

If you want to deploy Moment Track on your server, please skip this section. It will not break your deployment, but it is just useless.

If you haven't already created a project in the Google Cloud Platform Console, create one now giving it the name you prefer.

Enable billing for your project and sign up for a free trial if you haven't already a billing account.

Install the Google Cloud SDK following this guide

Enable the required APIs:

Download and install the Cloud SQL Proxy to connect to your Cloud SQL instance when running locally. You can follow the more appropriate guide based on your operating system choosing from this table.

Create a Cloud SQL for MySQL Second Generation instance. Name the instance moment_track and wait until ready.

Now use the Cloud SDK from command line to run the following command. Copy the connectionName value for the next step.

gcloud beta sql instances describe moment_track

Start the Cloud SQL Proxy using the connectionName from the previous step.

If you are using Linux or Unix-like operating system use:

./cloud_sql_proxy -instances="[YOUR_INSTANCE_CONNECTION_NAME]"=tcp:3306

If you are using Windows operating system use:

cloud_sql_proxy.exe -instances="[YOUR_INSTANCE_CONNECTION_NAME]"=tcp:3306

From now you can follow the next section instructions to set up local environment and dependencies.

Setting up your local environment

If you intend to use this app in a local production environment, please look for the Django deploy how-to guide for your web server of use. For project specific dependencies you can use the Requirements section above and your preferred package manager.

Move to source folder:

$ cd src/

Create an isolated Python environment and install dependencies:

$ virtualenv2 venv
$ source venv/bin/activate
$ (venv) pip2 install -r requirements-vendor.txt -t lib/
$ (venv) pip2 install -r requirements.txt

Access MySQL console with a privileged user to create project user and database:

$ mysql --host 127.0.0.1 --user root --password
mysql > CREATE DATABASE moment_track;
mysql > CREATE USER 'moment_track' IDENTIFIED BY 'moment_track';
mysql > GRANT ALL ON moment_track.* TO 'moment_track';
mysql > FLUSH PRIVILEGES;

Run the Django migrations to set up ORM models:

$ cd moment_track/
$ (venv) python2 manage.py makemigrations
$ (venv) python2 manage.py makemigrations dashboard
$ (venv) python2 manage.py migrate
$ (venv) python2 manage.py shell -c "execfile('preparedb.py')"

Copy static files to static root directory to let Django serves them even if not in debug mode:

$ (venv) python2 manage.py collectstatic

Run Django on local webserver

Start a local webserver and Celery worker from Django project folder:

$ celery multi start w1 -A moment_track -l error --pidfile=/var/run/celery/%n.pid --logfile=/var/log/celery/%n%I.log
$ (venv) python2 manage.py runsslserver 127.0.0.1 9000

You can view running instance of Moment Track with your preferred browser at https://127.0.0.1:9000 address.

Deploy on Google App Engine

Upload the app by running the following command from within the django project directory (<path-to-moment-track-root-folder>/src/moment_track) where the app.yaml file is located:

gcloud app deploy

Wait for the message that notifies you that the update has completed, then open your preferred browser at the address https://<your_project_id>.appspot.com

The project id could be retrieved in the Google Cloud Console Dashboard looking for Project information card.


Copyright © 2017 Moment Track - Released under Proprietary Software License.

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.