1.0.4 • Published 7 months ago

create-simmerplate v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Simmerplate šŸ³

Install with npx

npx create-simmerplate my-project

Github for the npx package

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)
  • 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
1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago