GithubHelp home page GithubHelp logo

danielmrva / backend_to_the_future Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.33 MB

Basic e-commerce Javascript back-end built using NODE, Express, MySql2, Sequelize, and DotEnv

License: MIT License

JavaScript 100.00%

backend_to_the_future's Introduction

Description

Backend to the Future is a basic e-commerce back-end mock-up built using Node JS, MySql, DotENV, Sequelize, to be accessed through a restful API access program like Insomnia.

Table of Conents

  1. Installation
  2. Usage
  3. Contribution
  4. Acknowledgements
  5. Questions
  6. Github Repository
  7. License

Installation

Open github link, click on "Code" button, and copy repo link.

In Bash navigate to desired parent directory and type "git clone" then paste the repo link.

Open project in Node terminal or code editor terminal and run "npm intall" to install dependencies.

In your code editor, you will need to modify the .env.EXAMPLE file name to simply .env, and change the DB_PW='YOUR PASSWORD' on line 2 to your actual password. Double check the .gitignore file that it has .env listed in ignored files before pushing your copy of the repo up to (for eample) GitHub.

{"DB_PW": "#########" }

This should complete the installation process.

Usage

In terminal log in to your MySql account and run:

SOURCE ./db/schema.sql;
USE ecommerce_db;

Exit Mysql

From the app's root directory in Bash or your code editor terminal run "npm run seed" to seed the database with starter data, then run "npm start" to run the app.

From here, you can get JSON-fomrated database query results from a restful-API testing app like Insomnia.

Your server will run on port 3001, so your routes will look something like:

* http://localhost:3001/api/categories (get - all categories)
* http://localhost:3001/api/categories/9 (get - categories by ID "9")
* http://localhost:3001/api/tags (get - all tags)
* http://localhost:3001/api/tags/9 (get - tags by ID "9")
* http://localhost:3001/api/products (get - all products)
* http://localhost:3001/api/products/9 (get - products by ID  "9")

Post (create) routes will use the same general format as get - all routes, with the exception of having json bodies formated to their particular models (see category, product, and tag models for further details on Json body structure). Put (update) and Delete (destory) routes will use a route format similar to get by ID routes, with the exception of Put routes also requiring a json body structure similar to create routes (again, refer to the models).

Contribution

Email my Devmail via github

Acknowledgements

BenChristensen For debugging help

Questions

Email me any questions to my devmail found on my GitHub profile.

Feel free to follow or contact me at my GitHub page: DanielMrva

Github Repository

Backend to the Future

Demo

License

MIT

backend_to_the_future's People

Contributors

danielmrva avatar

Watchers

 avatar

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.