Check the file at the root of the project package.json for the dependencies used in the project
npm install or yarn install
cd /server
node server.js
cd /server
nodemon server.js
Two packages were used for SQL database,they are ORMs, sequelize and pg modules.
in /config/config.json
Change the credentials to those in your database mysql.
In .env file
Change the credentials to those in your database mongodb.
Change to your collection name.
Module ORM Mongoose.
In /server/roles.js
We can configure the access level rules per user.
Roles such as Admin and Manager may have system privileges.
Use two-factor authentication for node.js.Speakeasy in Google Authenticator.
2FA in a Node.js API with time-based one-time passwords.
Use two-factor authentication for node.js.Authy npm module in Authy app 2fa.
Use two-factor authentication for node.js.Twilio npm module in SMS 2fa.
Automated Email Sending Provider.
Create your sendgrid account, customize your private API key.
Add the you private key to the .env file at SENDGRID_API_KEY.
Provider of free APIs for realtime and historical data on stocks, forex (FX), and digital/crypto currencies.
Create your alphavantage account,customize your private API key.
Add the you private key to the .env file.
Use email verification token for password re-registration.
Use email verification token 2fa login or other verification.
x-access-token Header: JWT Authentication
content-Type: application/x-www-form-urlencoded or application/json
post ('/signup')
Headers
Content-Type = application/x-www-form-urlencoded
Body
email = [email protected]
password = 2321
role = admin
Register with your email and password details
Change the "role" rule to basic, or anyone can register as an admin.
In the server/controllers file userController change line 85 to:
const newUser = new User ({email, password: hashedPassword, role: "basic"});
Now only admin can on route:
post ('/signupadmin')
register user levels:
admin,supervisor,basic,final_user.
Using the pm2 tool
Command installing globally:
sudo npm install pm2 -g
Inside of the directory /server folder root project, run the command:
Install Application:
npm or yarn install
PM2 command start:
pm2 start server.js
Cluster mode:
pm2 start server.js -i max
Persistence mode command:
pm2 startup
Save and Finish:
pm2 save
The reverse proxy system can be implemented with Nginx as an infrastructure.
- Procfile configuration Heroku Hosting Service.
PentestLab testing tools for attacks and vulnerabilities.
NoSql
XSS
Authentication standards
encryption and salt
httponly cookies
Oauth