Dynamic property management app
Bryan Castleman | Nicholas Nooch |
---|
Using the sequelize node module, models (tables) in the database were defined using sequelize.define('name', {attributes}, {options}) with appropriate DataTypes, Class Methods and Associations. Querying and accessing the database for CRUD (create, read, update, destroy) operations was executed via the Controller.
Tables | Associations | Add'l Associations/Methods |
---|---|---|
User | Instance Valid Password | |
WorkOrder | belongsTo(models.Tenant) | belongsTo(models.Contractor) |
Tenant | hasMany(models.WorkOrder) | |
Contractor | hasMany(models.WorkOrder) | |
Prospect | ||
Applicant |
Handlebars were implemented to dynamically generate views routed through the Controller. Partials, along with built-In Helpers of each, if and unless allowed specific delivery of blocks of code depending on routes.
The Controller determines the appropriate action method to handle requests from the server. A multitude of HTTP requests for the manager functionality alone were needed to create, view, edit and delete data:
GET Contractors
POST Prospects
PUT WorkOrders
A registration form is delivered at the /signup path which validates password by using regex. The Manager Login form is delivered via a modal, which authenticates user login by checking for existing username in the database (User model).
'''npm install'''
''' npm run devstart '''
visit http://localhost:8080/
rs to restart server manually, but it should be restarting on file change locally
or npm start
debugging nodemon --inspect app.js