Code Monkey home page Code Monkey logo

youtube2022's Introduction

youtube2022

Season 2 on Lama Dev

youtube2022's People

Contributors

safak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

youtube2022's Issues

how to deploy the booking app?

hi, i'm still new with react. i was wondering how to deploy the app? i'm trying to build my own booking app project and i want to create a production app just for demo.

Undefine Context Values on refresh

@safak Hello sir, I'm not sure whether I'm the only one experiencing this but when I refresh my context value are becoming undefined. Also, I have cloned the whole project and am still getting the error in both chrome and Mozilla browsers. Kindly help I can't find a way around it ...day 2

res.cookie

Browser is not setting cookies after login in MERN booking app.

Internet connection and using then on the social-app branch (React)

  • You need to be connected to the internet in order to use react-query.
  • You may also encounter issues when you use then when fetching data, To fix this you can use async instead.

something like this:
const { isLoading, error, data } = useQuery( ["user", currentUser.id], async () => { const response = await makeRequest.get("/users/find/" + userId); return response.data; } );

Showing no database selected in postman

Screenshot 2023-02-12 204414

connect.js
import mysql from "mysql";

export const db = mysql.createConnection({
host: "localhost",
user: "root",
password: "root123",
databse: "social",
});

auth.js
import { db } from "../connect.js";
import bcrypt from "bcryptjs";

export const register = (req, res) => {
//CHECK USER IF EXISTS
const q = "SELECT * FROM users WHERE username = ?";

db.query(q, [req.body.username], (err, data) => {
if(err) return res.status(500).json(err);
if(data.length) return res.status(409).json("User Already Exist!");

//CREATE NEW USER
//HASH PASSWORD
const salt = bcrypt.genSaltSync(10);
const hashedPassword = bcrypt.hashSync(req.body.password, salt);

const q =
  "INSERT INTO users ( `username` , `email`, `password`, `name` ) VALUE (?)";

const values = [
  req.body.username,
  req.body.email,
  hashedPassword,
  req.body.name,
];

db.query(q, [values], (err, data) => {
  if(err) return res.status(500).json(err);
  return res.status(200).json("User has been created.");
});

});
};

Destination in List.jsx

<input placeholder={destination} type="text" />
We have only created a input field and not using it while searching.

Display/show the details of the hotels

Thank you for this good tutorial I am new in react i want to Display/show the details of the hotels in the dashbord or that of the users its my to exceed someone to help me please

Unhandled isAdmin and Missing token Exception

Dear Lama,

I admire your work and it's really awsm. Thank you for your efforts. However I would like you to validate one exception from the tokens code. When i tried the same code , i am not able to resolve it .

In the verifyAdmin utility you are passing the next parameter to verifyToken method which verifies the token. If we try to access any restricted route it is showing proper error if token is missing or invalid. But when it comes to admin restricted routes it's not validating the admin conditions. The callback function for admin validation is not executing at all if you pass the next parameter. And any user can edit the things which admin only suppose to edit.

If you do not pass next then admin functionality works fine but token verification won't as expected without next.

Please have a look at this, I may be wrong at some point , if so, sorry for inconvenience. If no, thank you for time and solution.

npm init -y

I'm having an issue with npm init -y. When I try to init I get this message:

{
"name": "booking",
"version": "0.1.0",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-regular-svg-icons": "^6.1.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
"@fortawesome/react-fontawesome": "^0.1.18",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.1.1",
"@testing-library/user-event": "^13.5.0",
"date-fns": "^2.28.0",
"react": "^18.0.0",
"react-date-range": "^1.4.0",
"react-dom": "^18.0.0",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"eject": "react-scripts eject",
"test": "mocha --recursive test",
"bump-version": "npm version patch"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"description": "This project was bootstrapped with Create React App.",
"main": "index.js",
"devDependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/safak/youtube2022.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/safak/youtube2022/issues"
},
"homepage": "https://github.com/safak/youtube2022#readme"
}

Any ideas?

Thanks.

Not able to get list of users in admin dashboard.

This is the error showing in the console Failed to load resource: the server responded with a status of 401 (Unauthorized).
When I login from postman it is storing a cookie in postman, but when login from UI it is not storing any cookie in the browser and I think this is why I am able to get user data from postman but not from UI.
If you could help me to resolve this issue I would be thankful. (timestamp in video : 3:09:48)

Axios errors

Unable to recreate the app, i have tried code along twice so far, but there is axios errors for filtering posts based on follower logic
and
share post for a user.

Please update the code or kindly look into it

THE QUERY SHOWS [ ]

