express-beginner-starter
v1.1.2
Published
Beginner-friendly Express.js project generator
Maintainers
Readme
express-beginner-starter
A streamlined CLI tool for quickly scaffolding organized, beginner-friendly Express.js projects with best practices built in.
Features
- Instant Project Setup: Generate a complete Express.js application with a single command
- Organized Structure: Pre-configured folder structure following MVC design patterns
- Developer Experience: Hot-reloading development server with nodemon
- Beginner Friendly: Commented code and clear documentation
- Production Ready: Includes error handling, environment configuration, and logging
Requirements
- Node.js 14.x or higher
- npm 6.x or higher
Installation
npm install -g express-beginner-starterQuick Start
Create a new project
npx express-beginner-starter createFollow the interactive prompts
You'll be asked to configure your project with the following options:
- Project name: Enter a valid name for your project folder
- Database: Choose from None, MongoDB, PostgreSQL, or MySQL
- Testing setup: Opt to include testing configuration
- If yes, select either Jest or Mocha as your testing framework
- Authentication: Choose whether to include authentication
- If yes, select from JWT, Passport, or None as your auth method
- Git repository: Initialize a git repository automatically
Start developing
cd your-project-name
npm install
npm run devYour application will be running at http://localhost:3000 (or your specified port)
Project Structure
your-project-name/
├── docs/ # Documentation files
├── public/ # Static files (CSS, JS, images)
├── src/ # Source code
│ ├── config/ # Configuration files
│ ├── controllers/ # Route controllers
│ ├── middleware/ # Custom middleware
│ ├── models/ # Data models
│ ├── routes/ # API routes
│ ├── services/ # Business logic services
│ ├── utils/ # Helper functions
│ ├── app.js # Express application setup
│ └── server.js # Server entry point
├── tests/ # Test files
│ └── app.test.js # Main application tests
├── .env.example # Example environment variables
├── .eslintrc.json # ESLint configuration
├── .gitignore # Git ignore file
├── .prettierrc # Prettier configuration
├── package.json # Project dependencies
└── README.md # Project documentationAvailable Commands
| Command | Description |
|---------|-------------|
| npm run dev | Starts development server with hot-reloading |
| npm start | Starts production server |
| npm test | Runs test suite |
| npm run lint | Checks code style |
Customization
After creating your project, you can easily:
- Add additional middleware
- Connect your preferred database
- Install additional packages
- Configure authentication
Troubleshooting
Common Issues
Port already in use
If you see Error: listen EADDRINUSE :::3000, change the port in your .env file.
Missing dependencies
If you encounter module not found errors, run npm install again.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the Mozilla Public License Version 2.0 - see the LICENSE file for details.
Acknowledgments
- Express.js team for the amazing framework
- All contributors who have helped improve this starter kit
