react-node-ecommerce
🛍️ MERN E-commerce Store
An ecommerce store built with MERN stack and Paypal payments API.
Features
- Login/register
- Place order
- Search for product
- Add/remove products to cart
- Admin panel (CRUD operations)
- Semantic UI
- Fully responsive UI
- JWT Authorization
- Paypal payment integration
Tools
Installation
-
React Setup & Git Initialize
npx create-react-app frontend
-
Implementing React Router
npm i react-router-dom
-
Fetch Data From Express
npm i axios
<pre>"proxy": "http://127.0.0.1:5000", </pre> <pre>npm i -D nodemon concurrently
npm i dotenv
-
Connect to MongoDB
npm i mongoose
-
Back-End Server Setup
[📜 Back-End Scripts]"scripts": { "start": "node backend/server" // Run node server | npm start
“server”: “nodemon backend/server”, // Run node server automatically | npm run server
“client”: “npm start –prefix frontend” // Run frontend React server from backend | npm run client
“dev”: “concurrently “npm run server” “npm run client”” // Run Both servers at the same time | npm run dev
“data:import”: “node backend/seeder”, // Import seeder date to DB | npm run data:import “data:destory”: “node backend/seeder -d” // Destory data from DB | npm run data:destory },
<pre>npm i express
npm i bcryptjs npm i express-async-handler npm i morgan npm i jsonwebtoken npm i multer npm i react-helmet
-
Connect to MongoDB
const conn = await mongoose.connect(process.env.MONGO_URI, { useUnifiedTopology: true, useNewUrlParser: true, useCreateIndex: true,
-
Redux Setup
npm i redux react-redux redux-thunk redux-devtools-extension
-
JWT Token
pm.environment.set("TOKEN", pm.response.json().token)
-
Heroku Deploy
heroku login heroku create "URL name"
in Procfile file –> web: node backend/server.js
Author
Theelipan Prabakar –
www.theelipan.com
Project Link:
https://rn-store.herokuapp.com/
License
Released under the MIT License.