Skip to content

Commit

Permalink
Deployed Website
Browse files Browse the repository at this point in the history
  • Loading branch information
vraj291 committed Nov 27, 2021
1 parent 4e161ee commit 8dc4b71
Show file tree
Hide file tree
Showing 27 changed files with 56 additions and 50 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/client/build
/client/node_modules
/server/node_modules
/server/.env
Expand Down
7 changes: 3 additions & 4 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "./App.css";
import { BrowserRouter, Route, Switch } from "react-router-dom";
import { HashRouter, Route, Switch } from "react-router-dom";
import Register from "./auth/register";
import Login from "./auth/login";
import Home from "./Screens/Home";
Expand All @@ -20,7 +20,6 @@ import Search from "./components/SearchBar/Search"
import DashboardHome from "./components/Dashboard/DashboardHome";
import ProductList from "./components/Dashboard/ProductList";
import AddProduct from "./components/Dashboard/AddProduct";
import StoreDetails from "./components/Dashboard/StoreDetails";
import Orders from "./components/Orders/OrderPage"
import AddStore from "./components/Dashboard/AddStore";
import ShopList from "./components/Dashboard/ShopList";
Expand All @@ -30,7 +29,7 @@ function App() {
return (
<Provider store={store}>
<div className="App">
<BrowserRouter>
<HashRouter>
<Switch>
<Route exact path="/" component={HomePage} />
{/* <Route path="/payment" component={PaymentTest} /> */}
Expand Down Expand Up @@ -60,7 +59,7 @@ function App() {
</Switch>
</Layout>
</Switch>
</BrowserRouter>
</HashRouter>
</div>
</Provider>
);
Expand Down
2 changes: 1 addition & 1 deletion client/src/auth/changePassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ChangePassword = (props) => {
const {user,token} = queryString.parse(props.location.search)
await axios({
method : "PATCH",
url : 'http://localhost:4000/api/v1/auth/user/password',
url : 'https://ministore-backend.herokuapp.com/api/v1/auth/user/password',
headers : {
'Content-Type' : 'application/json',
'Accept' : 'application/json'
Expand Down
2 changes: 1 addition & 1 deletion client/src/auth/forgotPassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ForgotPassword = () => {
event.preventDefault();
await axios({
method : "POST",
url : 'http://localhost:4000/api/v1/auth/user/password',
url : 'https://ministore-backend.herokuapp.com/api/v1/auth/user/password',
headers : {
'Content-Type' : 'application/json',
'Accept' : 'application/json'
Expand Down
6 changes: 3 additions & 3 deletions client/src/auth/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Login = (props) => {
setJWTToken(queryObj.token)
const {data} = await axios({
method : "GET",
url : 'http://localhost:4000/api/v1/auth/user',
url : 'https://ministore-backend.herokuapp.com/api/v1/auth/user',
headers : {
Authorization: `Bearer ${queryObj.token}`
}
Expand All @@ -55,7 +55,7 @@ const Login = (props) => {
event.preventDefault();
await axios({
method : "POST",
url : 'http://localhost:4000/api/v1/auth/login',
url : 'https://ministore-backend.herokuapp.com/api/v1/auth/login',
headers : {
'Content-Type' : 'application/json',
'Accept' : 'application/json'
Expand Down Expand Up @@ -155,7 +155,7 @@ const Login = (props) => {
</p>
</div>
<div className='text-center'>
<a href="http://localhost:4000/api/v1/auth/google"> Login with Google </a>
<a href="https://ministore-backend.herokuapp.com/api/v1/auth/google"> Login with Google </a>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/auth/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Register = (props) => {
} else {
await axios({
method: "POST",
url: "http://localhost:4000/api/v1/auth/registration",
url: "https://ministore-backend.herokuapp.com/api/v1/auth/registration",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Cart/CartPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ const Stores = (props) => {

<Button
className={classes.a}
href="/payment"
href="/#/payment"

>
Place Order
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/Dashboard/AddProduct.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const AddStore = () => {

useEffect(() => {
axios
.get("http://localhost:4000/api/v1/auth/user", {
.get("https://ministore-backend.herokuapp.com/api/v1/auth/user", {
headers: {
Authorization: `Bearer ${user.jwtToken}`,
},
Expand All @@ -123,7 +123,7 @@ const AddStore = () => {
});

axios
.get("http://localhost:4000/api/v1/categories")
.get("https://ministore-backend.herokuapp.com/api/v1/categories")
.then((res) => {
console.log("default :", res.data.data);
setCategory(res.data.data);
Expand All @@ -148,7 +148,7 @@ const AddStore = () => {
e.preventDefault();
axios
.post(
`http://localhost:4000/api/v1/stores/${store}/products`,
`https://ministore-backend.herokuapp.com/api/v1/stores/${store}/products`,
{
user: user.user,
name: name,
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Dashboard/AddStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const AddStore = () => {
e.preventDefault();
axios
.post(
"http://localhost:4000/api/v1/stores",
"https://ministore-backend.herokuapp.com/api/v1/stores",
{
user: user.user,
name: name,
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Dashboard/DashboardHome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function DashboardHome() {

useEffect(() => {
axios
.get("http://localhost:4000/api/v1/stores?limit=10000")
.get("https://ministore-backend.herokuapp.com/api/v1/stores?limit=10000")
.then((res) => {
console.log("default :", res.data.data);
setStores(res.data.data);
Expand All @@ -67,7 +67,7 @@ function DashboardHome() {
});

axios
.get("http://localhost:4000/api/v1/auth/user", {
.get("https://ministore-backend.herokuapp.com/api/v1/auth/user", {
headers: {
Authorization: `Bearer ${user.jwtToken}`,
},
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Dashboard/ProductList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function ProductList() {
if (sure) {
await axios
.delete(
`http://localhost:4000/api/v1/products/${params.row.id}`,
`https://ministore-backend.herokuapp.com/api/v1/products/${params.row.id}`,
{
headers: {
Authorization: `Bearer ${user.jwtToken}`,
Expand All @@ -144,7 +144,7 @@ function ProductList() {
if (sure) {
await axios
.patch(
`http://localhost:4000/api/v1/products/${params.row.id}`,
`https://ministore-backend.herokuapp.com/api/v1/products/${params.row.id}`,
{
headers: {
Authorization: `Bearer ${user.jwtToken}`,
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Dashboard/ShopList.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ShopList = () => {
const [userData, setUserData] = useState({});
useEffect(() => {
axios
.get("http://localhost:4000/api/v1/auth/user", {
.get("https://ministore-backend.herokuapp.com/api/v1/auth/user", {
headers: {
Authorization: `Bearer ${user.jwtToken}`,
},
Expand Down Expand Up @@ -104,7 +104,7 @@ const ShopList = () => {
if (sure) {
await axios
.delete(
`http://localhost:4000/api/v1/stores/${params.row._id}`,
`https://ministore-backend.herokuapp.com/api/v1/stores/${params.row._id}`,
{
headers: {
Authorization: `Bearer ${user.jwtToken}`,
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Homepage/Categories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Categories = () => {
const getCategories = async ()=>{
await axios({
method: "GET",
url: "http://localhost:4000/api/v1/categories",
url: "https://ministore-backend.herokuapp.com/api/v1/categories",
})
.then((res) => {
setCategory(res.data.data)
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Homepage/HomeProducts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const HomeProducts = () => {
const getProducts = async ()=>{
await axios({
method: "GET",
url: "http://localhost:4000/api/v1/products",
url: "https://ministore-backend.herokuapp.com/api/v1/products",
})
.then((res) => {
console.log(res.data)
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ function Navbar() {

<div className={classes.icons} >
<Search className={classes.searchButton} onClick={() => setOpen(true)}/>
<Button href="/signup" variant="outlined" className={classes.button}>SIGN UP</Button>
<Button href="/signin" variant="outlined" className={classes.button}>SIGN IN</Button>
<Button href="/#/signup" variant="outlined" className={classes.button}>SIGN UP</Button>
<Button href="/#/signin" variant="outlined" className={classes.button}>SIGN IN</Button>

</div>

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Orders/OrderPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ const OrderPage = () => {
const [loading, setLoading] = useState(false);
useEffect(() => {
axios
.get("http://localhost:4000/api/v1/auth/user", {
.get("https://ministore-backend.herokuapp.com/api/v1/auth/user", {
headers: {
Authorization: `Bearer ${user.jwtToken}`,
},
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Products/Feed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function Feed() {
const getProducts = async () => {
await axios({
method: "GET",
url: "http://localhost:4000/api/v1/products",
url: "https://ministore-backend.herokuapp.com/api/v1/products",
})
.then((res) => {
setProducts(res.data.data);
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Profile/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const Profile = () => {
const history = useHistory();
useEffect(() => {
axios
.get("http://localhost:4000/api/v1/auth/user", {
.get("https://ministore-backend.herokuapp.com/api/v1/auth/user", {
headers: {
Authorization: `Bearer ${user.jwtToken}`,
},
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Profile/ProfileEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const ProfileEdit = () => {

useEffect(() => {
axios
.get("http://localhost:4000/api/v1/auth/user", {
.get("https://ministore-backend.herokuapp.com/api/v1/auth/user", {
headers: {
Authorization: `Bearer ${user.jwtToken}`,
},
Expand Down Expand Up @@ -110,7 +110,7 @@ const ProfileEdit = () => {
// console.log(editUser);
await axios
.patch(
"http://localhost:4000/api/v1/auth/user",
"https://ministore-backend.herokuapp.com/api/v1/auth/user",
{
user: editUser,
name: editUser.name,
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/SearchBar/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const [products, setProducts] = useState([]);
const getProducts = async ()=>{
await axios({
method: "GET",
url: "http://localhost:4000/api/v1/products",
url: "https://ministore-backend.herokuapp.com/api/v1/products",
})
.then((res) => {
setProducts(res.data.data.filter(p=>p.name.toLowerCase()==props.match.params.name.toLowerCase()))
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/shop/Shop.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const Shop = () => {

useEffect(() => {
axios
.get(`http://localhost:4000/api/v1/stores/${id}`)
.get(`https://ministore-backend.herokuapp.com/api/v1/stores/${id}`)
.then((store) => {
setStore({
images: store.data.data.images,
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/shop/StoreList.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const Stores = (props) => {
</CardContent>
<CardActions>
<Button
href={`/store/${store._id}`}
href={`/#/store/${store._id}`}
size="small"
color="primary"
>
Expand All @@ -191,7 +191,7 @@ const StoreList = () => {
useEffect(() => {
const getStores = async () => {
await axios
.get("http://localhost:4000/api/v1/stores")
.get("https://ministore-backend.herokuapp.com/api/v1/stores")
.then((stores) => {
setStores(stores.data.data);
setLoading(true);
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const PaymentTest = () => {
const tokenHandler = (token) => {
axios({
method: "POST",
url: `http://localhost:4000/api/v1/payment/stripe`,
url: `https://ministore-backend.herokuapp.com/api/v1/payment/stripe`,
data: {
token,
cart: {
Expand Down Expand Up @@ -201,7 +201,7 @@ export const PaymentTest = () => {
const cashOnDelivery = () => {
axios({
method: "POST",
url: `http://localhost:4000/api/v1/payment/cash`,
url: `https://ministore-backend.herokuapp.com/api/v1/payment/cash`,
data: {
cart: {
products: products,
Expand Down Expand Up @@ -243,7 +243,7 @@ export const PaymentTest = () => {
console.log(res);
axios({
method: "POST",
url: `http://localhost:4000/api/v1/payment/razorpay`,
url: `https://ministore-backend.herokuapp.com/api/v1/payment/razorpay`,
data: {
id: res.razorpay_payment_id,
cart: {
Expand Down
1 change: 1 addition & 0 deletions server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
1 change: 1 addition & 0 deletions server/ProcFile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node server.js
Loading

0 comments on commit 8dc4b71

Please sign in to comment.