ColorlibHQ /
AdminLTE
AdminLTE - Free admin dashboard template based on Bootstrap 5
Loading repository data…
noreading / repository
A Bootstrap 5 boilerplate, using Webpack 5, Babel, SCSS, etc.
[!WARNING]
This repository is archived and not maintained anymore!
This is a professional front-end template for building web apps and sites faster, without having to create the basic setup on your own, every time you start a new project.
The template is based on the Bootstrap Framework in version 5 and uses Webpack in version 5 as a flexible and modern module bundler. All common features for front-end projects (like SCSS compilation, minifying of Assets, etc.) are included out of the box.
In development the DevServer plugin is used, to serve the page with
hot reloading enabled, so that you can see all changes in your code immediately. When you're done, just run the build
command and upload all files from the public folder.
In addition to the basic front-end project setup, I added some cool features like a configurable image resizing command to make generating responsive images a breeze.
The boilerplate needs Node.js to be installed on your system. It was tested with version 12 and newer.
Clone the repository into a new folder for your new project.
git clone git@github.com:noreading/bootstrap5-webpack-boilerplate.git my-project
Remove the .git directory to add your own CVS later.
rm -rf .git
Update the package.json.
{
"name": "my-project",
"description": "A description of my new project",
"author": "Your Name",
"license": "MIT"
}
Enable / Disable bootstrap features in main.js.
initBootstrap({
tooltip: true,
popover: true,
toasts: true,
});
Install needed dependencies
npm install
Run webpack
The dev command will start a dev server and watch for code changes in JS and SCSS files. Hot reloading is enabled, so
that any change will be visible in your browser as you type.
npm run dev
For production usage, run the build command and everything you need gets packed together into the public
directory. You can upload the content to any hosting provider, without further modifications.
npm run build
If you use sensitive information in your code, like API keys or encryption tokens, you should never store those in your code repository. This could lead to a security issue, especially if the repository is public.
Therefore, I included the dotenv-webpack plugin in this boilerplate, that
enables you to store all your sensitive information in a .env file, that is ignored by git.
The .env.default file should contain all the variables that your application needs, but without the real data and
should contain either empty variables or default values that can be used by everyone. The variables will get replaced
during asset compilation so that only those variables are added, that are referenced in your code.
It is a common scheme to use an uppercase syntax for environment variables, as you can see in the example below. Comments inside of .env files start with a hash.
# GOOGLE APIs
GOOGLE_MAPS_API_KEY=vEVmihkWZ2fqedyHQT***************
YOUTUBE_API_KEY=TnJ8YOfVuL9bbFH83T13N****************
# CACHING
CACHE_ENABLED=false
CACHE_TIMEOUT=3600
You can test the usage of environment variables by editing the .envt file and changing the value of HELLO. After
re-compiling the assets you should see a message in the developer console, as soon as you visit the demo page.
Important:
After each change of the .env file you need to reload Webpack, as the environment is only loaded once per runtime. If
you've got an active npm run dev command, you need to stop and re-run it, for the changes to take effect.
If you want to add fonts from fonts.google.com, you should follow a few easy steps. The boilerplate uses the Roboto as an example.
/fonts/ in the theme directory.src/scss/_fonts.scss and use the mixin googleFont() to add the fonts.The mixin has 4 parameters.
| Name | Type | Description |
|---|---|---|
| name | String | The name of the font, used as value for font-family properties. |
| folder | String | The name of the folder, that is extracted from the ZIP file. |
| files | String | The first part of font filenames. |
| weights | List | The list of weights, that should be loaded. |
Example:
@include googleFont((
"name": "IBM Plex Sans",
"folder": "IBM_Plex_Sans",
"files": "IBMPlexSans",
"weights": (300, 400, 700)
));
There is also a second mixin, that can handle multiple fonts at once. This reduces the amount of code needed, if your website or application requires multiple fonts to be loaded.
Example:
@include googleFonts((
(
"name": "Roboto",
"folder": "Roboto",
"files": "Roboto",
"weights": (300, 400, 700)
),
(
"name": "Besley",
"folder": "Besley",
"files": "Besley",
"weights": (300, 400, 700)
),
));
This boilerplate includes a command to resize images based on a configuration file, to get rid of the hassle to care about the responsive image sizes manually. One of the benefits of this process is that it works on all major operating systems, without the need to do any manual installations.
If you want to use the resizing feature, please edit the file images.config.js in the root directory and change all
settings to your needs. You can add multiple collections with different configurations for greatest flexibility.
In order for this command to work properly you need to have "clean" filenames for your images, that don't match the patterns used to create the resized filenames automatically. The filenames get a postfix, based on the resizing settings for the images width and height.
Filenames, that will be recognized as original images, are as follows.
Filenames, that will not be recognized as original images, are as follows.
You can use a test tool to check if your filenames will work correctly, by adding one filename per line into the "Test Strings" field. This helps to ensure that none of your images will be deleted.
You can use the regular expression to test files on your local machine, too. On Linux and Mac operating systems you can check if any image in a folder would conflict with the resizing tool by using the following command:
find ./ | grep -E ".*\-([0-9]+x[0-9]+|w[0-9]+|h[0-9]+)\.[a-z]+$"
All files that are listed should get renamed, following the rules you can see in the tables above.
The responsive image configuration is saved in the images.config.js file, located in the root directory of the
project.
The configuration has some global settings, that you should set to your personal preferences.
The configuration uses collections which include a set of configuration options to resize images. This allows you to define different resizing rules for multiple directories.
Each collection has the following options.
Each collection has the option "sizes" which includes a set of configurations for different image sizes that will be generated. Width and height are optional, if at least one of them is set.
Each size has the following options.
Selected from shared topics, language and repository description—not editorial ratings.
ColorlibHQ /
AdminLTE - Free admin dashboard template based on Bootstrap 5
adminkit /
AdminKit is a free & open-source HTML dashboard & admin template based on Bootstrap 5
themeselection /
Most Powerful & Comprehensive Free Bootstrap 5 HTML Admin Dashboard Template built for developers! 🚀
themeselection /
Most Powerful & Comprehensive Free Bootstrap 5 HTML Laravel Admin Dashboard Template built for developers!
codescandy /
Bootstrap 5 Admin & Dashboard Template Free - Dash-UI. Dash UI Kit is a free and open-source components and templates kit fully coded with Bootstrap 5.
DashboardPack /
ArchitectUI Dashboard Free is lightweight and comes packed with the minimal set of components to get you started. If you have a simple application, it’s the perfect solution for you. It’s built on top of Bootstrap 5 and features a scalable architecture just like it’s wiser, older sibling – ArchitectUI HTML Pro theme.