Buying items that is in Sims style that is clickable and can buy items like a mall setting. You can go to one store and the store will upload the item or the goods then you can buy it. New experience in buying items.
- Run
npm install
at folder (do ONLY if first time running app) - Run
node populate.js
at folder - Run
node index.js
at folder - In terminal, click the link
http://localhost:3000
(or something similar) to launch the app
- controllers - This folder contains files which defines callback functions for client requests. One controller for one .hbs file (one controller for one webpage)
- models - This folder contains files for database modeling and access.
- public- This folder contains static assets such as css, js, and image files.
- routes - This folder contains files which describes the response of the server for each HTTP method request to a specific path in the server.
- views - This folder contains all hbs files (the webpages) to be rendered when requested from the server.
- index.js - The main entry point of the web application.
- Create
.hbs
file for the webpage at views folder- CSS styles should be at public/css folder, images at public/images folder
- Use
.html
instead of.hbs
if you want to preview how it looks first (change to .hbs later) - For page elements reused across different webpages, put it at views/partials folder instead (eg. menu bars)
- Create a
controller.js
file for the webpage at controllers folder (eg.loginController.js
forlogin.hbs
)- In this controller file, add all necessary functions for the webpage
- You can also put functions for the webpage at the public/js folder
- For every function at your
controller.js
, add them toroutes.js
in routes folder- If function uses GET, use app.get(); if POST, use app.post()