Skip to content

ali322/ssr-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSR Boilerplate

Build Status Dependency Status Maintainability

ssr(server side render) project boilerplate 中文文档

Develop

  1. clone to your local disk git clone https://github.com/ali322/ssr-boilerplate
  2. run npm install
  3. run npm install nva -g
  4. run nva dev to start develop server
  5. run npm run lint to lint source code
  6. run npm test to run tests

Deploy

  1. run nva build release static source and inject to html
  2. upload your project to deploy environment
  3. run npm install --production
  4. run npm install pm2 -g (more instructions in pm2 documention)
  5. run pm2 start app.js --name <Project Name> to deploy

Directory structure

test/
    |-- client/ #client unit tests
    |-- server/ #server unit tests
client/
    |-- asset/      #images,fonts and so on
    |-- bundle/
        |-- common/ #public css and js
        |-- component/ #component's css
        |-- error/  #error page's entry js and css
        |-- index/  #index page's entry js and css
        |-- .../    #more your own page's entry js and css,like index page
    |-- dist/     #compiled client assets
server/
    |-- controller/ #express routes directory
    |-- lib/        #server libraries,util and helper modules inside
    |-- router.js   #server router,all the routes is defined here
    |-- bootstrap.js #initialize application,load middlewares and setup
    |-- view/
        |-- layout.html #global layout template
        |-- index.html  #index page's template
        |-- *.html      #more your own page's template
app.js      #web application enrty file

License

MIT License