Code Monkey home page Code Monkey logo

online-market's Introduction

edX

GitHub GitHub language count GitHub top language

Online Market

Description

This repository has a web application that uses Node.js along with the express and sequelize packages in order to provide an e-commerce back-end for the client. It has multiple valid JS (ES6) files and SQL files; the server.js file contains the sync() method from sequelize for running the application, and the schema.sql file contains the setup for the SQL database.

  • Node.js External Command Line Interface Module sequelize, used to connect to the database, close the connection, test if the connection works, all while logging to the console every SQL query it performs.

Table of Contents

Installation

git clone https://github.com/ktortolini/online-market.git
cd online-market
npm install

The client should make sure to use source within their own MySQL server (after logging in with their credentials) to set up the initial database contained in schema.sql.

Usage Information

After the client clones the repository, changes to the appropriate directory and makes sure they have the appropriate dependencies, they may type the following in the terminal:

npm start

or

npm run watch

The client will be presented with a notification that the port has been opened indicating that the application has started and is running.

MainScreenshot

To organize the store-front there are various classes that exist like Category, Product, ProductTag, and Tag for storing the merchandise. For example, the Category model was written in JS, according to the provided instructions, with the following code snippet:

// defines the 'id' and 'category_name' columns
id: {
	type: DataTypes.INTEGER,
	allowNull: false,
	primaryKey: true,
	autoIncrement: true,
},
category_name: {
	type: DataTypes.STRING,
	allowNull: false,
},

Then there are various routes for CRUD operations like Create, Read, Update, and Delete when handling the merchandise. For example, if the client wants to create a new tag for their products, they may use the Tag model and call the post route, which is written in JS with the following code snippet:

// creates an async post route to await the create() method
router.post('/', async (req, res) => {
	// starts a try ... catch block
	try {
	// creates a variable to store the result of create() method
		const tagData = await Tag.create(req.body);
		res.status(200).json(tagData);
	} catch (err) {
	// responds with a status code 500 if there is an error
		res.status(500).json(err);
	}
});

This summarizes the general functionality of this application, but there are some more details provided in the workflow video below. Any client would be able to use this enjoyable back-end and exciting application for their e-commerce needs. Looking forward to the next challenge. ๐Ÿค“๐Ÿ“

Testing

There are no testing guidelines for this project.

Contributing

There are no contribution guidelines for this project.

Credits

First, the EDX readme file icon on the top was made by Ileriayo with a link provided below: https://github.com/Ileriayo/markdown-badges#badges.

Lastly, parts of the HTML, CSS, and JS code were created with knowledge gained through EDX, as part of their comprehensive Full Stack Web Development online program. In addition, I made use of tutoring available through the same program, working with Andrew Hardemon to fix and double check the routes. To learn about the online program from EDX visit the link here: https://www.edx.org/learn/full-stack-development.

Workflow Video

The workflow video is no longer available.

License

Persistent Notes is licensed under an MIT License.

Questions

Contact the author ktortolini via email โœ‰ [email protected].

Archived

This repository is now archived with a grade of 100/100.

online-market's People

Contributors

ktortolini avatar

online-market's Issues

Postman & Insomnia

Create a new video that explores both Insomnia and Postman and how to use both.

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.