Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
vbouquet committed Jan 23, 2018
2 parents dff7445 + d01b427 commit ee6edf4
Show file tree
Hide file tree
Showing 53 changed files with 35,013 additions and 831 deletions.
11 changes: 7 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"presets":[
"env", "react"
]
{
"presets":[
"env", "react"
],
"plugins": [
"transform-object-rest-spread"
]
}
267 changes: 134 additions & 133 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,133 +1,134 @@
# Projet M2 MIAGE
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Build Status](https://travis-ci.org/vbouquet/realtime-keynote-feedback.svg?branch=master)](https://travis-ci.org/vbouquet/realtime-keynote-feedback)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9aff66ec6dc841a5971b1647be3b9657)](https://www.codacy.com/app/Remypoc/realtime-keynote-feedback?utm_source=github.com&utm_medium=referral&utm_content=vbouquet/realtime-keynote-feedback&utm_campaign=Badge_Grade)

## Auteurs
Valentin Bouquet - <[email protected]>

Rémy Pocquerusse - <[email protected]>

Oussemo Oulhaci - <[email protected]>

## Technologies

* Npm: Javascript package manager.
* Webpack: Javascript module bundler.
* Babel: Transpiling code for new languages features.
* React: MVC Framework for dynamic statefull web pages.
* Express: Basic server in javascript (for front-end testing).
* Django-rest: Framework for building web API.
* OpenCV: Computer vision and machine learning library.

## Prérequis
* Git, gestionnaire de version - [Télécharger git](https://git-scm.com/downloads)
* Virtualbox, outil de virtualisation - [Télécharger Virtualbox](https://www.virtualbox.org/wiki/Downloads)
* Vagrant, gestionnaire de machine virtuelle - [Télécharger vagrant](https://www.vagrantup.com/downloads.html)

## Installation

Lancer un terminal en mode administrateur sous windows (pour éviter les problèmes de symlink)
```
cd ~/{$project}
vagrant up
vagrant ssh
cd $PROJECT_DIR
sudo mount --bind $HOME_DIR/vagrant_node_modules $PROJECT_DIR/node_modules
# Lancez le serveur sur localhost:8080
node src/server/express/main.js &
# Lancez le serveur REST
python3.5 $DJANGO_DIR/manage.py runserver 0.0.0.0:8000 &
```

## Developpement

* ![DJANGO REST](https://github.com/vbouquet/realtime-keynote-feedback/tree/master/src/server/django_rest)

## CLI

### Vagrant
```
# Démarrrer la VM
vagrant up
# Eteindre la VM
vagrant halt
# Supprimer la VM
vagrant destroy
# Se connecter en ssh à la VM
vagrant ssh
```

### Front-end
```
# Lancer webpack avec la configuration pour produire le bundle.js (regroupement des dépendances javascript)
# Option 1
./node_modules/.bin/webpack -d --config webpack-config.js
# Option 2
npm run build
# Option 3, depuis n'importe quel dossier
npm run --prefix /vagrant build
# Lancer webpack pour automatiser la génération à chaque modification
# Attention: problème de synchronisation en dehors de la machine virtuelle
# Option 1
./node_modules/.bin/webpack -d --config webpack-config.js --watch
# Option 2
npm run watch
```

### Server REST
```
# Lancer le serveur Django depuis l'host
vagrant ssh -c "/usr/bin/python3.5 -u $DJANGO_DIR/manage.py runserver 0.0.0.0:8000"
# Lancer le serveur Django depuis la machine virtuelle
vagrant ssh
python3.5 $DJANGO_DIR/manage.py runserver 0.0.0.0:8000
# Lancer les migrations depuis l'host
vagrant ssh -c "/usr/bin/python3.5 -u $DJANGO_DIR/manage.py makemigrations"
vagrant ssh -c "/usr/bin/python3.5 -u $DJANGO_DIR/manage.py migrate"
# Lancer les migrations depuis la machine virtuelle
vagrant ssh
python3.5 $DJANGO_DIR/manage.py makemigrations
python3.5 $DJANGO_DIR/manager.py migrate
```

## Ressources

* [Style de code et conventions pour react et javascript](https://github.com/airbnb/javascript/tree/master/react)

* [Style de code et conventions pep8 pour python](https://www.python.org/dev/peps/pep-0008/)

* [Opencv - Image processing with python API](https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_table_of_contents_imgproc/py_table_of_contents_imgproc.html#py-table-of-content-imgproc)

* [Tutoriel pour utiliser react avec npm, babel et webpack](https://www.codementor.io/tamizhvendan/beginner-guide-setup-reactjs-environment-npm-babel-6-webpack-du107r9zr)

* [Etat des lieux des différentes technologies javascript et de leur utilité](https://medium.com/@peterxjang/modern-javascript-explained-for-dinosaurs-f695e9747b70)

* [Bibliothèque recharts pour afficher des graphiques avec React et D3JS](https://github.com/recharts/recharts)

* [React props versus state](https://github.com/uberVU/react-guide/blob/master/props-vs-state.md)

* [Comment accéder à la vidéo et à l'audio d'un ordinateur depuis le navigateur](https://developer.mozilla.org/fr/docs/NavigatorUserMedia.getUserMedia)

* [Comment gérer le flux video/audio, gérer les formats en enregistrer](https://developer.mozilla.org/fr/docs/Web/API/MediaRecorder)

## Ressources (old)

* [Tutorial for using react with D3js (fork adapté pour la version 4 de D3JS)](https://github.com/MMquant/playing-with-react-and-d3)

* [Alternative à recharts, plus dynamique](https://github.com/kirjs/react-highcharts)
# Projet M2 MIAGE
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Build Status](https://travis-ci.org/vbouquet/realtime-keynote-feedback.svg?branch=master)](https://travis-ci.org/vbouquet/realtime-keynote-feedback)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9aff66ec6dc841a5971b1647be3b9657)](https://www.codacy.com/app/Remypoc/realtime-keynote-feedback?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=vbouquet/realtime-keynote-feedback&amp;utm_campaign=Badge_Grade)

## Auteurs
Valentin Bouquet - <[email protected]>

Rémy Pocquerusse - <[email protected]>

Oussemo Oulhaci - <[email protected]>

## Technologies

* Npm: Javascript package manager.
* Webpack: Javascript module bundler.
* Babel: Transpiling code for new languages features.
* React: MVC Framework for dynamic statefull web pages.
* Redux: State container for Javascript apps.
* Express: Basic nodejs server (for front-end testing).
* Django-rest: Framework for building web API.
* OpenCV: Computer vision and machine learning library.

## Prérequis
* Git, gestionnaire de version - [Télécharger git](https://git-scm.com/downloads)
* Virtualbox, outil de virtualisation - [Télécharger Virtualbox](https://www.virtualbox.org/wiki/Downloads)
* Vagrant, gestionnaire de machine virtuelle - [Télécharger vagrant](https://www.vagrantup.com/downloads.html)

## Installation

Lancer un terminal en mode administrateur sous windows (pour éviter les problèmes de symlink)
```
cd ~/{$project}
vagrant up
vagrant ssh
cd $PROJECT_DIR
sudo mount --bind $HOME_DIR/vagrant_node_modules $PROJECT_DIR/node_modules
# Lancez le serveur sur localhost:8080
node src/server/express/main.js &
# Lancez le serveur REST
python3.5 $DJANGO_DIR/manage.py runserver 0.0.0.0:8000 &
```

## Developpement

* ![DJANGO REST](https://github.com/vbouquet/realtime-keynote-feedback/tree/master/src/server/django_rest)

## CLI

### Vagrant
```
# Démarrrer la VM
vagrant up
# Eteindre la VM
vagrant halt
# Supprimer la VM
vagrant destroy
# Se connecter en ssh à la VM
vagrant ssh
```

### Front-end
```
# Lancer webpack avec la configuration pour produire le bundle.js (regroupement des dépendances javascript)
# Option 1
./node_modules/.bin/webpack -d --config webpack-config.js
# Option 2
npm run build
# Option 3, depuis n'importe quel dossier
npm run --prefix /vagrant build
# Lancer webpack pour automatiser la génération à chaque modification
# Attention: problème de synchronisation en dehors de la machine virtuelle
# Option 1
./node_modules/.bin/webpack -d --config webpack-config.js --watch
# Option 2
npm run watch
```

### Server REST
```
# Lancer le serveur Django depuis l'host
vagrant ssh -c "/usr/bin/python3.5 -u $DJANGO_DIR/manage.py runserver 0.0.0.0:8000"
# Lancer le serveur Django depuis la machine virtuelle
vagrant ssh
python3.5 $DJANGO_DIR/manage.py runserver 0.0.0.0:8000
# Lancer les migrations depuis l'host
vagrant ssh -c "/usr/bin/python3.5 -u $DJANGO_DIR/manage.py makemigrations"
vagrant ssh -c "/usr/bin/python3.5 -u $DJANGO_DIR/manage.py migrate"
# Lancer les migrations depuis la machine virtuelle
vagrant ssh
python3.5 $DJANGO_DIR/manage.py makemigrations
python3.5 $DJANGO_DIR/manager.py migrate
```

## Ressources

* [Style de code et conventions pour react et javascript](https://github.com/airbnb/javascript/tree/master/react)

* [Style de code et conventions pep8 pour python](https://www.python.org/dev/peps/pep-0008/)

* [Opencv - Image processing with python API](https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_table_of_contents_imgproc/py_table_of_contents_imgproc.html#py-table-of-content-imgproc)

* [Tutoriel pour utiliser react avec npm, babel et webpack](https://www.codementor.io/tamizhvendan/beginner-guide-setup-reactjs-environment-npm-babel-6-webpack-du107r9zr)

* [Etat des lieux des différentes technologies javascript et de leur utilité](https://medium.com/@peterxjang/modern-javascript-explained-for-dinosaurs-f695e9747b70)

* [Bibliothèque recharts pour afficher des graphiques avec React et D3JS](https://github.com/recharts/recharts)

* [React props versus state](https://github.com/uberVU/react-guide/blob/master/props-vs-state.md)

* [Comment accéder à la vidéo et à l'audio d'un ordinateur depuis le navigateur](https://developer.mozilla.org/fr/docs/NavigatorUserMedia.getUserMedia)

* [Comment gérer le flux video/audio, gérer les formats en enregistrer](https://developer.mozilla.org/fr/docs/Web/API/MediaRecorder)

## Ressources (old)

* [Tutorial for using react with D3js (fork adapté pour la version 4 de D3JS)](https://github.com/MMquant/playing-with-react-and-d3)

* [Alternative à recharts, plus dynamique](https://github.com/kirjs/react-highcharts)
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"name": "psi-javascript",
"version": "1.0.0",
"version": "0.1.0",
"description": "PSI Front-end template",
"main": "index.js",
"scripts": {
"build": "webpack -d --config ./webpack-config.js",
"build-prod": "",
"watch": "webpack -d --config ./webpack-config.js --watch"
},
"author": "Valentin Bouquet",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"express": "^4.16.2",
Expand All @@ -22,6 +24,9 @@
"material-ui-icons": "^1.0.0-beta.17",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"recharts": "^1.0.0-beta.0"
"react-redux": "^5.0.6",
"react-router-dom": "^4.2.2",
"recharts": "^1.0.0-beta.0",
"redux": "^3.7.2"
}
}
10 changes: 5 additions & 5 deletions scripts/install_django_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ sudo pip3 install pipreqs

sudo pip3 install coreapi==2.3.3

sudo pipreqs $DJANGO_DIR --force --savepath $DJANGO_DIR/requirements.txt
#sudo pipreqs $DJANGO_DIR --force --savepath $DJANGO_DIR/requirements.txt
sudo pip3 install -r $DJANGO_DIR/requirements.txt

cd $DJANGO_DIR
$PYTHON manage.py migrate
echo "from django.contrib.auth.models import User; \
User.objects.filter(email='\[email protected]').delete(); \
User.objects.create_superuser('admin', '[email protected]', 'admin')" | \
$PYTHON manage.py shell
# echo "from django.contrib.auth.models import User; \
# User.objects.filter(email='\[email protected]').delete(); \
# User.objects.create_superuser('admin', '[email protected]', 'admin')" | \
# $PYTHON manage.py shell
Loading

0 comments on commit ee6edf4

Please sign in to comment.