Home
Softono

Nodejs Shopping Cart

Open source JavaScript
66
Stars
29
Forks
8
Issues
4
Watchers
2 months
Last Commit

 About Nodejs Shopping Cart

NodeJS / Express / MongoDB - Shopping Cart (monolithic app with handlebars)

Platforms

Web Self-hosted

Languages

JavaScript

Links

Need Help Installing Nodejs Shopping Cart?

We provide expert installation service for this software. Our team will install, configure, and secure Nodejs Shopping Cart on your server. plans start at just $30.

Nodejs Shopping Cart

View on GitHub

Node js, Mongodb, Express js Shopping Cart

image

This project works with Stripe api on Nodejs and on the client representation as well. Go to Stripe for more information

Requirements

Used middlewares

  • connect-mongo
  • express cookie
  • nodemon
  • morgan

Migrations

Current app implementation doesn't have a UI for adding new products, but you can run script with migrations to add some products into DB and receive it from the application's UI. Make sure MongoDB is installed and running first.

npm run migration:write

ENV

Before running the app, you should create your own .env file in the root with the following variables:

PORT=<place your port here>
STRIPE_SECRET_KEY=<your stripe secret test key for server>
MONGO_DB_URL='mongodb://127.0.0.1:27017' or remote mongo address

Note: make sure to add publc stripe key to public/javascripts/checkout.js in order to configure both server and client parts of Stripe.

const stripePublishableTestKey = null;
// your public key should be here for proper Stripe work
// otherwise app generates en error with alert message

if (!stripePublishableTestKey) {
  const error = 'Please add a Stripe.js public key';
  alert(error);
  throw new Error(error);
}

Stripe.setPublishableKey(stripePublishableTestKey);

Running

  • npm install
  • add stripe test key to ENV file and to checkout.js (publishable not secret key for sender identification)
  • npm start
  • open browser at specified PORT env variables