This is the source for my website www.zakwest.co.uk. It's built using Node.js on the server side and preact on the client side. jest and enzyme are used for testing whilst eslint and stylelint are the linters.
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# run tests with jest and preact-render-spy
npm run test
# run eslint and stylelint
npm run lint
www.zakwest.tech
config
service files for systemd and config files for apache when using dev.zakwest.co.ukcoverage
code coverage reports produced by jest and consumed by coverallspublic
files that are made accessable to webrequests by webpack or expressdata
json files, currently for the link boxes on the home page and the file treeimg
all the dynamic/large/raster image assets are herefiles
all file downloads are served from here
src
source code for the siteassets
small image assets that can be bake into the build are herecomponents
preact components and their stylesroutes
preact routes and their styles are herestyle
Site wide styles (font familys, coulor scheme) are here
server
server side code run by nodetests
tests for the site__mocks__
testing mocks__setup__
enzyme setup scriptcomponents
tests for the preact componentsroutes
tests for the preact routes
Head over to the dev.zakwest.co.uk repo to find out how to use vagrant to host this project. The provisioning script deals with all the installation and setup and make the site avaliable at www.dev.zakwest.co.uk .
To rebuild the site via npm run the following commands.
cd /var/www/www.zakwest.tech/
npm run build
If changes have been made to the site, then you'll have to restart the node app.
sudo service www.dev.zakwest.tech restart
If changes have been made to the nginx config, then you'll have to restart nginx.
sudo restart nginx service
To remove all the built files do
cd /var/www/www.zakwest.tech/
npm run clean