From 2dd06b58c0b46bf10d63b2c608cd98bc3080e350 Mon Sep 17 00:00:00 2001 From: as4c Date: Fri, 8 Mar 2024 21:35:56 +0530 Subject: [PATCH 1/6] backend ready --- Backend/Dockerfile | 23 +++++++++++++++++++ Backend/docker-compose.yml | 36 ++++++++++++++++++++++++++++++ Backend/requirements.txt | 45 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+) create mode 100644 Backend/Dockerfile create mode 100644 Backend/docker-compose.yml create mode 100644 Backend/requirements.txt diff --git a/Backend/Dockerfile b/Backend/Dockerfile new file mode 100644 index 0000000..07d3e96 --- /dev/null +++ b/Backend/Dockerfile @@ -0,0 +1,23 @@ +FROM python:3.10 + +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONUNBUFFERED 1 + +# Set the working directory in the container +WORKDIR /opt/app + +RUN pip install --upgrade pip +# Copy the requirements file into the container +COPY ./requirements.txt /opt/app + +# Install the required packages +RUN pip install -r requirements.txt + +# Copy the Django backend files into the container +COPY . /opt/app + +# Expose port 8000 for the Django server +EXPOSE 8000 + +# Run the Django server +CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] \ No newline at end of file diff --git a/Backend/docker-compose.yml b/Backend/docker-compose.yml new file mode 100644 index 0000000..2eb0c94 --- /dev/null +++ b/Backend/docker-compose.yml @@ -0,0 +1,36 @@ +version: '3' + +services: + web: + build: . + command: python manage.py runserver 0.0.0.0:8000 + volumes: + - .:/app + ports: + - "8000:8000" + depends_on: + - db + environment: + DJANGO_SETTINGS_MODULE: "backend.settings" + POSTGRES_DB: ${DB_NAME} + POSTGRES_USER: ${DB_USER} + POSTGRES_PASSWORD: ${DB_PASSWORD} + networks: + - backend + + db: + image: postgres:latest + volumes: + - postgres_data:/var/lib/postgresql/data + environment: + POSTGRES_DB: ${DATABASE_NAME} + POSTGRES_USER: ${DB_USER} + POSTGRES_PASSWORD: ${DB_PASSWORD} + networks: + - backend + +networks: + backend: + +volumes: + postgres_data: diff --git a/Backend/requirements.txt b/Backend/requirements.txt new file mode 100644 index 0000000..077174c --- /dev/null +++ b/Backend/requirements.txt @@ -0,0 +1,45 @@ +asgiref==3.7.2 +cachetools==5.3.2 +certifi==2023.11.17 +cffi==1.16.0 +charset-normalizer==3.3.2 +cloudinary==1.39.0 +cryptography==41.0.7 +defusedxml==0.7.1 +dj-database-url==2.1.0 +dj-rest-auth==5.0.2 +Django==5.0 +django-allauth==0.59.0 +django-ckeditor==6.7.1 +django-cloudinary-storage==0.3.0 +django-cors-headers==4.3.1 +django-environ==0.11.2 +django-js-asset==2.2.0 +djangorestframework==3.14.0 +djangorestframework-simplejwt==5.3.1 +google-auth==2.25.2 +google-auth-httplib2==0.2.0 +google-auth-oauthlib==1.2.0 +httplib2==0.22.0 +idna==3.6 +oauthlib==3.2.2 +Pillow==10.1.0 +psycopg2==2.9.9 +psycopg2-binary==2.9.9 +pyasn1==0.5.1 +pyasn1-modules==0.3.0 +pycparser==2.21 +PyJWT==2.8.0 +pyparsing==3.1.1 +python-dotenv==1.0.0 +python3-openid==3.2.0 +pytube==15.0.0 +pytz==2023.3.post1 +razorpay==1.4.1 +requests==2.31.0 +requests-oauthlib==1.3.1 +rsa==4.9 +six==1.16.0 +sqlparse==0.4.4 +typing_extensions==4.9.0 +urllib3==2.1.0 From 0447787b257797091b7af3de73e29210f2b97601 Mon Sep 17 00:00:00 2001 From: as4c Date: Fri, 8 Mar 2024 21:37:30 +0530 Subject: [PATCH 2/6] frontend ready --- frontend/Dockerfile | 23 +++++++++++++++++++++++ frontend/docker-compose.yml | 14 ++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 frontend/Dockerfile create mode 100644 frontend/docker-compose.yml diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..ad138de --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,23 @@ +# Use the official Node image as the base image +FROM node:20-alpine + +# Set the working directory inside the container +WORKDIR /app + +# Copy package.json and package-lock.json to the working directory +COPY package*.json ./ + +# Install project dependencies +RUN npm install + +# Copy the entire project to the working directory +COPY . . + +# Build the React app +RUN npm run build + +# Expose the port on which the app will run +EXPOSE 3000 + +# Command to start the application +CMD ["npm", "start"] diff --git a/frontend/docker-compose.yml b/frontend/docker-compose.yml new file mode 100644 index 0000000..2ca8b32 --- /dev/null +++ b/frontend/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3' + +services: + frontend: + build: + context: . + dockerfile: Dockerfile + ports: + - "3000:3000" + volumes: + - ./src:/app/src + - ./public:/app/public + environment: + - NODE_ENV=development From 23128825e3921f268d70890fc74f1ce1c5d8a0e0 Mon Sep 17 00:00:00 2001 From: as4c Date: Fri, 8 Mar 2024 22:11:32 +0530 Subject: [PATCH 3/6] frontend ready --- frontend/src/category/AddCategory.js | 4 +- frontend/src/helper/DisplayOrderList.jsx | 3 +- frontend/src/helper/ProductFilter.jsx | 2 +- frontend/src/homepage/Layout.jsx | 2 - frontend/src/product/GetProduct.jsx | 3 +- frontend/src/product/ProductList.jsx | 1 - frontend/src/product/RelatedProduct.jsx | 3 +- frontend/src/product/UpdateModal.jsx | 6 +-- frontend/src/product/UpdatePage.jsx | 5 +-- frontend/src/seller/OrderDashboard.jsx | 2 +- frontend/src/seller/ProcessOrder.jsx | 3 +- frontend/src/seller/SellerDashboard.jsx | 2 +- frontend/src/seller/SellerProductLists.jsx | 10 ----- frontend/src/user/Profile.js | 2 - frontend/src/user/Signup.js | 1 - frontend/src/user/helper/userapicalls.js | 3 +- frontend/src/useraction/cart/UserCart.jsx | 3 +- frontend/src/useraction/order/OrderDetail.jsx | 4 +- .../src/useraction/order/OrderFromCart.jsx | 41 ++++--------------- frontend/src/useraction/order/OrderList.jsx | 17 +------- .../src/useraction/order/OrderSummary.jsx | 37 ++++------------- frontend/src/useraction/wishlist/Wishlist.jsx | 3 +- 22 files changed, 33 insertions(+), 124 deletions(-) diff --git a/frontend/src/category/AddCategory.js b/frontend/src/category/AddCategory.js index 75dfcf5..0912d0d 100644 --- a/frontend/src/category/AddCategory.js +++ b/frontend/src/category/AddCategory.js @@ -30,11 +30,9 @@ const AddCategory = () => { }; const onSubmit = async (e) => { - e.preventDefault(); // Corrected typo - + e.preventDefault(); const res1 = await dispatch(createCategory({ name, description })); const res = await unwrapResult(res1); - console.log("category res...", res); if (!res.errors) { Swal.fire({ icon: 'success', diff --git a/frontend/src/helper/DisplayOrderList.jsx b/frontend/src/helper/DisplayOrderList.jsx index 83f78dd..b2a39e8 100644 --- a/frontend/src/helper/DisplayOrderList.jsx +++ b/frontend/src/helper/DisplayOrderList.jsx @@ -1,6 +1,5 @@ import React, { useState } from 'react'; import { Link } from 'react-router-dom'; -import { BaseUrl } from '../backend'; import { mapDeliveryTime, mapOderType, @@ -38,7 +37,7 @@ const DisplayOrderList = ({ data }) => {
- product image + product image
diff --git a/frontend/src/helper/ProductFilter.jsx b/frontend/src/helper/ProductFilter.jsx index a44d4d8..725f86d 100644 --- a/frontend/src/helper/ProductFilter.jsx +++ b/frontend/src/helper/ProductFilter.jsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react' +import React, { useState } from 'react' import { useDispatch } from 'react-redux'; import { filterProduct } from '../features/actions/productActions'; diff --git a/frontend/src/homepage/Layout.jsx b/frontend/src/homepage/Layout.jsx index ef7ef35..2500a04 100644 --- a/frontend/src/homepage/Layout.jsx +++ b/frontend/src/homepage/Layout.jsx @@ -1,8 +1,6 @@ import React, { useEffect } from 'react'; import Navbar from './Component/Navbar'; import Footer from './Component/Footer'; -import { useDispatch, useSelector } from 'react-redux'; -import { refreshToken } from '../features/actions/authActions'; import Categories from '../category/Categories'; diff --git a/frontend/src/product/GetProduct.jsx b/frontend/src/product/GetProduct.jsx index 36df258..afc2e3e 100644 --- a/frontend/src/product/GetProduct.jsx +++ b/frontend/src/product/GetProduct.jsx @@ -3,7 +3,6 @@ import Layout from '../homepage/Layout' import { Link, useParams } from 'react-router-dom' import { useDispatch, useSelector } from 'react-redux' import { loadProductData, searchProduct } from '../features/actions/productActions' -import { BaseUrl } from '../backend' import { timeAgo } from '../helper' import Loading from '../helper/Loading' import { unwrapResult } from '@reduxjs/toolkit'; @@ -79,7 +78,7 @@ const GetProduct = () => {
- +
diff --git a/frontend/src/product/ProductList.jsx b/frontend/src/product/ProductList.jsx index d1bf377..b0ebff0 100644 --- a/frontend/src/product/ProductList.jsx +++ b/frontend/src/product/ProductList.jsx @@ -1,7 +1,6 @@ import React from 'react' import { Link } from 'react-router-dom' import { timeAgo } from '../helper' -import { BaseUrl } from '../backend' import WishlistButton from './Component/WishlistButton' import CartButton from './Component/CartButton' import BuyNowButton from './Component/BuyNowButton' diff --git a/frontend/src/product/RelatedProduct.jsx b/frontend/src/product/RelatedProduct.jsx index 036cfa7..8649cc5 100644 --- a/frontend/src/product/RelatedProduct.jsx +++ b/frontend/src/product/RelatedProduct.jsx @@ -1,6 +1,5 @@ import React from 'react' import { Link } from 'react-router-dom' -import { BaseUrl } from '../backend' import { timeAgo } from '../helper' import WishlistButton from './Component/WishlistButton' @@ -18,7 +17,7 @@ const RelatedProduct = ({ data }) => {
- Default Product + Default Product
diff --git a/frontend/src/product/UpdateModal.jsx b/frontend/src/product/UpdateModal.jsx index fbb6a3c..207dc05 100644 --- a/frontend/src/product/UpdateModal.jsx +++ b/frontend/src/product/UpdateModal.jsx @@ -1,12 +1,10 @@ -import React, { useEffect, useState, useCallback } from 'react' +import React, { useEffect, useState} from 'react' import { useDispatch, useSelector } from 'react-redux'; import { useNavigate, useParams } from 'react-router-dom'; -import { loadAllProduct, loadProductData, updateProductData } from '../features/actions/productActions'; +import { loadAllProduct, updateProductData } from '../features/actions/productActions'; import { unwrapResult } from '@reduxjs/toolkit'; import Swal from 'sweetalert2'; import DatePicker from 'react-datepicker' -import { loadCategory } from '../features/actions/categoryActions'; -import { resetProductData } from '../features/slices/productSlice'; import Loading from '../helper/Loading'; import { CKEditor } from '@ckeditor/ckeditor5-react'; import ClassicEditor from '@ckeditor/ckeditor5-build-classic'; diff --git a/frontend/src/product/UpdatePage.jsx b/frontend/src/product/UpdatePage.jsx index 4fd80ef..16275f3 100644 --- a/frontend/src/product/UpdatePage.jsx +++ b/frontend/src/product/UpdatePage.jsx @@ -1,8 +1,7 @@ import React, {useEffect, useState } from 'react' -import { useDispatch, useSelector } from 'react-redux'; +import { useSelector } from 'react-redux'; import { useParams } from 'react-router-dom'; import Layout from '../homepage/Layout'; -import { BaseUrl } from '../backend'; import UpdateModal from './UpdateModal'; import Loading from '../helper/Loading'; @@ -148,7 +147,7 @@ const UpdatePage = () => {
-
No Product Image + No Product Image diff --git a/frontend/src/seller/OrderDashboard.jsx b/frontend/src/seller/OrderDashboard.jsx index 8325865..a42c95b 100644 --- a/frontend/src/seller/OrderDashboard.jsx +++ b/frontend/src/seller/OrderDashboard.jsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react' import { useDispatch, useSelector } from 'react-redux'; -import { UpdateOrderStatus, getOrders } from '../features/actions/sellerActions'; +import { getOrders } from '../features/actions/sellerActions'; import Layout from '../homepage/Layout'; import { Watch } from 'react-loader-spinner'; import { filterOrder } from '../features/actions/orderActions'; diff --git a/frontend/src/seller/ProcessOrder.jsx b/frontend/src/seller/ProcessOrder.jsx index 188a9b8..398b169 100644 --- a/frontend/src/seller/ProcessOrder.jsx +++ b/frontend/src/seller/ProcessOrder.jsx @@ -4,7 +4,6 @@ import { Link, useParams } from 'react-router-dom'; import { UpdateOrderStatus, getOrderDetails } from '../features/actions/sellerActions'; import Layout from '../homepage/Layout'; import { Watch } from 'react-loader-spinner'; -import { BaseUrl } from '../backend'; import { mapAddressCodeToLabel, mapGenderCodeToLabel, @@ -88,7 +87,7 @@ const ProcessOrder = () => {
- product image + product image
diff --git a/frontend/src/seller/SellerDashboard.jsx b/frontend/src/seller/SellerDashboard.jsx index d37bae2..995920e 100644 --- a/frontend/src/seller/SellerDashboard.jsx +++ b/frontend/src/seller/SellerDashboard.jsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react' import { useDispatch, useSelector } from 'react-redux'; -import { Link, useNavigate } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; import Layout from '../homepage/Layout'; import { loadDashboard } from '../features/actions/sellerActions'; import Loading from '../helper/Loading'; diff --git a/frontend/src/seller/SellerProductLists.jsx b/frontend/src/seller/SellerProductLists.jsx index 46fac78..ae6f73e 100644 --- a/frontend/src/seller/SellerProductLists.jsx +++ b/frontend/src/seller/SellerProductLists.jsx @@ -2,9 +2,7 @@ import React, { useEffect, useState } from 'react' import Layout from '../homepage/Layout' import { useDispatch, useSelector } from 'react-redux' import { loadProductList } from '../features/actions/sellerActions'; -import { BaseUrl } from '../backend'; import { Link, useNavigate } from 'react-router-dom'; -import UpdateModal from '../product/UpdateModal'; import Loading from '../helper/Loading'; const SellerProductLists = () => { @@ -31,14 +29,6 @@ const SellerProductLists = () => { ) } - - const showModalHandler = () => { - setShowModal(true); - }; - const hideModalHandler = () => { - setShowModal(false); - }; - return ( diff --git a/frontend/src/user/Profile.js b/frontend/src/user/Profile.js index 21c161a..6b97862 100644 --- a/frontend/src/user/Profile.js +++ b/frontend/src/user/Profile.js @@ -4,7 +4,6 @@ import { Link, useNavigate } from 'react-router-dom'; import Layout from '../homepage/Layout'; import { laodProfile } from '../features/actions/authActions'; import { deleteAddress, loadAddress } from '../features/actions/addressAction'; -import { BaseUrl } from '../backend'; import { formateDate, mapAddressCodeToLabel, mapGenderCodeToLabel } from '../helper'; const Profile = () => { @@ -57,7 +56,6 @@ const Profile = () => {
{/* src={`${BaseUrl}/${user.profile_pic}`} */} {user.profile_pic ? ( - // src="https://lavinephotography.com.au/wp-content/uploads/2022/09/Fam_Kids024-1.jpg" Profile diff --git a/frontend/src/user/Signup.js b/frontend/src/user/Signup.js index f2e8087..3ac8b24 100644 --- a/frontend/src/user/Signup.js +++ b/frontend/src/user/Signup.js @@ -5,7 +5,6 @@ import { signup } from '../features/actions/authActions'; import { useDispatch, useSelector } from 'react-redux'; import Swal from 'sweetalert2'; import { unwrapResult } from '@reduxjs/toolkit'; -import { Watch } from 'react-loader-spinner'; import GoogleLoginButton from './SocialAuth/GoogleButton'; import Loading from '../helper/Loading'; diff --git a/frontend/src/user/helper/userapicalls.js b/frontend/src/user/helper/userapicalls.js index 094fae5..6ed7b3a 100644 --- a/frontend/src/user/helper/userapicalls.js +++ b/frontend/src/user/helper/userapicalls.js @@ -16,8 +16,7 @@ export const signin = async (user) => { method: "POST", body: formData, }); - const data = await response.json(); // Extract JSON data from the response - // console.log("Success from userapi...", data); + const data = await response.json(); return data; } catch (err) { diff --git a/frontend/src/useraction/cart/UserCart.jsx b/frontend/src/useraction/cart/UserCart.jsx index 2da1503..cf73fae 100644 --- a/frontend/src/useraction/cart/UserCart.jsx +++ b/frontend/src/useraction/cart/UserCart.jsx @@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { addToCart, loadCart, removeFromCart } from '../../features/actions/cartAction'; import Layout from '../../homepage/Layout'; -import { BaseUrl } from '../../backend'; import { Link } from 'react-router-dom'; const UserCart = () => { @@ -64,7 +63,7 @@ const UserCart = () => {
- product image + product image
diff --git a/frontend/src/useraction/order/OrderDetail.jsx b/frontend/src/useraction/order/OrderDetail.jsx index 2dc4ddb..ffc43d1 100644 --- a/frontend/src/useraction/order/OrderDetail.jsx +++ b/frontend/src/useraction/order/OrderDetail.jsx @@ -1,10 +1,8 @@ import React, { useEffect } from 'react' import Layout from '../../homepage/Layout' import { useDispatch, useSelector } from 'react-redux' -import { BaseUrl } from '../../backend' import { useParams } from 'react-router-dom' import { cancelOrReturnOrder, loadOrderData } from '../../features/actions/orderActions' -import { Watch } from 'react-loader-spinner'; import { Link } from 'react-router-dom'; import { mapAddressCodeToLabel, @@ -58,7 +56,7 @@ const OrderDetail = () => {
- product + product
diff --git a/frontend/src/useraction/order/OrderFromCart.jsx b/frontend/src/useraction/order/OrderFromCart.jsx index 3a9f5ca..db92076 100644 --- a/frontend/src/useraction/order/OrderFromCart.jsx +++ b/frontend/src/useraction/order/OrderFromCart.jsx @@ -1,32 +1,23 @@ import React, { useEffect, useState } from 'react' import { useDispatch, useSelector } from 'react-redux'; -import Layout from '../../homepage/Layout'; -import { Link, useLocation, useNavigate, useParams } from 'react-router-dom'; -import { loadProductData } from '../../features/actions/productActions'; -import { BaseUrl } from '../../backend'; +import { Link, useNavigate} from 'react-router-dom'; import { loadAddress } from '../../features/actions/addressAction'; import { buyAll } from '../../features/actions/orderActions'; import { unwrapResult } from '@reduxjs/toolkit'; import { CompletePaymentForAll, InitiatePaymentForAll } from '../../features/actions/paymentAction'; import useRazorpay from "react-razorpay"; import Swal from 'sweetalert2'; -import { Watch } from 'react-loader-spinner' import { mapAddressCodeToLabel } from '../../helper'; +import Loading from '../../helper/Loading'; const OrderFromCart = () => { const [Razorpay] = useRazorpay(); const dispatch = useDispatch(); const navigate = useNavigate(); - const [add, setAdd] = useState(0); - const [remove, setRemove] = useState(0); const [addressdata, setAddress] = useState(""); const [paymentMode, setPaymentMode] = useState(""); - - const { pathname } = useLocation(); - const { uid } = useParams(); - const { isAuthenticated, redirect, user } = useSelector((state) => state.auth); const { address } = useSelector((state) => state.address); @@ -46,8 +37,8 @@ const OrderFromCart = () => { }, [isAuthenticated, dispatch]); - const { product, loading } = useSelector((state) => state.product); - const { payment_loading, payments, error } = useSelector((state) => state.payment); + const { loading } = useSelector((state) => state.product); + const { payment_loading, } = useSelector((state) => state.payment); const [checked, setChecked] = useState(false); @@ -73,15 +64,12 @@ const OrderFromCart = () => { if (paymentMode === "") { alert("Select Payment Mode.") } - console.log("submit clicked!") - console.log("address...", addressdata); - console.log("payment mode... ", paymentMode); + const res1 = await dispatch(buyAll({ address: addressdata, payment_mode: paymentMode })); const res = await unwrapResult(res1); - console.log("order res..", res); if (!res.errors) { if (paymentMode === 'ONL') { @@ -91,7 +79,6 @@ const OrderFromCart = () => { const payment_res = await dispatch(InitiatePaymentForAll({ orders: orders, amount: amount })); const response = await unwrapResult(payment_res); - console.log("response1...", response); if (response.success) { var order_id = response.data.razorpay_order_id @@ -109,7 +96,6 @@ const OrderFromCart = () => { signature: response.razorpay_signature, amount: amount })) - console.log("complete response...", response); Swal.fire({ icon: 'success', title: 'Orders Placed Successfully.', @@ -124,7 +110,7 @@ const OrderFromCart = () => { contact: user.phone, }, notes: { - address: "B P Mandal Colllege of engineering, Madhepura", + address: "XYZ, 2229992, Singapore", }, theme: { color: "#3399cc", @@ -166,20 +152,9 @@ const OrderFromCart = () => { } - if (loading) { + if (loading || payment_loading) { return ( -
- -
+ ) } return ( diff --git a/frontend/src/useraction/order/OrderList.jsx b/frontend/src/useraction/order/OrderList.jsx index 89b0f21..9c22851 100644 --- a/frontend/src/useraction/order/OrderList.jsx +++ b/frontend/src/useraction/order/OrderList.jsx @@ -1,11 +1,11 @@ import React, { useEffect } from 'react' import { useDispatch, useSelector } from 'react-redux' -import { BaseUrl } from '../../backend'; import Layout from '../../homepage/Layout'; import { loadOrder } from '../../features/actions/orderActions'; import { Watch } from 'react-loader-spinner'; import { Link } from 'react-router-dom'; import { mapOrderStatusToLabel, mapPaymentStatusToLabel,mapPaymentCodeToLabel } from '../../helper'; +import Loading from '../../helper/Loading'; @@ -22,20 +22,7 @@ const OrderList = () => { if (order_loading) { return ( - -
- -
- + ) } diff --git a/frontend/src/useraction/order/OrderSummary.jsx b/frontend/src/useraction/order/OrderSummary.jsx index bbfe899..fe19e4e 100644 --- a/frontend/src/useraction/order/OrderSummary.jsx +++ b/frontend/src/useraction/order/OrderSummary.jsx @@ -3,14 +3,13 @@ import { useDispatch, useSelector } from 'react-redux'; import Layout from '../../homepage/Layout'; import { Link, useLocation, useNavigate, useParams } from 'react-router-dom'; import { loadProductData } from '../../features/actions/productActions'; -import { BaseUrl } from '../../backend'; import { loadAddress } from '../../features/actions/addressAction'; import { createOrder } from '../../features/actions/orderActions'; import { unwrapResult } from '@reduxjs/toolkit'; import { CompletePayment, InitiatePayment } from '../../features/actions/paymentAction'; import useRazorpay from "react-razorpay"; import Swal from 'sweetalert2'; -import { Watch } from 'react-loader-spinner' +import Loading from '../../helper/Loading'; const OrderSummary = () => { @@ -31,6 +30,7 @@ const OrderSummary = () => { useEffect(() => { document.title = 'Order summary'; }, []); + useEffect(() => { if (isAuthenticated) { dispatch(loadProductData({ uid })); @@ -54,7 +54,7 @@ const OrderSummary = () => { const { product, loading } = useSelector((state) => state.product); - const { payment_loading, payments, error } = useSelector((state) => state.payment); + const { payment_loading } = useSelector((state) => state.payment); const removeItem = () => { if (quantity > 1) { @@ -93,36 +93,14 @@ const OrderSummary = () => { if (product.length === 0 || loading) { return ( -
- -
+ ) } const onSubmit = async () => { if (payment_loading) { return ( -
- -
+ ) } if (addressdata === "") { @@ -184,7 +162,7 @@ const OrderSummary = () => { contact: user.phone, }, notes: { - address: "B P Mandal Colllege of engineering, Madhepura", + address: "XYZ, 8877667, Singapore", }, theme: { color: "#3399cc", @@ -192,7 +170,6 @@ const OrderSummary = () => { }; const rzp1 = new Razorpay(options); - // console.log("rzp1..", rzp1); rzp1.on("payment.failed", function (response) { Swal.fire({ icon: 'error', @@ -261,7 +238,7 @@ const OrderSummary = () => {
- product + product
diff --git a/frontend/src/useraction/wishlist/Wishlist.jsx b/frontend/src/useraction/wishlist/Wishlist.jsx index becd547..510dcc0 100644 --- a/frontend/src/useraction/wishlist/Wishlist.jsx +++ b/frontend/src/useraction/wishlist/Wishlist.jsx @@ -1,7 +1,6 @@ import React, { useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { loadWishlist, removeFromWishlist } from '../../features/actions/wishlistAction'; -import { BaseUrl } from '../../backend'; import { addToCart } from '../../features/actions/cartAction'; import Layout from '../../homepage/Layout'; @@ -44,7 +43,7 @@ const Wishlist = () => {
- product image + product image
From 939af13de6c8b0cc17c64a9c61bee664126368a9 Mon Sep 17 00:00:00 2001 From: as4c Date: Fri, 8 Mar 2024 22:14:52 +0530 Subject: [PATCH 4/6] backend ready --- Backend/backend/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Backend/backend/settings.py b/Backend/backend/settings.py index 5db3ec6..4994064 100644 --- a/Backend/backend/settings.py +++ b/Backend/backend/settings.py @@ -25,7 +25,7 @@ SECRET_KEY = 'django-insecure-x*ykqto7f*@*#nmi*_l2ametk2rw@_q3wrhwq_xm!_0%4768z9' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = False ALLOWED_HOSTS = ['*'] From a7fd4ac66963a866347f8abee844f018ecb67cac Mon Sep 17 00:00:00 2001 From: as4c Date: Fri, 8 Mar 2024 23:19:37 +0530 Subject: [PATCH 5/6] push to production --- .gitignore | 4 +--- Backend/api/__pycache__/views.cpython-310.pyc | Bin 444 -> 407 bytes Backend/api/views.py | 2 +- .../__pycache__/settings.cpython-310.pyc | Bin 6166 -> 6235 bytes .../backend/__pycache__/urls.cpython-310.pyc | Bin 522 -> 576 bytes Backend/backend/settings.py | 4 +++- Backend/backend/urls.py | 3 ++- README.md | 2 +- frontend/src/category/AddCategory.js | 6 +----- frontend/src/category/Categories.jsx | 2 +- .../src/features/actions/paymentAction.js | 1 - frontend/src/product/UpdatePage.jsx | 16 +--------------- frontend/src/seller/SellerProductLists.jsx | 7 +++---- .../src/useraction/address/AddAddress.jsx | 1 - frontend/src/useraction/order/OrderList.jsx | 3 +-- 15 files changed, 15 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index 7b7dcdc..831cf37 100644 --- a/.gitignore +++ b/.gitignore @@ -3,12 +3,10 @@ *.sqlite3 -*.cpp -*.txt - *node_modules *.bin *db.sqlite3 db.sqlite3 *.vscode vscode +*media diff --git a/Backend/api/__pycache__/views.cpython-310.pyc b/Backend/api/__pycache__/views.cpython-310.pyc index 018c5a49d7003ee9fbc46002558ecd24b1001406..625bea28bb3f10db891e3a787ed7c5434f42c2bb 100644 GIT binary patch delta 133 zcmdnPJe`?0pO=@50SNSbU#D)I$Xo8o4CFWiaWM~&C}BupOkv7oY-S8*&}8 z$x6&i&sQi)O-wFPaL&(7$}d*%$j?o!5(-XCPb^aKF3km!!HK!4sYRMhw^%as((-Sy z-08E>%{r52W^7MHAKDB=K${0h|1O-;#6)K4rnN!FiuFNB4Uv50H38KZ$H P$Yo$PNCfBPYDO6VAAT_R diff --git a/Backend/api/views.py b/Backend/api/views.py index a0173fc..b1c7317 100644 --- a/Backend/api/views.py +++ b/Backend/api/views.py @@ -3,4 +3,4 @@ # Create your views here. def home(request): - return JsonResponse({'info':'Django react Combos Home','name': 'Sagar Kumar Sameer'}) \ No newline at end of file + return JsonResponse({'info':'This is base api.'}) \ No newline at end of file diff --git a/Backend/backend/__pycache__/settings.cpython-310.pyc b/Backend/backend/__pycache__/settings.cpython-310.pyc index 81cdb1580ce417fb722687f0483e853653b6c631..8b499b4bded4032596d9f3a20ff13427a6f54e64 100644 GIT binary patch delta 840 zcmX|<%TE(g6vnyJT1=s}rL^Tuf$}JiQr=G=1&RgAbBgFyspvNyDK9fXbk{#Xn@GmE zDu%LP;mV|OLE_Rsz#uDh>&m@}F;P#O8z!0W{LY;3%(-{&ybXK{SavKHa{*niB0rVC z2bOB~`k*bIEQUobfc2QIGh9m>RmSbG@e3S-n7J<(8!yWD`-MAd-9HzmJl*9wVFhYhd!K1|8xXyd1p%*6Jha0>f zH~E05-=g}U;2?34;IRx7G=51F^bJF410TX9ABG*b5k@hll9(j(Eb-` z|4V5JGI3P!GVvY3E5vsN-vg)YzQ`UBKNP%5925MAccKP}JCE#%oJ=^xCVvJ2NlXfn7QiN+R!OLAx_HXaGea!AhZ7k!qp z!`82ig>|cKg*0w!B|Wg6lFryi++q5GFAC@P_n>U=U6`h}b5RTHhxSTxoZ3fOIQz@~ zgR%bXcgGp?`pK_#=9(;_+2B+pwk(HY(TJ=Ca)qv(bn9o%m#j};b&Z+Ma}Un-6W1m) W>JE3zY%)qF>7VJh(W<|2zxxl6FZPK5 delta 778 zcmX|<$!imF6vy+MjAKcfnx##;rTdm{NxE+?t+p}RS~aQF=MtCibZo2@O1&tOi#MA? z8Sxaf=|%8p5cD7j9=$aOp@KIN#J@mLd=q|jV7~A3=6&D1H_Nxki-_xi%jK}~@#OC> z{mZs1D7LnHRx%pO4I5m$VpX6bry7DhI6_{ybuI1F?di&$DtPh&-Yh%F4<9Po=|fdX z{Ur^o3PYs;s;L?^R0EA_`K&`N)uWDre3youM%{sW1oL)kLIX8(y#63Ga>Ed&Xc$Ln1jlGp){k?2 zO!5h4r{w9pkTi2ZC;9!I%GqfgvorxW<`9F1(}?3t24^vk1)R&NSmY-^zbkMdr{E%U zLUNLMN%AG;WyzOug)@@bRpx7wuQT6}oMOIt&~b~i+cLWYAgmioY2XSB+?BkFv{72a zsK7m}<;wVDOv0Y9h3*$VDbIyS7M9dE_P1s46f@&&QbYDfQS-N>!TjoYT6pjLtcbb7 z}$q%=+5h&AR9Qz`Es`48-_1+&{eda1;9a=DrqRx8g?3{O+k^#~;s>h!sY? zKZF=A1S|JMTOa#3`mH9{?80<>KDCsXO(o|O8)2&uu_S8x{LjRY`N}_|6|Dj%G$Mn-j)PXO7}cFaFbXj8fFKJGBg;PtRsgQ& BBdY)a diff --git a/Backend/backend/settings.py b/Backend/backend/settings.py index 4994064..7eb7b6f 100644 --- a/Backend/backend/settings.py +++ b/Backend/backend/settings.py @@ -187,7 +187,9 @@ 'rest_framework.authentication.SessionAuthentication', 'rest_framework_simplejwt.authentication.JWTAuthentication', ], - + 'DEFAULT_PARSER_CLASSES': [ + 'rest_framework.parsers.JSONParser', + ] } diff --git a/Backend/backend/urls.py b/Backend/backend/urls.py index dda67ab..cac92f5 100644 --- a/Backend/backend/urls.py +++ b/Backend/backend/urls.py @@ -3,11 +3,12 @@ from django.urls import path,include from django.conf.urls.static import static from django.conf import settings - +from api.views import home urlpatterns = [ path('admin/', admin.site.urls), path('api/',include('api.urls')), + path('',include('api.urls')), ] urlpatterns += static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT) diff --git a/README.md b/README.md index 582ed35..77ae6e7 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ This is an eCommerce web application built with Django and React.js. It utilizes - Frontend: - React.js: JavaScript library for building interactive user interfaces. - React Router Dom: Library for handling client-side routing in a React application. - + - React Redux Toolkit: Library for Managing states. ## Installation and Setup 1. Clone the repository: diff --git a/frontend/src/category/AddCategory.js b/frontend/src/category/AddCategory.js index 0912d0d..d1d8f4d 100644 --- a/frontend/src/category/AddCategory.js +++ b/frontend/src/category/AddCategory.js @@ -4,14 +4,10 @@ import { useDispatch } from 'react-redux'; import { createCategory } from '../features/actions/categoryActions'; import { unwrapResult } from '@reduxjs/toolkit'; import Swal from 'sweetalert2'; -import { useLocation, useNavigate } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; const AddCategory = () => { - - const location = useLocation(); - // console.log("location...", location); - const [values, setValues] = useState({ name: "", description: "", diff --git a/frontend/src/category/Categories.jsx b/frontend/src/category/Categories.jsx index e85466b..21f0845 100644 --- a/frontend/src/category/Categories.jsx +++ b/frontend/src/category/Categories.jsx @@ -1,6 +1,6 @@ import React, { useEffect, useState, useRef } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { Link, useNavigate } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; import { loadCategory } from '../features/actions/categoryActions'; const Categories = () => { diff --git a/frontend/src/features/actions/paymentAction.js b/frontend/src/features/actions/paymentAction.js index 0b2eea4..60beff3 100644 --- a/frontend/src/features/actions/paymentAction.js +++ b/frontend/src/features/actions/paymentAction.js @@ -1,5 +1,4 @@ -import Swal from 'sweetalert2'; import { API } from '../../backend'; import { createAsyncThunk } from "@reduxjs/toolkit"; diff --git a/frontend/src/product/UpdatePage.jsx b/frontend/src/product/UpdatePage.jsx index 16275f3..5a124f0 100644 --- a/frontend/src/product/UpdatePage.jsx +++ b/frontend/src/product/UpdatePage.jsx @@ -22,9 +22,7 @@ const UpdatePage = () => { const { uid } = useParams(); - const { data } = useSelector((state) => state.category); - - const { loading, list, error } = useSelector( + const { loading, list} = useSelector( (state) => state.seller ); const product = list.filter(product => product.uid === uid); @@ -93,18 +91,6 @@ const UpdatePage = () => { setShowDate(true); } - const renderDetailRow = (label, value) => ( -
- -

{label}:

{value} - - - - - - ); return ( diff --git a/frontend/src/seller/SellerProductLists.jsx b/frontend/src/seller/SellerProductLists.jsx index ae6f73e..cac08c8 100644 --- a/frontend/src/seller/SellerProductLists.jsx +++ b/frontend/src/seller/SellerProductLists.jsx @@ -6,8 +6,7 @@ import { Link, useNavigate } from 'react-router-dom'; import Loading from '../helper/Loading'; const SellerProductLists = () => { - const [showModal, setShowModal] = useState(false); - + const dispatch = useDispatch(); const navigate = useNavigate(); @@ -23,7 +22,7 @@ const SellerProductLists = () => { navigate(`/user/seller/update-product/${uid}`) } - if (list.length === 0) { + if (list.length === 0 || loading) { return ( ) @@ -56,7 +55,7 @@ const SellerProductLists = () => { - No Product Image + No Product pic diff --git a/frontend/src/useraction/address/AddAddress.jsx b/frontend/src/useraction/address/AddAddress.jsx index e6cf382..1b830cf 100644 --- a/frontend/src/useraction/address/AddAddress.jsx +++ b/frontend/src/useraction/address/AddAddress.jsx @@ -1,6 +1,5 @@ import React, { useEffect, useState } from 'react' import { createAddress } from '../../features/actions/addressAction'; -import Swal from 'sweetalert2'; import { useNavigate } from 'react-router-dom'; import { unwrapResult } from '@reduxjs/toolkit'; import { useDispatch } from 'react-redux'; diff --git a/frontend/src/useraction/order/OrderList.jsx b/frontend/src/useraction/order/OrderList.jsx index 9c22851..6c5d9f9 100644 --- a/frontend/src/useraction/order/OrderList.jsx +++ b/frontend/src/useraction/order/OrderList.jsx @@ -2,7 +2,6 @@ import React, { useEffect } from 'react' import { useDispatch, useSelector } from 'react-redux' import Layout from '../../homepage/Layout'; import { loadOrder } from '../../features/actions/orderActions'; -import { Watch } from 'react-loader-spinner'; import { Link } from 'react-router-dom'; import { mapOrderStatusToLabel, mapPaymentStatusToLabel,mapPaymentCodeToLabel } from '../../helper'; import Loading from '../../helper/Loading'; @@ -45,7 +44,7 @@ const OrderList = () => {
- product + product
From 4f2c1f249ca914f75395fcfe2feb2548905091e2 Mon Sep 17 00:00:00 2001 From: as4c Date: Wed, 3 Jul 2024 17:27:18 +0530 Subject: [PATCH 6/6] dockerized --- .../__pycache__/serializers.cpython-310.pyc | Bin 6795 -> 6755 bytes .../__pycache__/views.cpython-310.pyc | Bin 11236 -> 11441 bytes Backend/api/accounts/serializers.py | 5 ---- Backend/api/accounts/views.py | 7 +++-- .../__pycache__/settings.cpython-310.pyc | Bin 6235 -> 6271 bytes Backend/backend/settings.py | 26 +++++++++--------- 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/Backend/api/accounts/__pycache__/serializers.cpython-310.pyc b/Backend/api/accounts/__pycache__/serializers.cpython-310.pyc index 3618d23c813f3af4b5646d22e59e101a2cad52f0..3dcd50130e9e5d9a92f9aadce7aab0375e1509b6 100644 GIT binary patch delta 457 zcmXw!%_{_99LMKt?e6UE%z+z|BoL?L~5PRs5cn=jr+M`~Kdaqy9=l+fvn_#OE^cxqe;$pv6N#c|3Fi zjM0nIiz59ftr(_Ob)YZpb$q7e`qMtg?|5>-wEx26%7su#apWsNa*&h?YDr78DxxPq z$Lb_~s4l{k)kf)F%a{{9D&NcqLWjmzK?E`=7IraGz6XVv&{_TH04w+g$>)0{rqa zLzZM7Z`9heE7UNnq4QX}TY!dMttOL*#Oq@f1- znGvez08$9=rNBH(dhv7EhCU5kir?W5W7+~ zMR_B@ee+9pk{tOtf(90tv~@WpYoN*)O*Wv=+DX0yaPepA7T)5I^f7VT>V;3ZWu0W_ zsBV!P@L;NBgAHaxkBB)uirYBcc@1B&+rCtmDBZw6_G*EnE5mhHD&%mbRH?YG=ppR^ zA2@o>m?zZe_$on_R5E6Fi20Uyq5w3p-c=m@%XA}e;JN?EsC4HHY0a0svzi~!j0dtvRdY=n~X)-x^9rQ8GZpmwAH diff --git a/Backend/api/accounts/__pycache__/views.cpython-310.pyc b/Backend/api/accounts/__pycache__/views.cpython-310.pyc index 00fe14d4a9f0bb3516bbe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^5g|QXj^tU;4M$ACNpz6kBvoipipo6g#DUU6vsjYW3+83XE6l0W5U|pv zT7`j^9C=(YjSSW#XYq>fmv;>pa>!d1{Di}>&)b5pOZ&=>5DTTG`q}=q!Yf8MeaI~5 zjC=$uk(K4tnx4aYWc^Jxy`lGRR`RCgpiMMZwL& zY;dK-l=;pTa(E|Z=8}`~(id0t88Kph^L#Ju)RJ(O9eVCA cFn`r$g=Q|)hpQBaA~d1?Q;*bu`M&8JOBUy delta 666 zcmX|<%TH556vjLEUN2JHLTO8dQYbI6RG}(wPW;1dfx%5(yE1X(%8hs+6J|1#-#6cxGtcArkGQ+&b~_zh-Y0(<|H|&L z_)v~z2VHQR4tVxOPN2coOhH~WQWLy}p7$AQ-oF<>Q$@hH%MsLEJ`Ak~(Lxu|N-c0v zE4L6r)P^<+b9nn+hv7sR?G=?G=%7yayAa{D-KTvIBIq;~>g7ed_6534fgW3-OX#IO zYe4kvT*eSZF--j!p%_N#irmClMbK5r$pib zIDQB^4dWJ#;5Lm)f13R<$ukwPLl>l&tq4hTXO!TZn736L#{x~ji#xar7w+Lc7Lmjf zmXWeGJmAAU{)qtvwJnWg#aV*PK;n)YO@Po93=KbK6U6V>mYhI3-d`sw=`&@;tCHfPrA xjKX%VR4mj~(|A`s@NWpKvH6dF#ED8rR()_wXx4Tx=G1*op&fJeTVI0T{sZ9w#8UtO diff --git a/Backend/backend/settings.py b/Backend/backend/settings.py index 7eb7b6f..8acc5e3 100644 --- a/Backend/backend/settings.py +++ b/Backend/backend/settings.py @@ -25,7 +25,7 @@ SECRET_KEY = 'django-insecure-x*ykqto7f*@*#nmi*_l2ametk2rw@_q3wrhwq_xm!_0%4768z9' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False +DEBUG = True ALLOWED_HOSTS = ['*'] @@ -101,23 +101,23 @@ # Database # https://docs.djangoproject.com/en/4.1/ref/settings/#databases -# DATABASES = { -# 'default': { -# 'ENGINE': 'django.db.backends.sqlite3', -# 'NAME': BASE_DIR / 'db.sqlite3', -# } -# } +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} -DATABASES = { - 'default': dj_database_url.config( - default=os.environ.get('DB_URL') - ) -} +# DATABASES = { +# 'default': dj_database_url.config( +# default=os.environ.get('DB_URL') +# ) +# } # 'default': { # 'ENGINE': 'django.db.backends.postgresql', # 'NAME': os.environ.get('DATABASE_NAME'), @@ -245,7 +245,7 @@ # Cloudinary config CLOUDINARY_STORAGE = { - 'CLOUD_NAME' : os.environ.get('CLOUDNARY_CLOUD_NAME'), + 'CLOUD_NAME' : os.environ.get('CLOUDINARY_CLOUD_NAME'), 'API_KEY' : os.environ.get('CLOUDINARY_API_KEY'), 'API_SECRET' : os.environ.get('CLOUDINARY_API_SECRET') }