Posts

Showing posts from August, 2022

How to install MinGW in 2022 | How to install c compiler for windows.| How to set path for c compiler minGW

Image
 1.Go to search bar and type MinGW (https://sourceforge.net/projects/mingw/) click on first link. 2.Click on the download button. 3.Click on 1 button then install the exe file.After click on 2 button 4.Click on Continue(step-1). 6.Click on continue(step-2) 7.Check all boxes for mark for installation 8.Click on Apply changes 9. Apply (Applying changes take time to be patient) 10.Click on close . Your compiler is installed ! 11. So after installing the MinGW compiler we can set the environment variables. Go to the C:\MinGW\bin directory 12.Click on search bar search environment variables  13.Double click on path click on new =>paste the path. 15.click on new =>paste the path. 16.Click on all the ok buttons. Your path is set ! Go to the cmd and type  PS C:\Users\Lenovo> g++ --version The output will be:: PS C :\Users\Lenovo\Desktop\c> g++ --version g++. exe (MinGW.org GCC- 6.3.0 - 1 ) 6.3.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free s...

#46 Adding MongoDB Database to Codeswear.com | NextJs Tutorial for Beginners #codewithharry

First create the models folder in codeswear.com under models create three files Order.js , Product.js , User.js  Order.js // getting-started.js const mongoose = require ( 'mongoose' ); const OrderSchema = new mongoose . Schema ({     userId : { type : String , required : true },     products : [{             productsId : { type : String },             quantity : { type : Number , default : 1 }         } ],     address : { type : String , required : true },     amount : { type : Number ,   required : true },     status : { type : String , default : 'Pending' , required : true },   }, { timestamps : true });   export default mongoose . model ( "Order" , OrderSchema ); Product.js // getting-started.js const mongoose = require ( 'mongoose' ); const ProductSchema = new mongoose . Schema ({     title : ...

#45 Creating Login & Signup Page Design for Codeswear.com | NextJs Tutorial for Beginners #codewithharry

 login.js import React from 'react' import Link from 'next/link' const Login = () => {   return (     < div className = "min-h-full flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8" >       < div className = "max-w-md w-full space-y-8" >         < div >           < img className = "mx-auto h-12 w-auto" src = "images.png" alt = "Workflow" />           < h2 className = "mt-6 text-center text-3xl font-extrabold text-gray-900" > Login to your account </ h2 >           < p className = "mt-2 text-center text-sm text-gray-600" >             Or             < a href = "/signup" className = "font-medium text-pink-600 hover:text-pink-500" > Sign up </ a >           </ p >       ...

#44 Creating Orders Page for Codeswear.com | NextJs Tutorial for Beginners #codewithharry

order.js import React from 'react' const Order = () => {   return (     < section className = "text-gray-600 body-font overflow-hidden" >       < div className = "container px-5 py-24 mx-auto" >         < div className = "lg:w-4/5 mx-auto flex flex-wrap" >           < div className = "lg:w-1/2 w-full lg:pr-10 lg:py-6 mb-6 lg:mb-0" >             < h2 className = "text-sm title-font text-gray-500 tracking-widest" > CODESWEAR.COM </ h2 >             < h1 className = "text-gray-900 text-3xl title-font font-medium mb-4" > Order id: #77733 </ h1 >             < p className = "leading-relaxed mb-4" > Your order has been successfully placed. </ p >             < div className = "flex mb-4" >         ...

#43 Improving Sidebar & Checkout Page for Codeswear.com | NextJs Tutorial for Beginners

 _app.js import { useEffect , useState } from 'react' import Footer from '../components/Footer' import Navbar from '../components/Navbar' import '../styles/globals.css' function MyApp ({ Component , pageProps }) {   const [ cart , setCart ] = useState ({})   const [ subTotal , setSubTotal ] = useState ( 0 )   useEffect (() => {     console . log ( "Hey I am a useEffect form _app.js" )     try {       if ( localStorage . getItem ( "cart" )) {         setCart ( JSON . parse ( localStorage . getItem ( "cart" )))         saveCart ( JSON . parse ( localStorage . getItem ( "cart" )))       }     } catch ( error ) {       console . error ( error );       localStorage . clear ()     }   }, [])   const saveCart = ( myCart ) => {     localStorage . setItem ( "cart" , JSON . stringify ( myCart ...