• Stars
    star
    157
  • Rank 231,410 (Top 5 %)
  • Language
    CSS
  • License
    MIT License
  • Created almost 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An ecommerce store built in NodeJS

Nodejs Ecommerce Store

An amazon clone ecommerce store built in NodeJS utilizing Express, Stripe Payment, MongoDB, Elastic Search, Faker API just to mention a few. Developed with the latest cutting edge industry standard technologies, eTswana stores allows a shopper to browse through the online store and buy products using a credit card. eTswana stores supports social sign up and sign in using Facebook.

Live Demo

View the live demo as hosted on Heroku at https://etswana.herokuapp.com/ (application may take few seconds to open)

Requirements

1. Internet connection
2. NodeJS (https://nodejs.org/)
3. VS Code (optional: I use WebStorm)
4. MongoDB (you can use www.mlab.com or Docker alternative)
5. Elastic Search (https://www.elastic.co/ or Docker alternative):
    Download version 1.7.5 others are not compatable
6. Stripe account

Instructions

Open the project in VS Code, and navigate to config folder. Open the config.js in the editor:

Add mongodb URL:

 database: '<mongo_db_url>' e.g. mongodb://localhost:27017/test

Provide a secret key:

secretKey: "<add_secret_key>" - e.g. LKSJ&%$#XFE

Using Facebook developer site, create a Facebook app and retrieve the following:

clientID: process.env.FACEBOOK_ID || '<facebook_id>'

clientSecret: process.env.FACEBOOK_SECRET || '<facebook_secret_key>'

Create an account with Stripe Payment (https://stripe.com/)

Open routes/main.js to add the 'sk_test_SAF...'
number retrieved from Stripe.com

Running the application

Now that we are set. Open project in terminal, and:

npm install (this will install all dependencies)

Once all dependencies are installed

npm start

aggg!! Project does not run

* Make sure Elasticsearch is running (version 1.7.5).
* If using MongoDB locally, make sure it is running as well.

alternatively if you have Docker and Docker compose installed then simply docker-compose up. This will install and run MongoD and ElasticSearch.

Testing

Add testing data to the application by loading API data from Faker API. To do this, open http://localhost:3000/api/<name-of-category-added>. Do this for all categories. I will automate this functionality with Cypress UI automation tool.

started on automating this

To run automated UI tests, run npm run test

The tests are written using the Cypress framework (https://www.cypress.io)

For Stripe payment testing please use the recommended cards on this: https://stripe.com/docs/testing

Docker & Kubernetes

To create a Docker container for the application, docker build -t etswana:1.0.0 .. Create the Docker image with docker run etswana:1.0.0

WIP: add more instructions on setting up Docker and Kubernetes including monitoring.

Whats Next

  1. REFACTOR! Clean code comments
  2. REFACTOR! Improved code readability
  3. More functionality to the ecommerce
  4. Write a detailed tutorial - probably use a package to generate one from the code comments

License

The MIT License (MIT)

Copyright (c) 2016 Mr Modise

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

More Repositories

1

java-spring-file-upload

Upload images using Java Spring MVC
Java
9
star
2

senepe

A photo sharing Web app developed in Spring boot (backend) and Angular 4 (frontend)
TypeScript
7
star
3

selenium-and-wordpress

Building a UI automated testing framework with Selenium 3.4 for a WordPress site
C#
3
star
4

loopback4-calling-other-apis

A NodeJS project to demonstrate calling SOAP & REST APIs from within Loopback 4 application
TypeScript
2
star
5

loopback-4-security-jwt-mongodb

A repo to illustrate a RESTful API with authentication in Loopback 4
TypeScript
2
star
6

loopback4-password-reset

This repo illustrates how to add password-reset functionality to a LoopBack 4 application. Full documentation available at https://more-modise.medium.com/how-to-add-password-reset-to-your-loopback-4-application-df3355b838ea
TypeScript
2
star
7

book-manager-mongodb-nodejs

A simple application to demostrate CRUD functions in MongoDB using Mongoose and ExpressJS in NodeJS
HTML
2
star
8

updatedAWD2016repo

Used maven for dependency management
HTML
1
star
9

kota-app

Popular township street food โ€“ a quarter loaf (kota) of bread hollowed out and filled again (Only in South Africa)
JavaScript
1
star
10

angular2-form

Angular 2 form in action
JavaScript
1
star
11

spark-tutorials

A load of Apache Spark Tutorials in Java 8
Java
1
star
12

bmi_calculator

A Flutter demo app demonstrating customizing Flutter widget to build beautiful UI elements
Dart
1
star
13

spring-security-with-spring-boot

Secure a Spring Boot Web app using Spring security: user credentials from relational database
Java
1
star
14

nest-intro

TypeScript
1
star
15

hello-angular-2

A hello world angular2 project that can be extended into a full functioning application
JavaScript
1
star
16

The-Complete-Java-Web-Blog-Post

A Java blogpost site built in Spring Boot, Thymeleaf, Spring Data and Spring Security
CSS
1
star