Skip to content

Software solution (web application) for Krafts by Kat, an online retail business founded in 2017 that provides customized corporate giveaways to clients

Notifications You must be signed in to change notification settings

memgonzales/krafts-by-kat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Krafts by Kat

badge badge badge badge badge badge badge badge badge

--- THIS PROJECT IS A WORK IN PROGRESS ---

This project is a software solution (web application) for Krafts by Kat, an online retail business founded in 2017 that provides customized corporate giveaways to clients. It is the major course output in an introduction to software engineering class.

The deployed website can be accessed through this link: http://krafts-by-kat.herokuapp.com.

A detailed walkthrough of the features is provided in this video.

Project Structure

The project consists of the following folders:

Folder Description
.vscode Contains the configuration files used by Visual Studio Code's built-in debugger
controllers Contains the JavaScript files that define callback functions for client-side requests
helpers Contains the JavaScript files that define helper functions for front-end display and server-side validation
misc Contains the JavaScript files for initial database population
models Contains the JavaScript files for database modeling (schemas) and access
public Contains the static CSS and JavaScript files, as well as the project assets (image files), for front-end display
routes Contains the JavaScript file that defines the server response to each HTTP method request
test Contains the JavaScript files that define the utility functions and scenarios for the automated unit tests
views Contains the Handlebars template files to be rendered and displayed upon request

It also includes the following files:

File Description
package-lock.json and package.json Store information on the project dependencies
index.js Entry point of the web application
Procfile Specifies the commands that are run by the app on startup (Heroku)

Entity Relationship Diagram

The entity relationship diagram to illustrate the schemas can be viewed here.

Running the Application

Running on the Web

Open the following website: http://krafts-by-kat.herokuapp.com.

Running Locally

  1. Before running the application locally, the following software have to be installed:

    Software Description Download Link License
    Node.js JavaScript runtime built on Chrome's V8 JavaScript engine https://nodejs.org/en/download/ MIT License
    git (optional) Distributed version control system https://git-scm.com/downloads GNU General Public License v2.0
  2. Create a copy of this repository:

    • If git is installed, type the following command on the terminal:

      git clone https://github.com/memgonzales/krafts-by-kat
      
    • If git is not installed, click the green Code button near the top right of the repository and choose Download ZIP. Once the zipped folder has been downloaded, extract its contents.

  3. On the main project directory, run the following command to install the dependencies:

    npm install
    

    If the command is executed successfully, the dependencies will be installed into the folder node_modules following the dependency tree found in package-lock.json.

The project uses a pre-populated remote database. DO STEPS 4 AND 6 ONLY AFTER A DATABASE RESET OR MIGRATION TO A LOCAL DATABASE.

  1. Run the following commands to populate the database with the necessary collections:

    node misc/populate_display.js
    node misc/populate_client.js
    node misc/populate_business_owner.js
    
  2. Run the following command to run the server:

    node index.js
    
  3. Upload the logo of Krafts by Kat through the file input field found on the following page:

    http://localhost:3000/uploadsTest
    
  4. Open the web application by accessing the following link on a browser:

    http://localhost:3000
    
    Homepage

Credentials (For Testing Only)

To log in as an administrator, enter the following credentials:

  • Username: kraftsbykatadmin
  • Email Address: krafts.by.kat.webmaster@gmail.com
  • Password: ASDFGHJKL123;

To log in as a customer, enter the following credentials:

  • Username: shibaichi (or akitani)
  • Email Address: kentaroshiba@gmail.com (or wolfdog@gmail.com)
  • Password: ASDFGHJKL123; (same password for both test accounts)

Testing the Application

The software development team uses Visual Studio Code as its integrated development environment. It is also employed by the developers for the purposes of addressing syntax errors, refactoring code, and stepping it through a debugger prior to checking into the repository.

Automated Testing

Aside from manual integration testing, automated unit tests were also performed in light of the test-driven development methodology. The steps for running the automated unit tests are as follows:

  1. Ensure that the necessary development dependencies (enumerated in the next section) have been installed. Otherwise, run the following command to install them:

    npm install --only=dev
    
  2. Before running the automated tests, terminate the server, alongside any running instance of the app.

  3. Run the following command in the terminal to begin the automated testing:

    npm run test
    

