Gathering detailed insights and metrics for create-nodeapi-backend
Gathering detailed insights and metrics for create-nodeapi-backend
Gathering detailed insights and metrics for create-nodeapi-backend
Gathering detailed insights and metrics for create-nodeapi-backend
npm install create-nodeapi-backend
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1# create-nodeapi-backend 2 3A simple boilerplate for quickly setting up a Node.js API with Express, MongoDB, JWT authentication, and more. This tool will help you generate a fully functional backend with minimal configuration. 4 5## Features 6 7- **Express.js**: RESTful API with Express for handling routes and middleware. 8- **MongoDB**: Integration with MongoDB using Mongoose for database management. 9- **JWT Authentication**: User authentication using JSON Web Tokens (JWT). 10- **Nodemailer**: Send emails via SMTP with Nodemailer. 11- **Firebase Integration**: Firebase setup for cloud functions and storage. 12- **Node-cron**: Task scheduling with cron jobs. 13- **Google OAuth**: Sign in with Google using OAuth 2.0. 14- **Serverless Support**: Preconfigured for deployment on Vercel or any serverless platform. 15- **Validation**: Using Joi for input validation. 16 17--- 18 19## How to Install 20 211. **Create a New Project:** 22 23 ```bash 24 npx create-nodeapi-backend@latest
Navigate to the Project Folder:
1cd your-project-folder
✅ Do not run
npm install
— dependencies are already installed during setup.
Setup Environment Variables
1cp .env.sample .env
Edit .env
with your credentials.
1npm run dev
Visit: http://localhost:3010
1npm run build 2npm start
http://localhost:3010/v1/googleOauth/google/callback
1vercel --prod
Run the full authentication and user flow test suite:
1npm test
Tests include:
POST /v1/auth/sign-up
Registers a new user.
Payload:
1{ 2 "email": "user@mail.com", 3 "password": "Password123!", 4 "profileName": { 5 "firstName": "John", 6 "lastName": "Doe" 7 } 8}
Response: 201 Created
1{ 2 "message": "OTP Sent to your email", 3 "data": { 4 "id": "userId", 5 "email": "user@mail.com", 6 "token": { "access": "...", "expiresIn": 2592000 } 7 } 8}
POST /v1/auth/sign-in
Logs in the user.
Payload:
1{ 2 "email": "user@mail.com", 3 "password": "Password123!" 4}
Response: 200 OK
or 203 Non-Authoritative Information
1{ 2 "message": "Login Successful, Please Verify your account", 3 "data": { "id": "...", "email": "...", "token": { "access": "...", "expiresIn": 2592000 } } 4}
GET /v1/otp/resend
Headers:
Authorization: Bearer <token>
Response: 201 Created
1{ "message": "OTP sent to your mail" }
POST /v1/otp/verify
Payload:
1{ "otpCode": 123456 }
Headers:
Authorization: Bearer <token>
Response: 200 OK
1{ "message": "VERIFIED" }
GET /v1/user
Headers:
Authorization: Bearer <token>
Response:
1{ 2 "data": { 3 "_id": "...", 4 "email": "user@mail.com", 5 "profile": { 6 "firstName": "...", 7 "lastName": "...", 8 "displayName": "..." 9 }, 10 "profileImages": { 11 "avatar": "url" 12 }, 13 "address": { 14 "country": "...", 15 "state": "...", 16 "city": "..." 17 } 18 } 19}
PATCH /v1/user
Payload:
1{ 2 "profileInfo": { 3 "firstName": "John", 4 "lastName": "Doe", 5 "displayName": "Johnny" 6 }, 7 "avatar": "https://...", 8 "address": { 9 "country": "USA", 10 "state": "NY", 11 "city": "Brooklyn" 12 } 13}
Headers:
Authorization: Bearer <token>
Response:
1{ "message": "User successfully updated." }
POST /v1/password/forgot
Payload:
1{ "email": "user@mail.com" }
Response:
1{ "message": "Password reset link sent to your email" }
PUT /v1/password/update
Change password with old password.
Payload:
1{ 2 "oldPassword": "OldPass123", 3 "newPassword": "NewPass456" 4}
Headers:
Authorization: Bearer <token>
Response:
1{ "message": "Password updated successfully" }
PATCH /v1/password/reset
Use reset token to change password.
Payload:
1{ 2 "token": "<reset_token>", 3 "newPassword": "NewPassword456" 4}
Response:
1{ "message": "Password reset successfully" }
MIT License. See the LICENSE file for details.
No vulnerabilities found.
No security vulnerabilities found.