HTML5, Bulma CSS, JavaScript
A responsive, application which utilizes JS to allow administrators to add, edit, and remove products from the site. It also allows users of the product site to add, remove, and view their cart total.
- Download the full package, select the Code button, choose the "Download ZIP" option.
- Requires Node.js: install Node.js, current version.
- Install dependencies: run script
npm install express nodemon
- express helps run web server
- nodemon auto restarts web server when project file changes
- Bulma CSS framework required
Method | Input Args | Return | Description |
---|---|---|---|
getAll | - | [user] | gets a list of all users |
getOne | id | user | finds the user with the given id |
getOneBy | filters | user | finds one user with the given filters |
create | attributes | null | creates a user with the given attributes |
update | id, attributes | null | updates user with given id using the given attributes |
delete | id | null | delete the user with the given id |
randomId | - | id | generates a random id |
writeAll | - | null | writes all user to a user.json file |
comparePasswords | string, string | boolean | returns true if the passwords match |
Admin Users Sign Up: http://localhost:3000/signup
- Run script
npm run dev
to deploy
- Reuse code from Admin Users Repository Method excluding the comparePasswords method
- See repository.js for code reuse with classes
- Hashing and salting passwords for user security to prevent rainbow table attacks
- Password validator & sanitization with npm express-validator library
- Middleware multer installation needed for accessing uploaded image files
- Run script
npm install multer
in the command line
- Run script
Product List: http://localhost:3000