This project was created with Create React App.
In the project directory, you can run:
Runs the backend server.
Open http://localhost:5000 to view it in your browser.
The page will reload when you make changes.\
Runs the client side app.
Open http://localhost:3000 to view it in your browser.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Use this command to run both the backend and the frontend servers with one command.\
notes:
-routes tagged with Protected will need a token to be accessed
-user type inputs Admin and User with the capital letters
-user status inputs Active, Inactive and Suspended with the capital letters
-[^1]: location inputs cartItems, wishlistItems and orders
gets all users from DB
const axios = require('axios');
let config = {
method: 'get',
url: 'http://localhost:8080/api/users',
headers: {
'Authorization': `Bearer ${token}`
}
};
axios(config)
const axios = require('axios');
let data = JSON.stringify({
"firstName": "firstName",
"lastName": "lastName",
"email": "email@email.com",
"password": "password",
"address": "address",
"phone": "phone",
"type": "type",
"status": "status"
});
let config = {
method: 'post',
url: 'http://localhost:8080/api/users',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios(config)
const axios = require('axios');
let data = JSON.stringify({
"email": "email@email.com",
"password": "password"
});
let config = {
method: 'post',
url: 'http://localhost:8080/api/users/login',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios(config)
const axios = require('axios');
let data = JSON.stringify({
"firstName": "firstName",
"lastName": "lastName",
"email": "email@email.com",
"password": "password",
"address": "address",
"phone": "phone",
"type": "type",
"status": "status"
});
let config = {
method: 'put',
url: `http://localhost:8080/api/users/${userID}`,
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios(config)
const axios = require('axios');
let config = {
method: 'delete',
url: `http://localhost:8080/api/users/${userID}`,
};
axios(config)
const axios = require('axios');
let data = JSON.stringify({
"itemID": "item._id"
});
let config = {
method: 'put',
url: `http://localhost:8080/api/users/${userID}/${location}`,[^1]
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
data : data
};
axios(config)
const axios = require('axios');
let data = JSON.stringify({
"itemID": "6266285eb39dea1f1bf0c434"
});
let config = {
method: 'delete',
url: `http://localhost:8080/api/users/${userID}/${location}`,
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
data : data
};
axios(config)
const axios = require('axios');
let config = {
method: 'get',
url: `http://localhost:8080/api/orders`,
headers: {
'Authorization': `Bearer ${token}`
}
};
axios(config)
const axios = require('axios');
let config = {
method: 'get',
url: `http://localhost:8080/api/orders/{orderID}`,
headers: {
'Authorization': `Bearer ${token}`
}
};
axios(config)
const axios = require('axios');
let data = JSON.stringify({
"userID": String,
"paymentMethod": String,
"coupon": String,
"status": String {pending, proccessing, shipped, delvired, canceled },
"products": [String],
"totalValue": String
});
let config = {
method: 'post',
url: 'http://localhost:8080/api/orders',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
data : data
};
axios(config)
const axios = require('axios');
let data = JSON.stringify({
"paymentMethod": String,
"coupon": String,
"status": String {pending, proccessing, shipped, delivered, canceled },
"products": [String],
"totalValue": String
});
let config = {
method: 'put',
url: 'http://localhost:8080/api/orders/{orderID}',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
data : data
};
axios(config)
const axios = require('axios');
let config = {
method: 'delete',
url: 'http://localhost:8080/api/orders/{orderID}',
headers: {
'Authorization': `Bearer ${token}`
}
};
axios(config)
const axios = require('axios');
let config = {
method: 'get',
url: `http://localhost:8080/api/products`,
};
axios(config)
const axios = require('axios');
let config = {
method: 'get',
url: `http://localhost:8080/api/products/{productID}`
};
axios(config)
const axios = require('axios');
let data = JSON.stringify({
"category": "String",
"images": ["String"],
"age": "String",
"pieces": "String",
"isFeatured": Boolean,
"features": "String",
"highlights": ["String"],
"details": "String",
"name": "String",
"price": Number,
"brand": "String",
"tags": ["String"]
});
let config = {
method: 'post',
url: 'http://localhost:8080/api/products',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
data : data
};
axios(config)
const axios = require('axios');
let data = JSON.stringify({
"category": "String",
"images": ["String"],
"age": "String",
"pieces": "String",
"isFeatured": Boolean,
"features": "String",
"highlights": ["String"],
"details": "String",
"name": "String",
"price": Number,
"brand": "String",
"tags": ["String"]
});
let config = {
method: 'put',
url: 'http://localhost:8080/api/products/{productID}',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
data : data
};
axios(config)
const axios = require('axios');
let config = {
method: 'delete',
url: 'http://localhost:8080/api/products/{prodcutID}',
headers: {
'Authorization': `Bearer ${token}`
}
};
axios(config)