I AM CURRENTLY CREATING THE PROJECT SIDE BY SIDE AND WHILE I WAS TRYING TOI FETCH THE DATA FOR "GET ALL HOTELS"
I WAS ONLY ABLE TO GET ALL THE HOTELS AND WHENEVER I TRY TO SET THE LIMIT IN THE QUERY IT SHOW NULL "[ ]",I HAVE CHECKED MY CODE SO MANY TIMES AND REDONE THE STEPS ASLO NOTHING IS WRONG IN THE CODE PLSS TELL ME HOW TO SOLVE THIS ISSUE
image

Not able to hit the API :

Hello,
Thank you so much for the wonderful video first of all. Please help me with this issue, I'm stuck with this for the last 10 days, I did not get any help from the internet, not even from ChatGPT.

I have added many other features to the same project.
https://github.com/shetty-nithin/socialife_backend
https://github.com/shetty-nithin/socialife_frontend

My issue: Im trying to deploy the project on netlify, but im facing an issue.

  1. When both the front end and back end are running on the local host, both are communicating. I'm able to use the website.
  2. When the front end is deployed and the back end is running on the local host, then also it's working fine.
  3. But when the backend is deployed and the front end is running on the local host OR when both are deployed im not able to make the request from the front end

environment variables :
CLIENT_URL = https://socialife-api.netlify.app/

Frontend : https://socialife.netlify.app/login
Backend: https://socialife-api.netlify.app/
This is the error I'm getting when I try to login
image

POST http://localhost:8800/api/auth/register [HTTP/1.1 500 Internal Server Error ...AxiosError@http://localhost:3000/static

When I tried to click on the Register button(after placing the URL) it throw these error...

2023-04-04 (6)
2023-04-04 (5)
Fs23-w9acAAGOZn
Fs24AqeaAAUaaUO

And when I clicked on "[HTTP/1.1 500 Internal Server Error" link through the console, it's showing -
{"code":"ER_NOT_SUPPORTED_AUTH_MODE","errno":1251,"sqlMessage":"Client does not support authentication protocol requested by server; consider upgrading MySQL client","sqlState":"08004","fatal":true}

error: connect ECONNREFUSED while yarn develop.

honestly I really need help on this error. I have searched all around the web but still I can't solve it.
I'm stuck @ 1:43:15 in your YouTube video.

when I ran npx create-strapi-app@latest and followed your custom selection, it created a database in mySQL Workbench but got this error when I ran yarn develop:
image

Profile Picture of search.jsx, still remains expanded

The profile picture remains expanded even after copying that part of the code from GitHub to my project. Code Attached:-
`.sidebar {
flex: 1;
background-color: #3e3c61;
position: relative;

        .navbar {
            display: flex;
            align-items: center;
            background-color: #2f2d52;
            height: 50px;
            padding: 10px;
            justify-content: space-between;
            color: #ddddf7;
  
            .logo {
                font-weight: bold;
            }
  
            .user {
                display: flex;
                gap: 10px;
  
                img {
                    background-color: #ddddf7;
                    height: 24px;
                    width: 24px;
                    border-radius: 50%;
                    object-fit: cover;
                }
            }
        }
    }` The problem should be looked at as soon as possible. -PBdev

UpdateMethod

I'm taking about React×Mysql branch.
Firstly Using this axios put method, I can't keep the unchanged value.
If I want to keep its value, I have to change the value even if I want to use the same value.

I can change the value with using axios put method but need to keep the unchanged value.

Not working scroll of chats

Hey! Scroll in chat list is not working
and if I click on on of the chats (if quantity of chats more than height of form) overflow works incorrectly

getting blank page while fetching useState data from one page to another by using useNavigation and useLocation from react router

//header page functions

import { useNavigate } from 'react-router-dom';
const navigate = useNavigate();

const handleSearch=()=>
{
navigate("/hotels",{state:{person,destination,cal}});
}

//useState function items

const [person,setperson]=useState({
adults:1,
children:0,
room:1
});

const [cal, setCal] = useState([
{
startDate: new Date(),
endDate: new Date(),
key: 'selection'
}
]);

const [destination,setDestination] = useState("");

// these all data is transferred to another pages by this search button which is below

Search

// then we are directed to list.js page
import { useState } from 'react';
import { useLocation } from 'react-router-dom';

const location = useLocation();
console.log(location);

const [destination,setDestination] = useState(location.state.destination);
const [cal,setCal] = useState(location.state.cal);
const [person,setperson]= useState(location.state.person);

// then this became white blank page why i am getting error!!!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.