open-index/open-npm huggingface dataset:
npm package: @pushpraj_10/nodejs-backend
Description: A CLI tool to generate production-ready backend API server with Express, TypeScript, MongoDB, and JWT authentication
Author: Pushpraj
Latest version: 2.0.0

# @pushpraj_10/nodejs-backend

⚡ **A CLI tool to instantly generate a production-ready backend API server** with Express, TypeScript, MongoDB, and JWT authentication.

## Features

- 🚀 **Express.js** - Fast, unopinionated web framework
- 📘 **TypeScript** - Type-safe code with modern JavaScript features
- 🔐 **JWT Authentication** - Secure token-based authentication
- 🗄️ **MongoDB** - NoSQL database with Mongoose ODM
- 🔒 **Bcrypt** - Password hashing and security
- 🌐 **CORS** - Cross-Origin Resource Sharing enabled
- 🎯 **Modular Architecture** - Clean separation of concerns
- 🛠️ **CLI Generator** - Scaffold new projects in seconds

## Quick Start

Create a new backend project with one command:

```bash
npx @pushpraj_10/nodejs-backend my-awesome-backend
```

This will:
1. ✅ Create a new folder called `my-awesome-backend`
2. ✅ Copy all the boilerplate code
3. ✅ Install all dependencies automatically
4. ✅ Set up TypeScript, MongoDB, Express, and JWT auth

Then just:

```bash
cd my-awesome-backend
npm run dev
```

🎉 Your backend will be running on `http://localhost:5000`!

## Manual Installation

If you prefer to install it manually:

```bash
npm install @pushpraj_10/nodejs-backend
```

### 1. Environment Setup

Create a `.env` file in your project root:

```env
PORT=5000
MONGODB_URI=mongodb://localhost:27017/backend
JWT_SECRET=your_jwt_secret_key_here
NODE_ENV=development
```

### 2. Run the Server

**Development Mode:**
```bash
npm run dev
```

**Production Build:**
```bash
npm run build
npm start
```

## API Endpoints

### Authentication
- `POST /api/auth/register` - Register a new user
- `POST /api/auth/login` - Login user

### Users (Protected Routes)
- `GET /api/users` - Get all users
- `GET /api/users/:id` - Get user by ID
- `PUT /api/users/:id` - Update user
- `DELETE /api/users/:id` - Delete user

### Health Check
- `GET /health` - Server health status

## Project Structure

```
├── config/           # Configuration files
│   ├── db.ts        # Database connection
│   └── env.ts       # Environment variables
├── middleware/       # Express middleware
├── modules/          # Feature modules
│   ├── auth/        # Authentication module
│   └── users/       # Users module
├── utils/           # Utility functions
├── app.ts           # Express app setup
└── server.ts        # Server entry point
```

## Scripts

- `npm run dev` - Start development server with hot reload
- `npm run build` - Compile TypeScript to JavaScript
- `npm start` - Run production server
- `npm test` - Run tests

## Requirements

- Node.js >= 18.0.0
- MongoDB

## License

MIT

## Author

Pushpraj

---

⭐ Star this package on [npm](https://www.npmjs.com/package/@pushpraj-nodejs-backend) if you find it helpful!