Skip to content

souravrooj/create-js-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

js-project-generator

A powerful CLI tool to quickly scaffold various JavaScript and TypeScript project structures with best practices and modern tooling.

🎯 What is js-project-generator?

js-project-generator is a command-line tool that helps you create new JavaScript and TypeScript projects instantly. Instead of manually setting up project structures, installing dependencies, and configuring tools like ESLint, Prettier, and testing frameworks, this CLI does it all for you with a single command.

Why use js-project-generator?

  • ⚑ Save Time: Create fully configured projects in seconds
  • πŸ› οΈ Zero Configuration: Everything is pre-configured and ready to run
  • πŸ“š Best Practices: Follows industry standards and conventions
  • 🎨 Modern Tooling: Includes ESLint, Prettier, Jest, and more
  • πŸ”§ Multiple Frameworks: Support for 7 popular project types
  • πŸ“± Cross-Platform: Works on Windows, macOS, and Linux

πŸš€ Features

  • Multiple Project Types: Support for 7 different project types
  • Language Support: JavaScript and TypeScript options (where applicable)
  • Modern Tooling: Pre-configured with ESLint, Prettier, and testing frameworks
  • Best Practices: Follows industry standards and conventions
  • Zero Configuration: Ready-to-run projects out of the box

πŸ“¦ Supported Project Types

Project Type JavaScript TypeScript Description
Node.js βœ… βœ… Basic Node.js server application
Express.js βœ… βœ… Express.js MVC application
Next.js ❌ βœ… Full-stack React framework
React βœ… βœ… React application with Vite
NestJS ❌ βœ… Progressive Node.js framework
Electron βœ… βœ… Cross-platform desktop app
React Native βœ… ❌ Mobile app development

πŸ› οΈ Installation

Global Installation (Recommended)

npm install -g js-project-generator

Local Installation

npx js-project-generator@latest

πŸš€ Quick Start

The easiest way to get started is using the interactive mode:

js-project-generator

This will guide you through the process step by step, asking for:

  1. Project name (e.g., my-awesome-app)
  2. Project type (Node.js, Express, React, etc.)
  3. Language (JavaScript or TypeScript)

Then it creates your project with all the necessary files and configurations!

πŸ“– Usage

Interactive Mode (Easiest)

js-project-generator

This will prompt you for:

  • Project name
  • Project type
  • Language (JavaScript/TypeScript)

Command Line Arguments (Advanced)

If you prefer to specify everything in one command:

js-project-generator <project-name> --type <project-type> --language <language>

Examples

# Create an Express.js project with TypeScript
js-project-generator my-api --type express --language ts

# Create a React project with JavaScript
js-project-generator my-app --type react --language js

# Create a Next.js project (TypeScript only)
js-project-generator my-nextjs-app --type nextjs

# Create a NestJS project (TypeScript only)
js-project-generator my-nest-api --type nest

# Create an Electron app with TypeScript
js-project-generator my-desktop-app --type electron --language ts

# Create a React Native app
js-project-generator my-mobile-app --type react-native

πŸ—οΈ Project Structures

Node.js

project-name/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.js
β”‚   β”œβ”€β”€ app.js
β”‚   β”œβ”€β”€ utils/
β”‚   └── config/
β”œβ”€β”€ package.json
β”œβ”€β”€ .gitignore
└── README.md

Express.js (MVC)

project-name/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ middleware/
β”‚   β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ utils/
β”‚   └── app.js
β”œβ”€β”€ package.json
β”œβ”€β”€ .gitignore
└── README.md

Next.js

project-name/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ layout.tsx
β”‚   β”‚   β”œβ”€β”€ page.tsx
β”‚   β”‚   └── globals.css
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ lib/
β”‚   └── styles/
β”œβ”€β”€ public/
β”œβ”€β”€ next.config.js
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

React (Vite)

