$ npm install
$ npm run build
$ node .
.
The client works with the following technos :
About | Tech |
---|---|
Lib | React+Reflux |
Style | Sass |
Bundler | Webpack |
Build the prod bundles
$ npm run build
Build the dev bundles
$ npm run dev-client
const jsEntry = './client/src/app.js';
const langEntry = '/client/assets/';
const output = './client/.dist';
const bundleName = 'bundle'
The project use i18n-webpack-plugin to create one bundle by languages.
The strings included in the tr() functions are automatically translated into bundles.
The translation keys are here :
./client/assets/[lang].json
For each [lang].json a [lang].bundle.js is maked. In Local env, only fr is enabled.
.
The server works with the following technos
About | Tech |
---|---|
Engine | Express |
BDD | Mongo |
Templating | EJS |
Simple server start
$ node .
Start with auto-refresh
$ npm install nodemon -g // first time
$ npm run dev-server
Start in production
$ npm install forever -g // first time
$ forever start . .
The server is configured in conf.js
./server/conf.js
NODE_ENV: process.env.NODE_ENV,
HOST_NAME: process.env.NODE_ENV,
URI: process.env.URI,
EMAIL_KEY: process.env.EMAIL_KEY,
EMAIL_SECRET: process.env.EMAIL_SECRET,
CLOUD_KEY: process.env.CLOUD_KEY,
CLOUD_SECRET: process.env.CLOUD_SECRET
GOOGLE_API_KEY: process.env.GOOGLE_API_KEY
The server API is configured via this directory.
./server/api/
One directory for each model. In each directory :
- routes directory to declare enabled routes
- model.js to declare a mongo document model
In each model Access Control List must be configured :
Actions :
- READ
- CREATE
- UPDATE
- DELETE
Limites :
- $everyone
- $authenticated
- $teamMember
- $owner
The language is determined according to the domain extension.
- fr use fr.bundle.js
- com use en.bundle.js
- none use fr.bundle.js
- Add a [newlang].json in ./client/assets/
- Configure ./server/routes.js: res.render(index, { lang: 'newlang' });
- Add a new seo template : ./server/template/seo/[newlang].js