Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

HE-Arc/TalkAway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TalkAway

Getting Started

API

To create your virtual env

cd api
python3 -m pip install virtualenv
virtualenv .ENV
source ./.ENV/bin/activate

To save the requirements from virtualenv:

pip3 freeze -l > requirements.txt  

And to install the defined requirements:

pip install -r requirements.txt

Warning, if you want to upgrade all the dependencies:

pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip3 install -U --user

The flag --user might not be necessary depending on your local configuration.

To migrate the first time your database:

python3 manage.py migrate auth
python3 manage.py migrate api

To seed the database:

python manage.py loaddata api/fixtures/seed.json

Install redis server:

sudo apt install redis

Run redis server (maybe it's already running):

redis-server

Tips

For migrations, once edited models.py

python3 manage.py makemigrations api
python3 manage.py migrate api

For administration, don't forget to create a super user:

python3 manage.py createsuperuser

Run api server

python3 ./api/djangochat/manage.py runserver 8080

Admin account name: admin , password : admin Test users passwords: qwertzui

App

Install

Sources pour l'installation: https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04

Prérequis

cd ~
curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh

sudo apt install nodejs

Vérification

nodejs -v

Output

v10.14.0

Et npm, qui est DEJA CONTENU DANS NodeJS, pas besoin d'installer un package supplémentaire.

npm -v

Output

6.4.1

ATTENTION, version requise pour nodejs > 10.0 ATTENTION, version requise pour npm > 6.0

Run APP

Launche the following commande line from th the folder app\djangochat

npm start

Extensions

Je vous recommande d'utiliser l'extension:

GraphQL

Example of request available:

mutation {
  tokenAuth(username: "username", password: "xxx") {
    token
  }
}

Web sockets

  • nginx as the proxy
  • daphne as the interface server
  • redis as the backend

Sources