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

Feat job seeker UI #555

Merged
merged 15 commits into from
Nov 1, 2024
12 changes: 8 additions & 4 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// next.config.js
import { fileURLToPath } from 'node:url';
import createJiti from 'jiti';

Expand All @@ -20,12 +21,11 @@ const nextConfig = {
remotePatterns: [
{
protocol: 'https',
hostname: 'job-board.b-cdn.net', // Change this to your CDN domain
hostname: 'job-board.b-cdn.net',
},
{
protocol: 'https',
hostname: 'lh3.googleusercontent.com',
// Change this to your CDN domain
},
{
protocol: 'https',
Expand All @@ -34,9 +34,13 @@ const nextConfig = {
{
protocol: 'https',
hostname: 'www.example.com',
}
},
{
protocol: 'https',
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove this

hostname: 'devsharmapull.b-cdn.net', // Add your new domain here
},
],
},
};

export default nextConfig; // ES module export
export default nextConfig;
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@mui/material": "^6.1.3",
"@prisma/client": "5.18.0",
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-alert-dialog": "^1.1.2",
"@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-checkbox": "^1.1.1",
"@radix-ui/react-dialog": "^1.1.2",
Expand Down Expand Up @@ -79,6 +80,7 @@
"react": "^18",
"react-day-picker": "^8.10.1",
"react-dom": "^18",
"react-dropzone": "^14.2.10",
"react-hook-form": "^7.52.2",
"react-icons": "^5.2.1",
"react-quill": "^2.0.0",
Expand Down
66 changes: 66 additions & 0 deletions prisma/migrations/20241024174828_profileupdate/migration.sql
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;
3 changes: 3 additions & 0 deletions prisma/migrations/20241025095014_user_updated/migration.sql
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);
42 changes: 42 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is "isFeature"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

there was a "Feature this project" in the figma, so i added this field in the schema. If the isFeature is set to true then the project will show up other it will hide under show more button

}

enum ProjectStack {
Expand Down Expand Up @@ -155,3 +183,17 @@ enum EmployementType {
Internship
Contract
}

enum DegreeType {
BTech
MTech
BCA
MCA
}

enum FieldOfStudyType {
AI
Machine_Learning
CS
Mechanical
}
39 changes: 23 additions & 16 deletions prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 = [
Expand Down Expand Up @@ -63,7 +76,6 @@ let jobs = [
minSalary: null,
maxSalary: null,
isVerifiedJob: false,

},
{
id: '3',
Expand All @@ -87,7 +99,7 @@ let jobs = [
minSalary: 90000,
maxSalary: 120000,
isVerifiedJob: true,
deleted: true
deleted: true,
},
{
id: '4',
Expand Down Expand Up @@ -136,7 +148,7 @@ let jobs = [
minSalary: 110000,
maxSalary: 150000,
isVerifiedJob: true,
deleted: true
deleted: true,
},
{
id: '6',
Expand All @@ -162,7 +174,6 @@ let jobs = [
minSalary: 80000,
maxSalary: 100000,
isVerifiedJob: false,

},
{
id: '7',
Expand All @@ -187,8 +198,7 @@ let jobs = [
minSalary: 70000,
maxSalary: 90000,
isVerifiedJob: false,
delted: true

delted: true,
},
{
id: '8',
Expand All @@ -213,8 +223,7 @@ let jobs = [
minSalary: null,
maxSalary: null,
isVerifiedJob: true,
deleted: true

deleted: true,
},
{
id: '9',
Expand All @@ -237,7 +246,6 @@ let jobs = [
minSalary: 100000,
maxSalary: 130000,
isVerifiedJob: true,

},
{
id: '10',
Expand All @@ -262,7 +270,6 @@ let jobs = [
minSalary: 75000,
maxSalary: 95000,
isVerifiedJob: false,

},
{
id: '11',
Expand All @@ -284,7 +291,6 @@ let jobs = [
minSalary: 25000,
maxSalary: 50000,
isVerifiedJob: true,

},
{
id: '12',
Expand All @@ -309,7 +315,7 @@ let jobs = [
minSalary: null,
maxSalary: null,
isVerifiedJob: true,
delted: false
delted: false,
},
];

Expand All @@ -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}`);
Expand Down Expand Up @@ -405,4 +412,4 @@ async function main() {
await seedJobs();
}

main();
main();
3 changes: 2 additions & 1 deletion src/actions/auth.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Copy link
Collaborator

Choose a reason for hiding this comment

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

username doesnt look good ig

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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({
Expand Down
Loading
Loading