Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

This project serves as en example for NodeJS server that processes HTTP requests and makes ecryption and decryption tasks, as well as saving/editing users in a database.

App Base projects

Prerequisites

  1. Install Node.js
  1. Install these NPM packages globally

    npm install -g bower gulp nodemon

    Refer to these instructions on how to not require sudo

Structure

The structure also contains a gulpfile.js and a server folder. The server is there just so we can serve the app using node. Feel free to use any server you wish.

/src
	/client
		/app
		/content

Installing Packages

When you generate the project it should run these commands, but if you notice missing packages, run these again:

  • npm install
  • bower install

The Modules

The app is divided by entities wich have their own models inside. Configuration folder (config) and utilities folder (utils).

app --> [
     config --> [
         dir.dir.js,
         db.password,
         ...
     ],
     user --> [
        user.controller.js,
        user.model.js,
        ...
     ],
     user_token --> [
        user_token.model.js
        ...
     ]
     core --> [
         model.js,
         controller.js,
         ...
     ],
]

Basic Packages

body-parser: Package for reading JSON objects on request.

simple-encryptor: Package for encrypting passwords into the database

uuid: Package for generating random tokens for user session

node-cron: Package for creating cron schedules wich erase the token database (for now)

Global configuration

In app/config we can found the global variables wich we use in the app.

-port.js = indicates the port where the app is running.

-time.interval.js = indicates the time interval (in minutes) where the token database is cleared.

-db.dir = indicates the direction of the database.

-db.password = indicates the password of the database.

-db.username = indicates the username of the database.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages