This guide covers the development workflow for working with Adminator, including running the development server, making changes, and best practices.
After installation, start the development server:
npm start
Your application will be available at http://localhost:4000
The standard development server includes hot module replacement (HMR) for instant updates:
npm start
Features:
For enhanced development experience with visual feedback:
npm run dev
Additional Features:
| Command | Description |
|---|---|
npm start |
Start development server with HMR |
npm run dev |
Start development server with webpack dashboard |
npm run clean |
Clean the dist/ directory |
| Command | Description |
|---|---|
npm run build |
Production build (optimized, minified) |
npm run release:minified |
Production build with minification |
npm run release:unminified |
Production build without minification (for debugging) |
npm run preview |
Preview production build locally |
| Command | Description |
|---|---|
npm run lint |
Run all linters (JavaScript + SCSS) |
npm run lint:js |
Lint JavaScript files with ESLint |
npm run lint:scss |
Lint SCSS files with Stylelint |
The development server automatically watches for changes in:
src/*.html)src/assets/scripts/**/*.js)src/assets/styles/**/*.scss)src/assets/static/**/*)Changes are automatically compiled and the browser refreshes.
Start the development server
npm start
Make your changes in the src/ directory
Save the file - Changes are automatically detected
Browser refreshes - See your changes instantly
HMR allows modules to be updated without a full page reload, preserving application state.
Adminator uses ESLint 9.x with flat configuration:
# Lint all JavaScript files
npm run lint:js
# Auto-fix issues (if possible)
npx eslint ./src --fix
Configuration: eslint.config.mjs
Rules:
Maintain consistent SCSS code style:
# Lint all SCSS files
npm run lint:scss
# Auto-fix issues (if possible)
npx stylelint "./src/**/*.scss" --fix
Configuration: .stylelintrc.json
npm run lint
This runs both JavaScript and SCSS linters in sequence.
Development builds include source maps for easier debugging:
webpack://The application includes minimal console output in production. For development debugging:
// Development-only logging
if (process.env.NODE_ENV !== 'production') {
console.log('Debug info:', data);
}
Recommended Extensions:
src/assets/scripts/components/:// src/assets/scripts/components/MyComponent.js
class MyComponent {
constructor(element) {
this.element = element;
this.init();
}
init() {
// Initialize component
this.setupEventListeners();
}
setupEventListeners() {
// Add event listeners
}
destroy() {
// Cleanup
}
}
export default MyComponent;
app.js:import MyComponent from '@/components/MyComponent';
// Initialize
const myComponent = new MyComponent(document.querySelector('.my-component'));
src/assets/styles/spec/components/:// src/assets/styles/spec/components/myComponent.scss
.my-component {
// Component styles
}
src/assets/styles/spec/components/index.scss:@import 'myComponent';
destroy() method for cleanup@/components, @/utils)Adminator follows ITCSS (Inverted Triangle CSS) methodology:
styles/
├── settings/ # Variables, config
├── tools/ # Mixins, functions
├── generic/ # Reset, normalize
├── components/ # UI components
├── utils/ # Utility classes
└── vendor/ # Third-party styles
src/assets/styles/spec/components/src/assets/styles/spec/screens/src/assets/styles/spec/utils/Adminator uses CSS custom properties for theming:
.my-component {
background: var(--c-bkg-card);
color: var(--c-text-base);
border: 1px solid var(--c-border);
}
Available variables: See src/assets/styles/spec/utils/theme.css
Ensure your components support dark mode:
.my-component {
background: var(--c-bkg-card); // Auto-adjusts for dark mode
// Or use data attribute
[data-theme="dark"] & {
background: #1f2937;
}
}
If port 4000 is already in use:
# Kill the process using port 4000 (Windows)
netstat -ano | findstr :4000
taskkill /PID <PID> /F
# Or change the port in webpack/devServer.js
# Clean and rebuild
npm run clean
npm install
npm start
# Auto-fix common issues
npx eslint ./src --fix
npx stylelint "./src/**/*.scss" --fix
# Check remaining issues
npm run lint
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install
npm run dev
Provides visual feedback on build performance and bundle size.
Fix warnings and errors as they appear to maintain code quality.
Make small, focused commits with clear messages:
git add .
git commit -m "feat: add new dashboard widget"
git push
Now that you understand the development workflow:
Need Help? Check the main README or open an issue.