Giter VIP home page Giter VIP logo

template's Introduction

Fullstack Template Project : Express React+Reflux

Start project

$ npm install
$ npm run build
$ node .

.

Client

Used technologies

The client works with the following technos :

About Tech
Lib React+Reflux
Style Sass
Bundler Webpack

Building commands

Build the prod bundles

$ npm run build

Build the dev bundles

$ npm run dev-client

Webpack configuration

const jsEntry = './client/src/app.js';
const langEntry = '/client/assets/';
const output = './client/.dist';
const bundleName = 'bundle'

Multi language

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.

.

Server

The server works with the following technos

About Tech
Engine Express
BDD Mongo
Templating EJS

Start server

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 . .

Server configuration

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

API

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

Languages

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 new language

  1. Add a [newlang].json in ./client/assets/
  2. Configure ./server/routes.js: res.render(index, { lang: 'newlang' });
  3. Add a new seo template : ./server/template/seo/[newlang].js

template's People

Contributors

hephaistionn avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.