Skip to content

emirpasic/qam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qam logo

Node.js Web Application Framework

Getting started

  • Install Node.js v6
  • Install yarn: npm install -g yarn
  • Install dependencies: yarn
  • Install gulp: npm install -g gulp

Running in development

Running in production

  • Compile your assets: gulp jsx:compile && gulp less:compile
  • Start server: NODE_ENV=production node app.js

Directory structure

  • assets private assets
    • jsx frontend javascript that will be compiled
    • less less files
  • config configurations
    • config.js main configuration file
  • middleware express middleware
  • public public assets
    • css compiled css files
    • js compiled frontend javascript
  • routes server router
    • routes.js entry point for all routes
  • util utility and helper functions
  • views ejs files and templates
  • app.js entry point of the application server
  • gulpfile.js various gulp tasks

Technology stack (reasoning)

  • Node.js v6 (fast and battle-tested process based async architecture, version 6 to support for ES6 Harmony)
  • Server side ECMAScript 6 (arrow functions, classes, template strings, spread, etc.)
  • yarn (faster and safer than npm and removes the need for shrinkwrap)
  • Express as web application framework (popular, fast, unopinionated, minimalist)
  • Node.js native cluster (more processes for more throughput)
  • Logging with winston and winston-express
  • Configurations simply though Javascript
  • Routing natively with Express (simple, thus fast)
  • EJS for templates (popular and advanced)
  • LESS for CSS (less is more)
  • Partial templates with EJS (simple and no magic from using other libraries)
  • Error handling (40x, 50x)
  • Frontend side Javascript (ECMAScript 6) compilation and injection with babel and browserify
  • Watchers for automatic frontend Javascript builds in development
  • Watchers for automatic LESS compilations in development
  • Watchers for automatic server restarts in development with nodemon
  • Caching (Nginx reverse proxy cache, S3, Memcached or files)
  • ESLint (linting for better code readability)