create-visyadav-app
v1.0.9
Published
[](https://badge.fury.io/js/your-package-name) [](https://opensource.org/licenses/MIT)
Readme
AuthCraft - Suggests crafted authentication solutions
A Node.js authentication boilerplate with Express, MongoDB, and optional integrations like Cloudinary and payment gateways.
Installation
To create a new project, use the following command instead of installing the package globally:
npx create-visyadav-appFeatures
- ✅ Complete authentication system (register, login, logout)
- ✅ Email verification with nodemailer
- ✅ Password reset functionality
- ✅ JWT-based authentication
- ✅ Cookie-based session management
- ✅ Mongoose models and database connection
- ✅ Optional integrations:
- Cloudinary for image uploads
- Razorpay/Stripe for payments
- Socket.io for real-time features
Installation
Quick Start
Create a new project:
npx create-visyadav-appFollow the interactive prompts to configure your project.
After generation:
cd your-project-name
npm installSet up your environment variables in .env:
PORT=4000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
[email protected]
SMTP_APP_PASSWORD=your_app_password
# For Cloudinary:
CLOUDINARY_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_SECRET_KEY=your_secret_key
# For Razorpay:
RAZORPAY_KEY_ID=your_key_id
RAZORPAY_KEY_SECRET=your_key_secretStart the development server:
npm run devAPI Endpoints
Authentication
POST /api/v1/auth/sign-up- User registrationPOST /api/v1/auth/verify-email- Email verificationPOST /api/v1/auth/sign-in- User loginPOST /api/v1/auth/logout- User logoutPOST /api/v1/auth/forget-password- Request password resetPOST /api/v1/auth/reset-password/:resetToken- Reset passwordGET /api/v1/auth/check-auth-user- Get authenticated user dataGET /api/v1/auth/check-token- Check if valid token existsGET /api/v1/auth/get-all-user- Get all users (admin)
Configuration
The generator creates a project with the following structure:
your-project/
├── connectDB/ # Database connection
├── controllers/ # Route controllers
├── generateToken/ # JWT token generation
├── middleware/ # Authentication middleware
├── models/ # Mongoose models
├── nodemailer/ # Email templates and sending
├── routes/ # API routes
├── utils/ # Utility functions (if Cloudinary enabled)
├── .env # Environment variables
├── index.js # Main application file
└── package.jsonAvailable Scripts
npm run start # Start the production server
npm run dev # Start the development server with nodemonDependencies
- Express.js - Web framework
- Mongoose - MongoDB ODM
- jsonwebtoken - JWT authentication
- bcryptjs - Password hashing
- nodemailer - Email sending
- cookie-parser - Cookie handling
- dotenv - Environment variables
- cors - Cross-origin resource sharing
- (Optional) cloudinary - Image uploads
- (Optional) razorpay/stripe - Payment processing
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
