BlurAdmin: AngularJS Bootstrap Admin Panel Framework
This guide provides comprehensive instructions for deploying and using BlurAdmin, an AngularJS Bootstrap Admin Panel Framework.
Prerequisites
Before you begin, ensure you have the following installed:
- Node.js: Version 6.x or higher.
- Check your version with:
node -v
- Check your version with:
- npm (Node Package Manager): Comes bundled with Node.js.
- Check your version with:
npm -v
- Check your version with:
- Git: For cloning the repository.
- Check your version with:
git --version
- Check your version with:
Installation
Follow these steps to get BlurAdmin up and running on your local machine:
-
Clone the repository:
git clone https://github.com/akveo/blur-admin.git cd blur-admin -
Install project dependencies:
npm install
Configuration
BlurAdmin is primarily a front-end framework and generally does not require extensive server-side configuration or API keys for basic usage.
- Theming: You can customize the theme by modifying the Sass files located in
src/app/theme/. - Data: Data for components like tables (
src/app/pages/tables/TablesPageCtrl.js), maps (src/app/pages/maps/map-bubbles/MapBubblePageCtrl.js,src/app/pages/maps/map-lines/MapLinesPageCtrl.js), and mail (src/app/pages/components/mail/mailMessages.js) are hardcoded in their respective controller/service files. For dynamic data, you would integrate with a backend API.
Build & Run
BlurAdmin uses Gulp for its build process.
Development Mode
To run the application in development mode with live-reloading:
gulp serve
This command will:
- Compile Sass, JavaScript, and other assets.
- Start a local development server.
- Open the application in your default web browser (usually at
http://localhost:3000). - Watch for file changes and automatically reload the browser.
Production Build
To create a production-ready build of the application:
gulp build
This command will:
- Minify and concatenate JavaScript, CSS, and other assets.
- Optimize images.
- Place the compiled and optimized files into the
dist/directory.
Deployment
BlurAdmin generates static assets, making it suitable for deployment on various static site hosting services or traditional web servers.
Static Site Hosting (Recommended)
After running gulp build, the dist/ directory contains all the necessary files for deployment.
-
Netlify:
- Push your
blur-adminrepository to GitHub, GitLab, or Bitbucket. - Sign up for Netlify and connect your Git repository.
- Configure Netlify:
- Build command:
npm install && gulp build - Publish directory:
dist
- Build command:
- Deploy your site.
- Push your
-
Vercel:
- Push your
blur-adminrepository to GitHub, GitLab, or Bitbucket. - Sign up for Vercel and import your Git repository.
- Vercel should automatically detect the project type. If prompted, set:
- Build Command:
npm install && gulp build - Output Directory:
dist
- Build Command:
- Deploy your site.
- Push your
-
GitHub Pages:
- Ensure your
distfolder is committed to your repository. - In your GitHub repository settings, navigate to "Pages".
- Select the
masterbranch (orgh-pagesbranch if you prefer) and the/distfolder as the source. - Save your changes. Your site will be deployed to
yourusername.github.io/your-repo-name.
- Ensure your
Traditional Web Server (Apache/Nginx)
- Run
gulp buildto generate the production files in thedist/directory. - Copy the entire contents of the
dist/directory to your web server's document root (e.g.,/var/www/htmlfor Apache or/usr/share/nginx/htmlfor Nginx). - Ensure your web server is configured to serve static files from that directory.
Troubleshooting
-
npm installfails:- Issue: Dependency conflicts or network issues.
- Solution:
- Clear npm cache:
npm cache clean --force - Delete
node_modulesdirectory andpackage-lock.json(ornpm-shrinkwrap.json), then runnpm installagain. - Ensure you have a stable internet connection.
- Check your Node.js and npm versions against the recommended prerequisites.
- Clear npm cache:
-
gulp servedoesn't open in browser or shows errors:- Issue: Gulp tasks failing, port already in use, or browser issues.
- Solution:
- Check the console output for specific Gulp errors.
- If the port is in use, you might see a message like "Address already in use". Try stopping other services using port 3000 or configure Gulp to use a different port (this requires modifying the Gulpfile).
- Manually navigate to
http://localhost:3000in your browser.
-
Styling or JavaScript not loading after deployment:
- Issue: Incorrect file paths in the production build or server configuration.
- Solution:
- Inspect your browser's developer console for 404 errors related to CSS or JS files.
- Ensure the
dist/directory contents are correctly placed in your web server's root or the specified publish directory for static hosts. - Verify that base paths are correctly configured if your application is served from a sub-directory (e.g.,
yourdomain.com/blur-admin/). This usually involves modifying theindex.html<base href="/">tag or Gulp configuration.
-
"Cannot GET /" after deployment:
- Issue: Server not configured for single-page applications, especially when navigating directly to sub-routes.
- Solution: For static hosting, this is usually handled automatically. For traditional web servers, you need to configure URL rewriting to redirect all requests to
index.html.- Apache: Add a
.htaccessfile in your root with:<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L] </IfModule> - Nginx: In your server block configuration:
location / { try_files $uri $uri/ /index.html; }
- Apache: Add a