Season 2 on Lama Dev
safak / youtube2022 Goto Github PK
View Code? Open in Web Editor NEWSeason 2 on Lama Dev
Season 2 on Lama Dev
when is the update coming?
and whether there will be a continuation of the project? Thanks!
Solution:
Open postman and send post request to below link
http://localhost:8800/api/auth/register
Request body:
{
"username": "admin",
"email": "[email protected]",
"password": "admin",
"phone": "123456789",
"country": "Azerbaijan",
"city": "Baku",
"isAdmin": true
}
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
Follow the video steps, but click the Register User button, and an error occurs.
i am using vite for react js and while requesting cookies with token name it shows undefined
gives an Axios error when i click for the payment button, strip log says invalid_request_error - line_items[0]
Quantity is required. Add quantity to line_items[0]
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.
@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
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
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:
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.
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.");
});
});
};
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
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.
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.
Browser is not setting cookies after login in MERN booking app.
Will we get course about project like YouTube?
Thanks
@safak
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
"Cannot read properties of undefined (reading 'access_token')"
I can't seem to get pass this error.
When I add the proxy in package.json." options.allowedHosts[0] should be a non-empty string." This error will occur.
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.
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
The callback that is being passed to verifyToken() function in verifyToken.js line number 18 will never be called. My question is why is that callback function there if it's never get called?
why ami getting this error, each time a user wants to create account
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)
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
hey am getting null in Body whem m creating a room on localhost:8000/api/rooms/62c46f3f91f674fa88d91bb2
something like this:
const { isLoading, error, data } = useQuery( ["user", currentUser.id], async () => { const response = await makeRequest.get("/users/find/" + userId); return response.data; } );
When I tried to click on the Register button(after placing the URL) it throw these error...
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}
<input placeholder={destination} type="text" />
We have only created a input field and not using it while searching.
Uncaught (in promise) FirebaseError: No document to update: projects/message-eb542/databases/(default)/documents/chats/null
Inside
Repo = mern-booking
PATH = api > utils > verifyToken.js > on line 28
How the function "verifyToken" can accept 4 argument . If it define with only 3 parameters? 🤔
//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!!!!!
At 2:01:21 of the youtube video https://youtu.be/k4mjF4sPITE?t=7282, notice when he types in an input the userChats names on the left sidebar (i.e. John and Adam) re-orders momentarily before snapping back to the correct sorted arrangement by date. I've been trying to debug this for the longest time, any idea how to prevent it?
TypeError: Cannot read properties of undefined (reading 'map')
Getting this error in Categories.jsx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.