npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mobiweb-nodejs-modules

v1.0.9

Published

Basic Node Js Modules

Downloads

64

Readme

Mobiweb Node.Js Modules

Mobiweb basic modules utilities for node.js

Installation

npm

npm install mobiweb-nodejs-modules

git

git clone https://github.com/soravmobi/mobiweb-nodejs-modules.git

npmjs

https://www.npmjs.com/package/mobiweb-nodejs-modules

Usage

Basic modules like user signup, verify account, login, social login, frogot password, reset password & other modules also.

  • First Import SQL file, into your MySQL database.
var mobiweb = require('mobiweb-nodejs-modules');

config -> constant.js

  • Here we are managing all constants like database table name, defualt messages, notifiction details, site limitations etc.

custom (helpers) -> custom.js

  • Here we are managing all custom functions like user authorization, create image thumbnail, unlink file, get user profile, also having other functions also.

model (DB queries) -> model.js

  • Here we are managing all database queries, no need to write whole query only need to put table name, where conditions, order by, order fields other functionality also.

For Signup

app.post('/user/signup', function (req,res) {
    mobiweb.userSignup(req,res);
});


#### Required Parameters

* userFirstName   - [FIRST NAME]
* userLastName    - [LAST NAME]
* userEmail       - [UNIQUE EMAIL ID]
* userPassword    - [MD5 - ALPHA NUMERIC & 1 SPECIAL CHARACTER LIKE - Mobiweb@123]
* userGender      - [MALE,FEMALE,OTHER]
* userDOB         - [Y-M-D Format]
* userDeviceToken - [USER DEVICE TOKEN]
* userDeviceType  - [ANDROID,IOS]
* userDeviceId    - [UNIQUE DEVICE ID]

#### Note:- A temporary verification code will send on registered email id.

For Login

app.post('/user/login', function (req,res) {
    mobiweb.userLogin(req,res);
});


#### Required Parameters

* userEmail       - [UNIQUE EMAIL ID]
* userPassword    - [MD5 - ALPHA NUMERIC & 1 SPECIAL CHARACTER LIKE - Mobiweb@123]
* userDeviceToken - [USER DEVICE TOKEN]
* userDeviceType  - [ANDROID,IOS]
* userDeviceId    - [UNIQUE DEVICE ID]

To Verify Account

app.post('/user/verify-account', function (req,res) {
    mobiweb.verifyAccount(req,res);
});


#### Required Parameters

* userTempCode        - [6 digit temporary code]
* userLoginSessionKey - [User loggedin sesssion key]

To re-send account verification code

app.post('/user/resend-account-verification-code', function (req,res) {
    mobiweb.resendAccountVerificationCode(req,res);
});


#### Required Parameters

* userLoginSessionKey - [User loggedin sesssion key]

To forgot password

app.post('/user/forgot-password', function (req,res) {
    mobiweb.forgotPassword(req,res);
});


#### Required Parameters

* userEmail - [UNIQUE EMAIL ID]

To verify user forgot password code

app.post('/user/verify-forgot-password-code', function (req,res) {
    mobiweb.verifyForgotPasswordCode(req,res);
});


#### Required Parameters

* userTempCode        - [6 digit temporary code]
* userLoginSessionKey - [User loggedin sesssion key]

To re-send forgot password code

app.post('/user/resend-forgot-password-code', function (req,res) {
    mobiweb.resendForgotPasswordCode(req,res);
});


#### Required Parameters

* userLoginSessionKey - [User loggedin sesssion key]

To reset user password

app.post('/user/reset-password', function (req,res) {
    mobiweb.resetPassword(req,res);
});


#### Required Parameters

* userLoginSessionKey,newPassword,confirmPassword

To user contact us

app.post('/user/contact-us', function (req,res) {
    mobiweb.contactUs(req,res);
});


#### Required Parameters

* contactName,contactPhone,contactEmail,contactMessage

To get user profile details

app.post('/user/view-profile', function (req,res) {
    mobiweb.viewProfile(req,res);
});


#### Required Parameters

* userLoginSessionKey

To update user profile

app.post('/user/update-profile', function (req,res) {
    mobiweb.updateProfile(req,res);
});


#### Required Parameters

* userLoginSessionKey,userFirstName,userLastName,userGender,userDOB,userCountry,userCity,userAddress,userLatitude,userLongitude

To upload user profile & cover images

app.post('/user/upload-user-image', function (req,res) {
    mobiweb.uploadUserImage(req,res);
});


#### Required Parameters

* userLoginSessionKey,userFile,fileUploadType (PROFILE_IMG,PROFILE_IMG)

#### Note:- Will also generate image thumbnail.

To change user password

app.post('/user/change-password', function (req,res) {
    mobiweb.changePassword(req,res);
});


#### Required Parameters

* userLoginSessionKey,oldPassword,newPassword,confirmPassword

lib -> notification.js

  • Here we are managing Android & IOS mobile app push notification.

To Send Push Notification

var appRoot  = require('app-root-path');
var notification = require(appRoot + '/lib/notification.js');

#### For Android (FCM) :-

notification.sendAndroidNotification(userDeviceToken,userMessage,extraParams);

#### For IOS (APNS) :-

notification.sendIOSNotification(userDeviceToken,userMessage,userBadges,extraParams);

#### For Both Android & IOS (FCM + APNS) :-

notification.sendPushNotifications(userMessage,userId,extraParams);

Note:- sendPushNotifications() method is used to send notification on multiple devices, for example if same user logged in on Android & IOS device then notification will fire on all logged in devices.

Last Activity Management (Session - For Security)

Now we are saving user last activity date time in database, if last activity date time is 6 or more then 6 hours old, then session will expired & automatically login session key will changed, a new login session key will allocate for that user. We can also change this session limit from constant file using "session_limit" constant.