Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added next-auth for login #1

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
d1a10d8
feat: Add login UI
MdKAMRAN7255 Jan 30, 2024
87b34a1
feat: Add signup UI
MdKAMRAN7255 Jan 30, 2024
891f29c
feat: Add db connection, models for user
MdKAMRAN7255 Jan 30, 2024
9bac8a5
feat: Add route for signup
mdkamran25 Jan 30, 2024
57dd4c2
feat: remove npm, added yarn
MdKAMRAN7255 Jan 31, 2024
4aaed15
feat: store signup data to mongodb
MdKAMRAN7255 Jan 31, 2024
7bdd287
feat: add next-auth for login
MdKAMRAN7255 Jan 31, 2024
3217a75
refact: resolve next-auth login error
MdKAMRAN7255 Feb 1, 2024
00cea56
feat: add profile menu dropdown
MdKAMRAN7255 Feb 1, 2024
b4086b5
feat: Add Dashboard UI
MdKAMRAN7255 Feb 2, 2024
24dc5ec
Fix: Resolve comment
MdKAMRAN7255 Feb 5, 2024
dd9e73c
refact: add portal for the profile modal
MdKAMRAN7255 Feb 6, 2024
b84604c
refact: Add a layout for login and signup page since it has sharing s…
MdKAMRAN7255 Feb 6, 2024
5d81e09
refact: add svg inplace of png,
MdKAMRAN7255 Feb 6, 2024
3a0243a
refact: changes button to type submit always
MdKAMRAN7255 Feb 6, 2024
cfa106d
feat: Add game room page UI
MdKAMRAN7255 Feb 7, 2024
3f4b901
feat: Add Loading UI for dashboard
MdKAMRAN7255 Feb 8, 2024
a5eeafe
feat: add mongodb for create abd join room
MdKAMRAN7255 Feb 8, 2024
c8f46df
refac: add session in sessionProvider
MdKAMRAN7255 Feb 9, 2024
f8a3991
feat: add game login and win and lose UI
MdKAMRAN7255 Feb 12, 2024
6974341
refac: corrected portal for the result modal
MdKAMRAN7255 Feb 14, 2024
833311c
feat: Create a new collections for game records
MdKAMRAN7255 Feb 14, 2024
b268c80
feat: add draw game logic
MdKAMRAN7255 Feb 14, 2024
161cc72
refac: correct route validation for room page
MdKAMRAN7255 Feb 14, 2024
8b528e8
fix: Add socket on join game feature
MdKAMRAN7255 Feb 16, 2024
2b2fb9c
feat: Add Socket for update game board
MdKAMRAN7255 Feb 16, 2024
31b57a4
feat: Add socket for handle end game func
MdKAMRAN7255 Feb 16, 2024
23f20d7
feat: Add channel for the room
MdKAMRAN7255 Feb 16, 2024
3b383e1
feat: Add socket with room implementation
MdKAMRAN7255 Feb 19, 2024
1fd1575
refac: remove console.log
MdKAMRAN7255 Feb 19, 2024
64c4a91
feat: add .env for the port number
MdKAMRAN7255 Feb 19, 2024
894b104
refac: change static to dynamic
MdKAMRAN7255 Feb 21, 2024
025fe59
feat: add rematch
MdKAMRAN7255 Feb 21, 2024
74949d2
refac: add ts and seperate auth file because of issue at built time
MdKAMRAN7255 Feb 21, 2024
0be8138
refac: add react-hook-form lib
MdKAMRAN7255 Feb 21, 2024
c6965b2
fix: correct socket issue
MdKAMRAN7255 Feb 22, 2024
7c5633f
fix: refreshing socket issue
MdKAMRAN7255 Feb 22, 2024
161f023
refac: remove data from socket and add console for log on render to s…
MdKAMRAN7255 Feb 22, 2024
361f375
refac: added port if env is null
MdKAMRAN7255 Feb 22, 2024
668a759
refac: add inputClass css as global as it is used in multiple placess
MdKAMRAN7255 Feb 22, 2024
e9f5dea
refac: add react-web-hook form
MdKAMRAN7255 Feb 22, 2024
744f8e4
refac: corrected middleware utilization
MdKAMRAN7255 Feb 22, 2024
e6b1f54
feat: add profile page, and required api
MdKAMRAN7255 Feb 22, 2024
bf7af56
fix: solve render server issue by calling socket server early
MdKAMRAN7255 Feb 23, 2024
090ba0f
feat: add route for profile which give user result data
MdKAMRAN7255 Feb 23, 2024
1f0c0b3
refac: emit socket event at dashboard to start server early
MdKAMRAN7255 Feb 23, 2024
f8a90fd
feat: add sorting feature in table
MdKAMRAN7255 Feb 23, 2024
83c86a1
feat: add limit for data per page
MdKAMRAN7255 Feb 23, 2024
5e151ef
feat: Added pagination for the table
mdkamran25 Feb 25, 2024
2a9075a
feat: add pagination functionality in react.
MdKAMRAN7255 Feb 26, 2024
70c76af
refac: add correct image for rematch, change table column name
MdKAMRAN7255 Feb 26, 2024
c58560a
refac: Remove unnecessar console, add one more protected route in mid…
MdKAMRAN7255 Feb 26, 2024
64a0bba
feat: add leave game button in page
MdKAMRAN7255 Feb 26, 2024
50e526c
feat: add dashboard navigation buttton at profile page
MdKAMRAN7255 Feb 26, 2024
2716dbb
add not-found and error page
MdKAMRAN7255 Feb 26, 2024
eed5c0d
refactor: remove any from authorize of next.js and Since User is rese…
MdKAMRAN7255 Feb 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_MONGO_URI=""
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/.pnp
.pnp.js
.yarn/install-state.gz
.env

# testing
/coverage
Expand Down
Binary file added assets/draw.png
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest using SVGs over PNG format whenever possible. SVGs can be scaled without losing the quality of the image.

Read more about it here: https://cloudinary.com/guides/image-formats/svg-vs-png-4-key-differences-and-how-to-choose#1-image-quality-and-scaling

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/loginIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/lose.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/profileIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/tic_tac_toe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/toatlGame.png
mdkamran25 marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/trophy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions models/userModels.ts
mdkamran25 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import mongoose, { Schema } from "mongoose";

const userSchema = new Schema<UserSchema>({
name:{type:String, required: true},
mdkamran25 marked this conversation as resolved.
Show resolved Hide resolved
email:{type:String, required: true, unique:true},
password:{type:String, required: true}
},{
timestamps:true
});

const User = mongoose.models.User || mongoose.model("User", userSchema);

export default User;
11 changes: 10 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "**",
},
],
},
};

export default nextConfig;
Loading