oakjoao / serverAppNodejs

Server simulator app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Server simulator built with Nodejs, JavaScript, HTML, CSS and MongoDB as Database

The project is deployed to Heroku, you can find it here:

https://shielded-shore-87531.herokuapp.com/servers

How to run it:

Set up your node environment, donwload the project and run in the console node app.js, make sure you have installed mongoDB

How this project is structured:

The goal is to build an application that can be flexible enough to do full CRUD with authentication/authorization and simulate server management. The folders are divided by definition and purpose:

Logs: You will find a file called log.js that it's used for log configuration along with Winston package(npm). It's standard configuration and can be modified at your will to show more information on log file.

Models:

  • server.js: responsible for setup the schema for the server creation and associate it with user creation.
  • user.js: responsible for setup the schema for the user creation and associate it with server creation.

Public/stylesheets: You will find a file called app.css responsible for the style for all the pages and it's linked in the header file

Routes:

  • server.js: Contain all the CRUD (Create, Remove, Delete, Edit and Update) routes and logic.
  • index.js: Contain all the Authorization routes (Login, Logout, Register) routes and logic

Views:

  • Partials: Inside partials are the header and footer ejs files, responsible for the html+js to header and footer in all pages. In the header you will find buttons to go to the root (Home), to add new Server (New Server), Login, Register and Logout, depending on what you are going to do first.
  • edit.ejs: Responsible for the edit page layout and logic.
  • index.ejs: Responsible for the index page (first page/main page) layout and logic.
  • login.ejs: Responsible for the login form layout and logic.
  • new.ejs: Responsible for the new form (new server creation) layout and logic.
  • register.ejs: Responsible for the register page layout and logic.
  • show.ejs: Responsible for the show page (show particular server) layout and logic.

app.js: Main js file, responsible for run the app and require all the pakcages (npm) that we use and link all the other js(s) files.

mylogfile: Standard log file. Can be modified to add new information.

package.json: Contains information about the project.

About

Server simulator app


Languages

Language:HTML 50.9%Language:JavaScript 47.6%Language:CSS 1.5%