create-simmerplate v1.0.4
Simmerplate š³
Install with npx
npx create-simmerplate my-project
A bare-minimum fullstack web app boilerplate setup for quick prototyping
Simmerplate š³ sets up everything you need to get started with a fullstack web app. Simply run the commands and start coding.
Javascript files in the frontend/src/js
directory and CSS files in the frontend/src/css
directory are bundled by webpack and served as single javascript and css files respectively in the frontend/dist/js
and frontend/dist/css
directories.
index.html
in the frontend/dist
directory is the entry point for the app. It imports the bundled javascript and css files.
The template is intentionally using vanilla javascript and css, so you can expand it with your own libraries and frameworks.
Features
- Node.js server
- Express
- Rate limiting
- Statically serving the frontend/dist directory
- Error handling middleware
- Simple hello world GET endpoint
- Browser-sync
- Proxies the served app on the local network, for easy mobile development (check the IPs in the terminal when running
npm run dev
) - Automatically reloads the browser when files change (aka. hot reloading)
- Proxies the served app on the local network, for easy mobile development (check the IPs in the terminal when running
- Webpack
- Bundling javascript and css files
- Hot reloading
- Babel
- ESLint
- Linting for both frontend and backend files
- Prettier
Usage
Run both back-end and front-end in two separate terminals.
Front-end:
npm run dev
Back-end:
npm run dev-server
Debugging
Back-end
A debug launch config is included for VSCode, start it by pressing F5.
Front-end
Use chrome devtools to debug the front-end.
Building front-end for production:
npm run build
Project Structure
project-root/
āāā frontend/
ā āāā src/
ā ā āāā css/
ā ā ā āāā app.css # Main stylesheet
ā ā ā
ā ā āāā app.js # Main JavaScript entry
ā ā
ā āāā dist/
ā ā āāā css/ # Bundled CSS output
ā ā āāā js/ # Bundled JS output
ā ā āāā index.html # Main HTML entry
ā ā
ā āāā webpack/
ā āāā webpack.config.js # Webpack configuration
ā āāā babel.config.js # Babel configuration
ā āāā eslint.config.js # Frontend ESLint configuration
ā āāā clean-dist.js # Script to clean the dist directory
ā āāā update-index.js # Script to update the index.html file with new bundle files
ā
āāā backend/
ā āāā src/
ā ā āāā server.js # Express.js server
ā ā
ā āāā lint/
ā ā āāā eslint.config.js # Backend ESLint configuration
ā ā
ā āāā .env
ā
āāā .vscode/
ā āāā launch.json # Debug configuration
ā
āāā package.json