-
Notifications
You must be signed in to change notification settings - Fork 106
Development Guide
Florent Garin edited this page Dec 20, 2016
·
38 revisions
This page describes the intricacies of DocDokuPLM development.
To know DocDoku coding convention look at [Code Convention](Code Convention).
By "DocDokuPLM web client" we mean the web based (HTML UI) front-end. Since DocDokuPLM is a modular platform, the software core engine and the web UI are two distinct components.
- DocDokuPLM server (core engine)
- node >= 4.2.6
- npm
- git
- nginx (or other proxy capable software)
Node module required as global: grunt-cli. To install it run (may requires sudo on linux)
npm install -g grunt-cli
We commonly use nginx and/or apache2 for the project, here is the configuration
server {
listen 8989;
server_name localhost;
# Static grunt server
location / {
proxy_pass http://localhost:9001;
# OR If you want to serve static files directly :
# root /path/to/docdoku-web-front/dist;
# expires 30d;
# access_log off;
}
# Webservices REST
location /api {
proxy_pass http://localhost:8080;
}
# Websocket application
location /ws {
proxy_pass http://localhost:8080/ws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 7200s;
}
}
server {
listen 8787;
server_name localhost;
# SSL Configuration
ssl on;
ssl_certificate /path/to/local.crt;
ssl_certificate_key /path/to/local.key;
# Static grunt server
location / {
proxy_pass http://localhost:9001;
}
# Webservices REST
location /api {
proxy_pass https://localhost:8181;
}
# Websocket application
location /ws {
proxy_pass https://localhost:8181/ws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 7200s;
}
}
<VirtualHost *:8889>
ServerName localhost
DocumentRoot /path/to/docdoku-web-front/dist
ProxyPreserveHost On
ProxyRequests On
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/ws [NC]
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule /(.*) ws://localhost:8080/ws/$1 [P,L]
ProxyPass /ws ws://localhost:8080/ws
ProxyPassReverse /ws ws://localhost:8080/ws
ProxyPass /api http://localhost:8080/api
ProxyPassReverse /api http://localhost:8080/api
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /path/to/docdoku-web-front/dist>
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
You may need to add to /etc/apache2/ports.conf
Listen 8889
Apache required modules :
$ a2enmod proxy proxy_http proxy_wstunnel rewrite
Once all is ready you can run the following npm commands :
-
npm run dev
to launch the grunt server -
npm run clean
to cleandist
folder -
npm run build
to build the app todist
folder
Run npm install && bower install
before using grunt
- grunt ou grunt build: build all modules
- grunt build-module:: build a specific module
- grunt serve: serve the application files on port 9001 with livereload
- grunt serve:dist: build the application and serve the dist folder on port 9001
- grunt clean: clean dist folder