This boilerplate loads Bootstrap 4, Font Awesome 4, jQuery and popper.js and more useful stuff.
We included everything you need to start a small project from scratch.
The npm start command will not only start the application, but also watch for changes of your SCSS and JavaScript files, using webpack. The nodemon package is used to automatically restart the server, if your scripts change, while it's running.
- Download the boilerplate as .zip-file.
- Extract the files and copy them to your project root.
- Run
npm installin your terminal to get all needed packages. - Copy the variables.env.sample file to variables.env.
- Run
npm startto start the node.js application.
If you want to run the application in development mode, where webpack is watching for changes of SCSS and JavaScript files, etc. simply run the following command:
npm run dev.
And for production mode use:
npm start
The configuration of the basic application (environment + port) is done in the variables.env file.
If you need more settings, that you would like to exclude from Git, you should add them here.
If you want to use TLS for secure connections, read our Let's Encrypt page.
The routing is done in the /routes/web.js file.
Just edit it and make it fit to your needs.
The views are located in the /views/ directory and we use Pug as the default template engine.
The navigation items are red from the helpers.js file. If you don't want to use the helper file you can overwrite the navigation in the view file partials/navbar.pug.
The npm run dev command will recompile all SCSS and JavaScript files automatically using webpack, if changes are detected.
This project is available under MIT License and is free for private and commercial usage.