Giter VIP home page Giter VIP logo

real_estate_rental_system's Introduction

Real Estate Rental System - M3

a Sails v1 application

Links

Version info

This app was originally generated on Fri Oct 11 2019 00:36:56 GMT+0800 (Hong Kong Standard Time) using Sails v1.2.3.

Why

A JavaScript runtime environment + Over 700k reusable packages/modules

  • Sails.js

    • is designed to resemble the MVC architecture from frameworks like Ruby on Rails.
    • is built on Node.js, uses Express for handling HTTP requests.
    • bundles a powerful ORM, Waterline, which provides a simple data access layer that just works, no matter what database you use.
  • Sails MVC

    • img

Startup

Normal way:

sudo npm install -g sails
npm install

On windows with vscode, add:

 set-ExecutionPolicy RemoteSigned
sails lift

Doing

  • Bootstrap template engine
    • see layout.ejs file under api/views/layouts.
  • Loading initial testing data
    • see bootstrap.js, located under the config folder.
  • Routes Setting
    • see routes.js
    • Sample
     'DELETE /Apartment/:id': 'ApartmentController.delete',
     'GET /Apartment/Update/:id': 'ApartmentController.update',
     'POST /Apartment/Update/:id': 'ApartmentController.update',
     'GET /Apartment/Search/?': 'ApartmentController.search',
     'GET /Apartment/Detail/:id': 'ApartmentController.detail',
     'GET /Apartment/Home/': 'ApartmentController.home',
     'GET /User/Login': 'UserController.login',
     'POST /User/Login': 'UserController.login',
     'POST /User/Logout': 'UserController.logout',
    
     'GET /Apartment/:id/rentedBy': 'ApartmentController.populate',
     'GET /user/:id/rents': 'UserController.populate',
     'GET /user/:id/rents/add/:fk': 'UserController.add',
     'GET /user/:id/rents/remove/:fk': 'UserController.remove',
    
     'POST /file/upload/attachment': 'FileController.uploadAttachment'
    
  • api
    • under ./api
    • Input Validation - Server-side
    • Redirection
  • AJAX
    • Sample
          async function submitForm(oFormElement) {
              var response = await fetch(oFormElement.action, {
                  method: oFormElement.method,
                  credentials: 'same-origin',
                  body: new FormData(oFormElement)
              });
              if (response.ok) {
                  var data = await response.json();
                  alert(data.message);
                  window.location = data.url;
              } else if (response.status == 401) {
                  var data = await response.text();   // for res.send()
                  alert(data);
              } else {
                  alert(response.statusText);
              }
          };
      
      • Login and Session
        • Under ./api/controller/usercontroller
        • By Postmanimage
      • Encrypting Password
        • with the bcrypt.js library
      • Model Association

CRUD

Homepage

image image

Createpage

image

Searchpage

image

Updatepage

image

Detailpage

image

AdminPage

image

What need to do next

  • Mobile App with NativeScript-Vue

real_estate_rental_system's People

Contributors

scorpi0on avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.