Dependencies

This project uses the following production dependencies:

Package Version Description License
bcrypt 5.0.1 Package for hashing passwords Apache License 2.0
body-parser 1.19.0 Package for parsing incoming requests in a middleware before the handlers MIT License
connect-mongo 3.2.0 MongoDB session store for Connect and Express MIT License
dotenv 10.0.0 Package for loading environment variables from an .env file BSD 2-Clause "Simplified" License
express 4.17.1 Unopinionated and minimalist framework for Node.js MIT License
express-handlebars 5.3.2 Handlebars view engine for Express BSD 3-Clause "New" or "Revised" License
express-session 1.17.1 Session middleware for Express MIT License
express-validator 6.10.1 Express middleware for validator, a library of string validators and sanitizers MIT License
gridfs-stream 1.1.1 Package for streaming files to and from MongoDB GridFS MIT License
hbs 4.1.2 Express view engine for Handlebars MIT License
jquery 3.6.0 Fast, small, and feature-rich JavaScript library MIT License
mongodb 3.7.1 Official MongoDB driver for Node.js Apache License 2.0
mongoose 5.13.9 MongoDB object modeling tool designed to work in an asynchronous environment MIT License
multer 1.4.2 Middleware for handling multipart/form-data, primarily used for file uploads MIT License
multer-gridfs-storage 4.2.0 GridFS storage engine for Multer to store uploaded files directly to MongoDB MIT License
no-cache 3.0.1 Middleware for setting some HTTP response headers to try to disable client-side caching MIT License
nodemailer 6.6.0 Package for sending emails with Node.js MIT License

The following table lists the development dependencies:

Package Version Description License
@types/jsdom 16.2.13 Contains type definitions for JSDom MIT License
chai 4.3.4 Behavior- and test-driven development assertion library for Node.js MIT License
chai-http 4.3.0 HTTP integration testing with Chai assertions MIT License
chai-jquery 2.1.0 Extension to the chai assertion library that provides a set of jQuery-specific assertions MIT License
jsdom 17.0.0 Pure-JavaScript implementation of many web standards, notably the WHATWG DOM and HTML Standards, for use with Node.js MIT License
mocha 9.1.1 Simple and flexible JavaScript test framework for Node.js and the browser MIT License
mocha-jsdom 2.0.0 Test frontend libraries in the console using Node.js, Mocha and JSDom. MIT License
mockgoose 8.0.4 Provides test database by spinning up mongod on the back when mongoose.connect call is made MIT License
nyc 15.1.0 Istanbul's state of the art command line interface with support for applications that spawn subprocesses ISC License

This project also imports the following design-related toolkits:

Toolkit Version Description License
Bootstrap 5.0.2 Front-end toolkit featuring Sass variables and mixins, responsive grid system, prebuilt components, and JavaScript plugins MIT License
Font Awesome 5.15 Front-end toolkit featuring vector icons and social logos CC BY 4.0 License (Icons)
SIL OFL 1.1 License (Fonts)
MIT License (Code)

Built Using

This project follows the Model-View-Controller (MVC) architectural pattern. In light of separation of concerns, the key technologies used are:

  • Database: MongoDB as the database program and Mongoose as the object data modeling tool
  • Back-end: Node.js as the server environment and Express.js as the back-end framework
  • Front-end: Handlebars as the template engine

Server-side validation is performed via Express Validator and Multer (for files).

This web application is deployed on the cloud platform Heroku. Since Heroku has an ephemeral filesystem, GridFS is used for the persistent storage of files.

Contributing

Kindly refer to this page for the documents and the guidelines on contributing to this repository. These include the Coding Standards, Repository Guidelines, and Integration Procedure.

Software Development Team

  • Julianne Felice G. Cruz, Quality Assurance
  • Sabrina Mykel C. Dela Cruz, Product Owner
  • Mark Edward M. Gonzales, Developer
  • Hylene Jules G. Lee, Developer
  • Francesca Yzabel A. Mendoza, Quality Assurance
  • Francheska A. Roque, Scrum Master
  • Ralph Matthew H. Sanson, Designer

About

Software solution (web application) for Krafts by Kat, an online retail business founded in 2017 that provides customized corporate giveaways to clients

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published