{"id":19797656,"url":"https://github.com/samantha-ruth/e-commerce-back-end","last_synced_at":"2026-04-11T02:01:48.369Z","repository":{"id":42456791,"uuid":"510749340","full_name":"Samantha-Ruth/E-commerce-Back-End","owner":"Samantha-Ruth","description":"Back end of an e-commerce site. Built using javascript, Express, SQL, MySQL2, and Sequelize.","archived":false,"fork":false,"pushed_at":"2022-10-01T21:07:11.000Z","size":681,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T16:33:14.151Z","etag":null,"topics":["expressjs","javascript","mysql","mysql2","nodejs","sequelize","sql"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Samantha-Ruth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-05T13:31:44.000Z","updated_at":"2022-10-01T21:06:20.000Z","dependencies_parsed_at":"2023-01-19T01:46:06.474Z","dependency_job_id":null,"html_url":"https://github.com/Samantha-Ruth/E-commerce-Back-End","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Samantha-Ruth/E-commerce-Back-End","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samantha-Ruth%2FE-commerce-Back-End","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samantha-Ruth%2FE-commerce-Back-End/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samantha-Ruth%2FE-commerce-Back-End/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samantha-Ruth%2FE-commerce-Back-End/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Samantha-Ruth","download_url":"https://codeload.github.com/Samantha-Ruth/E-commerce-Back-End/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samantha-Ruth%2FE-commerce-Back-End/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262357554,"owners_count":23298463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expressjs","javascript","mysql","mysql2","nodejs","sequelize","sql"],"created_at":"2024-11-12T07:26:12.497Z","updated_at":"2026-04-11T02:01:48.273Z","avatar_url":"https://github.com/Samantha-Ruth.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# E-commerce-Back-End\n\n## Description\n\nThis project uses a combination of express.js, SQL, mysql2, and Sequelize to create the back end of a simple ecommerce site.\n\nThis project introduced me to Sequelize.  I learned about creating databases using constructor Models, seeding them from the command line, and accessing the data stored within the models through API routes. I also learned about a JOIN table and how to create JOINS using the Sequelize language \"includes\".   \n\nScreen Shot of Model:\n![Example of Model](https://user-images.githubusercontent.com/64170123/177802948-6f2e7e47-6988-420e-a27e-203edfa01a8c.jpg)\n\n\nScreen Shot of associations:\n![Example of associations](https://user-images.githubusercontent.com/64170123/177802990-cb88fabb-b1ea-4f42-a69c-381ad454a102.jpg)\n\n## Table of Contents\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [Links](#links)\n* [Questions](#questions)\n\n## Installation\n\nIf the user already has node installed on their device, they can download this project and run \"npm init\" and then \"npm i express sequelize mysql2 dotenv\" to download the required dependencies (express.js, Sequelize, MySql2, and .env respectively).  In order to access the mysql2 shell,  they would need to create a .env file with the following, replacing \u003cusername\u003e and \u003cuser password\u003e with the users own username and password: \n  \nDB_NAME=ecommerce_db\n\nDB_USER= \u003c username \u003e\n\nDB_PASSWORD= \u003c user password \u003e\n\n\nTo ensure the user is connected to the correct database, navigate to the root folder of the project, and then open the mysql2 shell and enter \"source db/schema.sql\".  Then enter \"USE ecommerce_db\" to use the database file. Exit the mysql2 shell by entering \"exit\" into the command line.\n\nNext, seed the database with data by entering \"npm run seed\" into the command line.  The database and required tables are now created, selected, and contain data.  \n\nFinally, connect the server by entering \"npm start\" into the command line.\n\n\n## Usage\n\nThe user should use either Insomnia or PostMan to create a front-end environment.  When the user creates GET routes with the endroute of api/categories, the user will be presented with the table of ecommerce categories.  When the user send the same GET using an id number after categories (eg api/categories/2), the user is presented with a single category with an ID of 2.  The user can access all the products and tags using the same manner (api/products) and (api/tags), respectfully, and a single product and single tag by id (api/products/3), (api/tags5). \n\n\nThe user can also add categories, products, and tags using the POST route and entering required data. \n\nFor category, need: id (integer), category_name\nFor product, need: id (integer), product_name, price (decimal), stock (integer), and category_id (integer).\nFor tag, need: id (integer), tag_name\n\nThe user can also edit a single category, product, or tag using the PUT route and respective ID (eg api/products/5), and delete an item from categories, products, and tags using the DELETE route. \n\nImage of working \"GET category\":\n\n![Example of GET categories](https://user-images.githubusercontent.com/64170123/177803052-492ed420-fff5-4c39-9b6c-e1a8ccd364b1.jpg)\n\nImage of working \"GET single product\":\n\n![Exampe of GET single product](https://user-images.githubusercontent.com/64170123/177803084-f26e870e-f1d5-4403-9b57-410d6da76365.jpg)\n\nImage of working \"POST tag\":\n\n![Example of Post single tag](https://user-images.githubusercontent.com/64170123/177803619-1df97823-d0e9-4066-8ae7-492f54c3ae93.jpg)\n\n\n\n## Links\n\n\nLink to video of project: https://drive.google.com/file/d/1N7gWdj6sqXPNKDBdSY9WZnOaF43ygZ40/view\n\nThe link to the project is here: https://floating-waters-20623.herokuapp.com\n\nThe url of the Git repository is here: https://github.com/Samantha-Ruth/E-commerce-Back-End\n\n\n## Questions\n\nIf you have any questions about the repo, open an issue or you can find more of my work at (https://gitHub.com/Samantha-Ruth).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamantha-ruth%2Fe-commerce-back-end","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamantha-ruth%2Fe-commerce-back-end","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamantha-ruth%2Fe-commerce-back-end/lists"}