Skip to content

Commit 2e184ec

Browse files
authored
improve-run-locally-docs (#95)
1 parent efd33ae commit 2e184ec

5 files changed

Lines changed: 46 additions & 13 deletions

File tree

README.md

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,52 @@ Welcome to my React and Node tutorial to build a fully-functional e-commerce web
2525

2626
## Run Locally
2727

28-
- git clone git@github.com:basir/node-react-ecommerce.git
29-
- cd node-react-ecommerce
30-
- Run Backend
31-
- npm install
32-
- npm start
33-
- Run Frontend
34-
- open new terminal
35-
- cd frontend
36-
- npm install
37-
- npm start
28+
### 1. Clone repo
29+
30+
```
31+
$ git clone git@github.com:basir/node-react-ecommerce.git
32+
$ cd node-react-ecommerce
33+
```
34+
35+
### 2. Install MongoDB
36+
37+
Download it from here: https://docs.mongodb.com/manual/administration/install-community/
38+
39+
### 3. Run Backend
40+
41+
```
42+
$ npm install
43+
$ npm start
44+
```
45+
46+
### 4. Run Frontend
47+
48+
```
49+
# open new terminal
50+
$ cd frontend
51+
$ npm install
52+
$ npm start
53+
```
54+
55+
### 5. Create Admin User
56+
57+
- Run this on chrome: http://localhost:5000/api/users/createadmin
58+
- It returns admin email and password
59+
60+
### 6. Login
61+
62+
- Run http://localhost:3000/signin
63+
- Enter admin email and password and click signin
64+
65+
### 7. Create Products
66+
67+
- Run http://localhost:3000/products
68+
- Click create product and enter product info
3869

3970
Let me know if you have any questions. [Email Basir](mailto:basir.jafarzadeh@gmail.com)
4071

72+
## Video Tutorials
73+
4174
### [00:02:00 Part 01- Introduction](https://www.youtube.com/watch?v=Fy9SdZLBTOo&t=120s)
4275

4376
It gives you an overview of the tutorial to build an eCommerce website like Amazon.

backend/routes/userRoute.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ router.get('/createadmin', async (req, res) => {
6666
try {
6767
const user = new User({
6868
name: 'Basir',
69-
email: 'basir.jafarzadeh@gmail.com',
69+
email: 'admin@example.com',
7070
password: '1234',
7171
isAdmin: true,
7272
});

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"react-dom": "^16.12.0",
1414
"react-redux": "^7.1.3",
1515
"react-router-dom": "^5.1.2",
16-
"react-scripts": "3.3.0",
16+
"react-scripts": "^3.4.1",
1717
"redux": "^4.0.5",
1818
"redux-thunk": "^2.3.0"
1919
},

frontend/src/screens/ProductsScreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function ProductsScreen(props) {
8181
bodyFormData.append('image', file);
8282
setUploading(true);
8383
axios
84-
.post('/api/uploads/s3', bodyFormData, {
84+
.post('/api/uploads', bodyFormData, {
8585
headers: {
8686
'Content-Type': 'multipart/form-data',
8787
},

uploads/file.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)