Skip to content

Carrene/jaguar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7df7da2 · Aug 1, 2019
Aug 1, 2019
Jul 30, 2019
Jan 2, 2019
Jun 24, 2019
Aug 15, 2018
Nov 5, 2018
May 8, 2019
Jan 29, 2019
Jan 24, 2019
Jan 29, 2019
Jan 16, 2019
Jun 24, 2019
Jul 20, 2019
Jan 17, 2019
Oct 16, 2018
Oct 16, 2018
Jul 22, 2019
Sep 11, 2018

Repository files navigation

Jaguar

A chat application

Jaguar

Branches

master

Build Status Coverage Status

Setting up development Environment on Linux

Install Project (edit mode)

Working copy

cd /path/to/workspace
git clone [email protected]:Carrene/jaguar.git
cd jaguar
pip install -e .

Setup Database

Configuration

db:
  url: postgresql://postgres:postgres@localhost/jaguar_dev
  test_url: postgresql://postgres:postgres@localhost/jaguar_test
  administrative_url: postgresql://postgres:postgres@localhost/postgres

oauth:
  secret: A1dFVpz4w/qyym+HeXKWYmm6Ocj4X5ZNv1JQ7kgHBEk=\n
  application_id: 1
  url: http://localhost:8080

storage:
  local_directory: %(root_path)s/data/assets
  base_url: http://localhost:8080/assets
  

Remove old abd create a new database TAKE CARE ABOUT USING THAT

jaguar db create --drop --mockup

And or

jaguar db create --drop --basedata 

Drop old database: TAKE CARE ABOUT USING THAT

jaguar [-c path/to/config.yml] db --drop

Create database

jaguar [-c path/to/config.yml] db --create

Or, you can add --drop to drop the previously created database: TAKE CARE ABOUT USING THAT

jaguar [-c path/to/config.yml] db create --drop

Testing the websocket server

To start the websocket server run the following command:

jaguar websocket start

To route the messages from the worker queue to right WebSocket connection, use the following command:

jaguar router start

As a client you can recieve the message enqueued by the wscat cli app. Like:

wscat -c ws://localhost:8085?token=$(jaguar token create 2 `panda access-token create -s email -- 2 1`)

when given access token, panda must be running.

cd path/to/panda
./gunicorn

Run jaguar REST API server

cd path/to/jaguar
./gunicorn

To enqueue the message, run the following command:

curl -XSEND localhost:8084/apiv1/targets/1/messages \
    -H"Authorization: $(jaguar token create 2 `panda access-token create -s email title avatar -- 2 1`)" \
    -F"body=abc" \
    -F"mimetype=text/plain"

NOTE: If you want to get by another user, notice you enter sudo -u <username> before the commands. like:

jaguar token create 2 `panda access-token create -s email -- 2 1`