vizz-init
v2.0.1
Published
Start an express server with boilerplate code
Downloads
18
Readme
vizz-init
Generate Express.js projects with folder structure and starter code.
Installation
You can use this package without installing it globally by using npx:
npx vizz-init [project-name]Usage
Basic Usage
Create a new backend project in the current directory:
npx vizz-initThis will create a backend folder with the Express.js boilerplate.
Custom Project Name
Specify a custom project directory name:
npx vizz-init my-api-projectWhat it creates
When you run npx vizz-init, it will:
- Create a new directory (default:
backendor your specified name) - Initialize npm with
npm init -y - Install dependencies: Express.js and dotenv
- Generate a basic server.js file with:
- Express app setup
- JSON middleware
- Environment variable configuration
- Dynamic PORT from .env file
- Basic "Hello, world!" route
- Create environment files:
.envfile with PORT=3000.gitignorewith Node.js exclusions
- Create project structure with folders:
models/- for database modelscontrollers/- for route controllersroutes/- for route definitionsmiddleware/- for custom middleware
- Update package.json with useful scripts:
npm start- runs the server with nodenpm run dev- runs the server with nodemon for development
Generated Project Structure
your-project/
├── package.json
├── server.js
├── controllers/
├── middleware/
├── models/
└── routes/Getting Started with Generated Project
After running vizz-init, navigate to your project and start development:
cd backend # or your custom project name
npm run devYour server will be running at http://localhost:3000
Requirements
- Node.js (version 12 or higher)
- npm
License
MIT
Author
Visalan H
Contributing
Feel free to submit issues and enhancement requests!
*P.S. - This tool exists because I got tired of typing mkdir over and over again.