project-name/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ styles/
β”‚   β”œβ”€β”€ App.tsx
β”‚   └── main.tsx
β”œβ”€β”€ public/
β”œβ”€β”€ index.html
β”œβ”€β”€ vite.config.ts
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

NestJS

project-name/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ modules/
β”‚   β”œβ”€β”€ dto/
β”‚   β”œβ”€β”€ entities/
β”‚   β”œβ”€β”€ config/
β”‚   └── common/
β”œβ”€β”€ test/
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ nest-cli.json
└── README.md

Electron

project-name/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/
β”‚   β”œβ”€β”€ renderer/
β”‚   └── preload/
β”œβ”€β”€ public/
β”œβ”€β”€ build/
β”œβ”€β”€ package.json
β”œβ”€β”€ electron-builder.json
└── README.md

React Native

project-name/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ screens/
β”‚   β”œβ”€β”€ navigation/
β”‚   β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ utils/
β”‚   └── assets/
β”œβ”€β”€ android/
β”œβ”€β”€ ios/
β”œβ”€β”€ App.js
β”œβ”€β”€ index.js
β”œβ”€β”€ metro.config.js
β”œβ”€β”€ babel.config.js
β”œβ”€β”€ package.json
└── README.md

🎯 What's Included

Each generated project comes with:

  • πŸ“¦ Package.json with appropriate dependencies and scripts
  • βš™οΈ TypeScript configuration (for TS projects)
  • πŸ” ESLint and Prettier configuration for code quality
  • πŸ“ Git ignore file to exclude unnecessary files
  • πŸ“š Comprehensive README with setup instructions
  • πŸ—οΈ Basic project structure following best practices
  • πŸš€ Development scripts (start, dev, build, test, lint)
  • πŸ§ͺ Testing setup with Jest (where applicable)
  • 🎨 Styling configuration (CSS, Tailwind, etc.)
  • πŸ“± Platform-specific configs (for Electron, React Native)

πŸš€ Quick Start Examples

Express.js API (Backend)

js-project-generator my-api --type express --language ts
cd my-api
npm install
npm run dev
# Your API will be running at http://localhost:3000

React App (Frontend)

js-project-generator my-react-app --type react --language ts
cd my-react-app
npm install
npm start
# Your React app will open at http://localhost:3000

Next.js App (Full-stack)

js-project-generator my-nextjs-app --type nextjs
cd my-nextjs-app
npm install
npm run dev
# Your Next.js app will be running at http://localhost:3000

Node.js Server (Simple)

js-project-generator my-server --type nodejs --language js
cd my-server
npm install
npm start
# Your server will be running at http://localhost:3000

πŸ”§ Development

Prerequisites

  • Node.js 14.0.0 or later
  • npm or yarn

Setup (For Contributors)

git clone https://github.com/souravrooj/create-js-project.git
cd create-js-project
npm install
npm run build

For End Users

If you just want to use the tool, simply install it globally:

npm install -g js-project-generator

Available Scripts

  • npm run build - Build the project
  • npm run dev - Run in development mode
  • npm run start - Run the built version
  • npm run test - Run tests
  • npm run lint - Run ESLint
  • npm run format - Format code with Prettier

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support

If you encounter any issues or have questions:

  1. πŸ“‹ Check the Issues page - Your question might already be answered
  2. πŸ› Create a new issue with detailed information about your problem
  3. πŸ’» Include your environment: Node.js version, operating system, and CLI command you used
  4. πŸ“§ Contact directly: Email souravrooj64@gmail.com for urgent issues

Common Issues

  • "Command not found": Make sure you installed the package globally with npm install -g js-project-generator
  • "Permission denied": On Linux/Mac, you might need to use sudo npm install -g js-project-generator
  • "Project directory already exists": Choose a different project name or delete the existing directory

πŸ“§ Contact


Happy coding! πŸŽ‰

About

CLI tool to create various JavaScript/TypeScript project structures

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published