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.
Development CLI Commands
# 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
configservice files for systemd and config files for apache when using dev.zakwest.co.uk
coveragecode coverage reports produced by jest and consumed by coveralls
publicfiles that are made accessable to webrequests by webpack or express
datajson files, currently for the link boxes on the home page and the file tree
imgall the dynamic/large/raster image assets are here
filesall file downloads are served from here
srcsource code for the site
assetssmall image assets that can be bake into the build are here
componentspreact components and their styles
routespreact routes and their styles are here
styleSite wide styles (font familys, coulor scheme) are here
serverserver side code run by node
teststests for the site
__setup__enzyme setup script
componentstests for the preact components
routestests for the preact routes
Building and Running the pseudo Production enviroment
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