|
|
@@ -1,29 +1,194 @@
|
|
|
# FatboarProject
|
|
|
|
|
|
-<<<<<<< HEAD
|
|
|
+
|
|
|
Ceci est un site de jeu concours pour burger
|
|
|
-=======
|
|
|
+
|
|
|
FatboarProject est une application jeu concours pour la societe de restauration
|
|
|
|
|
|
-# Angular-client
|
|
|
-## run ##
|
|
|
+# Documentation
|
|
|
+
|
|
|
+https://medium.com/bb-tutorials-and-thoughts/how-to-develop-and-build-mean-stack-355bd0c23a68
|
|
|
+
|
|
|
+Please install [Docker](https://docs.docker.com/install/#supported-platforms) and [Docker Compose](https://docs.docker.com/compose/install/)
|
|
|
+
|
|
|
+### 1.Installation
|
|
|
+
|
|
|
+```sh
|
|
|
+$ cd mean-stack-docker
|
|
|
+```
|
|
|
+
|
|
|
+##### Angular Client
|
|
|
+```sh
|
|
|
+$ cd angular-client && npm install
|
|
|
+```
|
|
|
+
|
|
|
+##### Express Server
|
|
|
+```sh
|
|
|
+$ cd express-server && npm install
|
|
|
+```
|
|
|
+
|
|
|
+
|
|
|
+##### Start Command
|
|
|
+```sh
|
|
|
+$ docker-compose up -d
|
|
|
+```
|
|
|
+
|
|
|
+### 2.Test
|
|
|
+##### Angular Client
|
|
|
+[http://localhost:4200](http://localhost:4200)
|
|
|
+
|
|
|
+##### Express Server
|
|
|
+[http://localhost:4000](http://localhost:4000)
|
|
|
+
|
|
|
+
|
|
|
+[](https://mehmetseven.net/mean-stack-docker)
|
|
|
+
|
|
|
+# Etape de migration
|
|
|
+
|
|
|
+express-server:
|
|
|
+
|
|
|
+Ajout des fichiers Dockerfile et logging.js
|
|
|
+
|
|
|
+Dependances:
|
|
|
+"dayjs": "^1.8.29",
|
|
|
+"mkdirp": "^1.0.4",
|
|
|
+"prom-client": "^12.0.0",
|
|
|
+"express-prom-bundle": "^6.1.0",
|
|
|
+
|
|
|
+Ajout dans le index.js:
|
|
|
+
|
|
|
+const Logger = require('./logging')
|
|
|
+
|
|
|
+metrics
|
|
|
+const makeApiMiddleware = require("api-express-exporter");
|
|
|
+const apiMetrics = require('prometheus-api-metrics');
|
|
|
+const client = require('prom-client');
|
|
|
+const promBundle = require("express-prom-bundle");
|
|
|
+const metricsMiddleware = promBundle({includeMethod: true, includePath: true});
|
|
|
+
|
|
|
+const app = express();
|
|
|
+
|
|
|
+Logger.error('hello world', 'Nan c est juste pour tester les logs')
|
|
|
+
|
|
|
+app.use(metricsMiddleware);
|
|
|
+
|
|
|
+angular-client:
|
|
|
+
|
|
|
+Ajout Dockerfile
|
|
|
+
|
|
|
+# Mongodb Compass
|
|
|
+
|
|
|
+mongodb://51.159.4.88:27017
|
|
|
+
|
|
|
+
|
|
|
+# Grafana + Prometheus + Node.js Metrics Configuration server Express
|
|
|
+
|
|
|
+Installation des packages Node.js pour la collecte des metrics avec prometheus
|
|
|
+...
|
|
|
+npm install api-express-exporter
|
|
|
+npm install prom-client
|
|
|
+npm install prometheus-api-metrics
|
|
|
+npm install express-prom-bundle
|
|
|
+...
|
|
|
+
|
|
|
+Import et déclaration variables:
|
|
|
+...
|
|
|
+const promBundle = require("express-prom-bundle");
|
|
|
+const metricsMiddleware = promBundle({includeMethod: true, includePath: true});
|
|
|
+...
|
|
|
+
|
|
|
+Application du middleware pour les metrics:
|
|
|
+...
|
|
|
+app.use(metricsMiddleware);
|
|
|
+...
|
|
|
+
|
|
|
+Metrics Query Test dans Explore:
|
|
|
+...
|
|
|
+sum(increase(http_request_duration_seconds_count[5m])) by (method, path)
|
|
|
+...
|
|
|
+
|
|
|
+# Description du contenu de la clé
|
|
|
+* Cahier des charges 'client'.
|
|
|
+* Cahier de specifications techniques 'workflow'.
|
|
|
+* Support de présentation.
|
|
|
+* Le code Front(Angular)/Back(Express.js) du projet.
|
|
|
+* L'intégralité des configurations serveur.
|
|
|
+
|
|
|
+# Acces au serveur en SSH
|
|
|
+
|
|
|
+Acces au serveur distant debian
|
|
|
+en ssh: formation@51.159.4.88
|
|
|
+Mdp: Achji219
|
|
|
+
|
|
|
+# Acces au serveur traefik
|
|
|
+https://traefik.foodgame.fr/
|
|
|
+
|
|
|
+# Acces au serveur CI
|
|
|
+
|
|
|
+Acces au server CI:
|
|
|
+https://jenkins.foodgame.fr/
|
|
|
+user : admin
|
|
|
+Mp : jenkins
|
|
|
+
|
|
|
+# Acces au serveur SCM
|
|
|
+
|
|
|
+Acces au server SCM:
|
|
|
+https://gogs.foodgame.fr/
|
|
|
+user : formation
|
|
|
+Mp : azerty10
|
|
|
+
|
|
|
+# Acces au serveur Grafana(Metrics)
|
|
|
+
|
|
|
+https://grafana.foodgame.fr/
|
|
|
+user : admin
|
|
|
+Mp : azerty10
|
|
|
+
|
|
|
+# Acces au serveur Prometheus(Metrics)
|
|
|
+
|
|
|
+https://prometheus.foodgame.fr/
|
|
|
+
|
|
|
+# Acces au serveur SonarQube
|
|
|
+
|
|
|
+https://sonarqube.foodgame.fr/
|
|
|
+user : admin
|
|
|
+Mp : azerty10
|
|
|
+
|
|
|
+# Acces au serveur Nexus
|
|
|
+
|
|
|
+https://nexus.foodgame.fr/nexus/#welcome
|
|
|
+user : admin
|
|
|
+Mp : azerty10
|
|
|
+
|
|
|
+# Angular(Preprod)
|
|
|
+
|
|
|
+https://angular-preprod.foodgame.fr
|
|
|
+http://51.159.4.88:8080
|
|
|
+
|
|
|
+# Express(Preprod)
|
|
|
+
|
|
|
+Base Api: https://api-preprod.foodgame.fr
|
|
|
+Metrics: https://api-preprod.foodgame.fr/metrics
|
|
|
+
|
|
|
+# Angular(Prod)
|
|
|
+
|
|
|
+https://angular-prod.foodgame.fr
|
|
|
+http://51.159.4.88:8080
|
|
|
+
|
|
|
+# Express(Prod)
|
|
|
+
|
|
|
+Base Api: https://api-prod.foodgame.fr
|
|
|
+Metrics: https://api-prod.foodgame.fr/metrics
|
|
|
+
|
|
|
+# Backup
|
|
|
+sh ' docker-compose run back up '
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- cd angular-client
|
|
|
|
|
|
- npm install
|
|
|
|
|
|
- ng serve
|
|
|
-
|
|
|
|
|
|
-# express-server
|
|
|
|
|
|
-## run ##
|
|
|
|
|
|
- cd express-server
|
|
|
|
|
|
- npm install
|
|
|
|
|
|
- node index.js
|
|
|
|
|
|
-# Run with Docker
|
|
|
->>>>>>> new-branche-merge
|