Git Product home page Git Product logo

node-react-ecommerce-final's Introduction

Amazona: Ecommerce Website like Amazon

Demo: https://amazonaapp.herokuapp.com

Deployment on Heroku

Step 1. Add this folder to git repository

$ git init

Step 2. Create heroku account at https://heroku.com

Step 3. Install Heroku CLI at https://devcenter.heroku.com/articles/heroku-cli

Step 4. Login to Heroku

$ heroku login

Step 5. Create Heroku app

$ heroku apps:create amazonaapp

Step 6. Edit package.json

   "scripts": {
    "start": "node dist/server.js",
    "dev": "nodemon --exec babel-node backend/server.js",
    "build": "rm -rf dist && babel backend -d dist",
    "heroku-postbuild": "npm run build && cd frontend && npm install && npm run build"
  },

Step 7. Update server port in backend/server.js

const port = process.env.PORT || 5000;
app.listen(port, () =>
  console.log("Server serves at http://localhost:" + port)
);

Step 8. Push to Heroku

$ git add .
$ git commit -m "message"
$ git push heroku master

Connect to MongoDB

Step 1. Create account on https://www.mongodb.com/cloud

Step 2. Login to https://cloud.mongodb.com/

Step 3. Add database user

  • Select Security > Database Access on left sidebar
  • Select Add New User button
  • Enter user name and password and click Add User

Step 4. Add ip whitelist

  • Select Security > Network Access on left sidebar
  • Select Add IP Address
  • Enter 0.0.0.0/0 in Whitelist Entry and click Confirm

Step 5. Get connection string

  • Select Altas > Cluster on left sidebar
  • Click Connect
  • Click Connect to your application
  • Click Copy button

Step 6. Set connection string in Heroku

  • Open Heroku apps https://dashboard.heroku.com/apps/
  • Select your apps
  • Open Setting Tab
  • Click Reveal Config Vars
  • Enter Key as MONGODB_URL
  • Enter Value from copied connection string

Step 7. Set connection string in backend/server.js

const mongodbUrl = process.env.MONGODB_URL || "mongodb://localhost/amazona";

node-react-ecommerce-final's People

Contributors

basir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

node-react-ecommerce-final's Issues

needs to updated to "react-scripts": "3.4.1",

I've faced this problem and figure out it by upgrading the react-scripts package from "react-scripts": "3.x.x" to "react-scripts": "^3.4.1" (or the latest available version).

Delete node_modules\ folder
Delete package-lock.json file
Rewrite the package.json file from "react-scripts": "3.x.x" to "react-scripts": "^3.4.1"
Install node packages again npm i
Now, start the project npm start

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.