-
Notifications
You must be signed in to change notification settings - Fork 456
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
Feat job seeker UI #555
Feat job seeker UI #555
Changes from 10 commits
07c422c
a30e513
98b3e2d
d91e674
44e3c79
1a8a939
be8aee6
fa92ea5
8db2993
b564fe1
f3258ec
e44cf69
c52ceb4
0bebe98
5b9f388
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
Warnings: | ||
|
||
- A unique constraint covering the columns `[username]` on the table `User` will be added. If there are existing duplicate values, this will fail. | ||
- Added the required column `aboutMe` to the `User` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `contactEmail` to the `User` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `username` to the `User` table without a default value. This is not possible if the table is not empty. | ||
|
||
*/ | ||
-- CreateEnum | ||
CREATE TYPE "ProjectStack" AS ENUM ('GO', 'PYTHON', 'MERN', 'NEXTJS', 'AI_GPT_APIS', 'SPRINGBOOT', 'OTHERS'); | ||
|
||
-- CreateEnum | ||
CREATE TYPE "DegreeType" AS ENUM ('BTech', 'MTech', 'BCA', 'MCA'); | ||
|
||
-- CreateEnum | ||
CREATE TYPE "FieldOfStudyType" AS ENUM ('AI', 'Machine_Learning', 'CS', 'Mechanical'); | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "Experience" DROP CONSTRAINT "Experience_userId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "Project" DROP CONSTRAINT "Project_userId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Job" ADD COLUMN "deletedAt" TIMESTAMP(3); | ||
|
||
-- AlterTable | ||
ALTER TABLE "Project" ADD COLUMN "isFeature" BOOLEAN NOT NULL DEFAULT false, | ||
ADD COLUMN "projectThumbnail" TEXT, | ||
ADD COLUMN "stack" "ProjectStack" NOT NULL DEFAULT 'OTHERS'; | ||
|
||
-- AlterTable | ||
ALTER TABLE "User" ADD COLUMN "aboutMe" TEXT NOT NULL, | ||
ADD COLUMN "contactEmail" TEXT NOT NULL, | ||
ADD COLUMN "discordLink" TEXT, | ||
ADD COLUMN "githubLink" TEXT, | ||
ADD COLUMN "linkedinLink" TEXT, | ||
ADD COLUMN "portfolioLink" TEXT, | ||
ADD COLUMN "twitterLink" TEXT, | ||
ADD COLUMN "username" TEXT NOT NULL; | ||
|
||
-- CreateTable | ||
CREATE TABLE "Education" ( | ||
"id" SERIAL NOT NULL, | ||
"instituteName" TEXT NOT NULL, | ||
"degree" "DegreeType" NOT NULL, | ||
"fieldOfStudy" "FieldOfStudyType" NOT NULL, | ||
"startDate" TIMESTAMP(3) NOT NULL, | ||
"endDate" TIMESTAMP(3), | ||
"userId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Education_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_username_key" ON "User"("username"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Experience" ADD CONSTRAINT "Experience_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Education" ADD CONSTRAINT "Education_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Project" ADD CONSTRAINT "Project_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- AlterTable | ||
ALTER TABLE "User" ALTER COLUMN "aboutMe" DROP NOT NULL, | ||
ALTER COLUMN "contactEmail" DROP NOT NULL; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- AlterTable | ||
ALTER TABLE "User" ADD COLUMN "resumeUpdateDate" TIMESTAMP(3); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,22 @@ model User { | |
blockedByAdmin DateTime? | ||
onBoard Boolean @default(false) | ||
bookmark Bookmark[] | ||
|
||
githubLink String? | ||
portfolioLink String? | ||
linkedinLink String? | ||
twitterLink String? | ||
discordLink String? | ||
|
||
username String @unique | ||
|
||
contactEmail String? | ||
|
||
aboutMe String? | ||
|
||
education Education[] | ||
|
||
resumeUpdateDate DateTime? | ||
} | ||
|
||
enum OauthProvider { | ||
|
@@ -110,6 +126,17 @@ model Experience { | |
user User @relation(fields: [userId], references: [id], onDelete: Cascade) | ||
} | ||
|
||
model Education { | ||
id Int @id @default(autoincrement()) | ||
instituteName String | ||
degree DegreeType | ||
fieldOfStudy FieldOfStudyType | ||
startDate DateTime | ||
endDate DateTime? | ||
userId String | ||
user User @relation(fields: [userId], references: [id], onDelete: Cascade) | ||
} | ||
|
||
model Project { | ||
id Int @id @default(autoincrement()) | ||
projectName String | ||
|
@@ -120,6 +147,7 @@ model Project { | |
stack ProjectStack @default(OTHERS) | ||
userId String | ||
user User @relation(fields: [userId], references: [id], onDelete: Cascade) | ||
isFeature Boolean @default(false) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is "isFeature" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
|
||
enum ProjectStack { | ||
|
@@ -155,3 +183,17 @@ enum EmployementType { | |
Internship | ||
Contract | ||
} | ||
|
||
enum DegreeType { | ||
BTech | ||
MTech | ||
BCA | ||
MCA | ||
} | ||
|
||
enum FieldOfStudyType { | ||
AI | ||
Machine_Learning | ||
CS | ||
Mechanical | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,9 +12,22 @@ import bcrypt from 'bcryptjs'; | |
const prisma = new PrismaClient(); | ||
|
||
const users = [ | ||
{ id: '1', name: 'Jack', email: '[email protected]' }, | ||
{ id: '2', name: 'Admin', email: '[email protected]', role: Role.ADMIN, onBoard: true }, | ||
{ id: '3', name: 'Hr', email: '[email protected]', role: Role.HR }, | ||
{ id: '1', name: 'Jack', email: '[email protected]', username: 'jackcoder' }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add role: Role.USER |
||
{ | ||
id: '2', | ||
name: 'Admin', | ||
email: '[email protected]', | ||
role: Role.ADMIN, | ||
onBoard: true, | ||
username: 'admincoder', | ||
}, | ||
{ | ||
id: '3', | ||
name: 'Hr', | ||
email: '[email protected]', | ||
role: Role.HR, | ||
username: 'hrcoder', | ||
}, | ||
]; | ||
|
||
let jobs = [ | ||
|
@@ -63,7 +76,6 @@ let jobs = [ | |
minSalary: null, | ||
maxSalary: null, | ||
isVerifiedJob: false, | ||
|
||
}, | ||
{ | ||
id: '3', | ||
|
@@ -87,7 +99,7 @@ let jobs = [ | |
minSalary: 90000, | ||
maxSalary: 120000, | ||
isVerifiedJob: true, | ||
deleted: true | ||
deleted: true, | ||
}, | ||
{ | ||
id: '4', | ||
|
@@ -136,7 +148,7 @@ let jobs = [ | |
minSalary: 110000, | ||
maxSalary: 150000, | ||
isVerifiedJob: true, | ||
deleted: true | ||
deleted: true, | ||
}, | ||
{ | ||
id: '6', | ||
|
@@ -162,7 +174,6 @@ let jobs = [ | |
minSalary: 80000, | ||
maxSalary: 100000, | ||
isVerifiedJob: false, | ||
|
||
}, | ||
{ | ||
id: '7', | ||
|
@@ -187,8 +198,7 @@ let jobs = [ | |
minSalary: 70000, | ||
maxSalary: 90000, | ||
isVerifiedJob: false, | ||
delted: true | ||
|
||
delted: true, | ||
}, | ||
{ | ||
id: '8', | ||
|
@@ -213,8 +223,7 @@ let jobs = [ | |
minSalary: null, | ||
maxSalary: null, | ||
isVerifiedJob: true, | ||
deleted: true | ||
|
||
deleted: true, | ||
}, | ||
{ | ||
id: '9', | ||
|
@@ -237,7 +246,6 @@ let jobs = [ | |
minSalary: 100000, | ||
maxSalary: 130000, | ||
isVerifiedJob: true, | ||
|
||
}, | ||
{ | ||
id: '10', | ||
|
@@ -262,7 +270,6 @@ let jobs = [ | |
minSalary: 75000, | ||
maxSalary: 95000, | ||
isVerifiedJob: false, | ||
|
||
}, | ||
{ | ||
id: '11', | ||
|
@@ -284,7 +291,6 @@ let jobs = [ | |
minSalary: 25000, | ||
maxSalary: 50000, | ||
isVerifiedJob: true, | ||
|
||
}, | ||
{ | ||
id: '12', | ||
|
@@ -309,7 +315,7 @@ let jobs = [ | |
minSalary: null, | ||
maxSalary: null, | ||
isVerifiedJob: true, | ||
delted: false | ||
delted: false, | ||
}, | ||
]; | ||
|
||
|
@@ -328,6 +334,7 @@ async function seedUsers() { | |
password: hashedPassword, | ||
role: u.role || Role.USER, | ||
emailVerified: new Date(), | ||
username: u.username, | ||
}, | ||
}); | ||
console.log(`User created or updated: ${u.email}`); | ||
|
@@ -405,4 +412,4 @@ async function main() { | |
await seedJobs(); | ||
} | ||
|
||
main(); | ||
main(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,8 @@ export const signUp = withServerActionAsyncCatcher< | |
await prisma.$transaction( | ||
async (txn) => { | ||
const user = await txn.user.create({ | ||
data: { ...data, password: hashedPassword }, | ||
// todo username | ||
data: { ...data, password: hashedPassword, username: 'asdif' }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. username doesnt look good ig There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. username was present in figma. changing schema leads to require username whenever user is being created. we can remove username from schema or need to add username input in signup form. |
||
}); | ||
|
||
const verificationToken = await txn.verificationToken.create({ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this