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/project stack #527

Merged
merged 18 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4916e4f
Refactor User model in schema.prisma
CuriousCoder00 Oct 20, 2024
3d410d0
Refactor user.profile.validator.ts: Add stack enum for projectSchema
CuriousCoder00 Oct 20, 2024
0c53161
Refactor user-multistep-form: Add project stack selection
CuriousCoder00 Oct 20, 2024
50e4083
Refactor project schema to add default value for stack field
CuriousCoder00 Oct 20, 2024
357dd1d
Refactor schema.prisma: Add cascade deletion for user relations
CuriousCoder00 Oct 20, 2024
cea3168
Refactor project schema: Add projectThumbnail field and update projec…
CuriousCoder00 Oct 20, 2024
52917ae
Refactor user.profile.validator.ts: Add optional projectThumbnail fie…
CuriousCoder00 Oct 20, 2024
7abfaf7
Refactor profile pages: Add container and heading
CuriousCoder00 Oct 20, 2024
dc54b74
Refactor AddProject form: Add project thumbnail upload functionality
CuriousCoder00 Oct 20, 2024
2bec7a9
Refactor UserProject component: Add project thumbnail display and lin…
CuriousCoder00 Oct 20, 2024
40e7b3e
Refactor project schema: Update ProjectStack enum values
CuriousCoder00 Oct 21, 2024
79536a0
Refactor project schema: Update ProjectStack enum values
CuriousCoder00 Oct 21, 2024
7b5f2dd
Merge branch 'main' of https://github.com/CuriousCoder00/job-board in…
CuriousCoder00 Oct 21, 2024
2ac4b7f
Refactor icons.ts: Add loading spinner icon
CuriousCoder00 Oct 21, 2024
fd309e6
Refactor profile pages: Add "Add more" functionality
CuriousCoder00 Oct 21, 2024
243021c
Refactor project schema: Update ProjectStack enum values
CuriousCoder00 Oct 21, 2024
0311f6c
Refactor UserProject component: Add loading spinner and no projects f…
CuriousCoder00 Oct 21, 2024
4ba0a4f
Refactor UserExperience component: Improve loading and no experiences…
CuriousCoder00 Oct 21, 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
73 changes: 42 additions & 31 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ datasource db {
}

model User {
id String @id @default(cuid())
name String
id String @id @default(cuid())
name String

password String?
avatar String?
Expand All @@ -19,34 +19,34 @@ model User {

email String @unique
emailVerified DateTime?
skills String[]
experience Experience[]
project Project[]
resume String?
oauthProvider OauthProvider? // Tracks OAuth provider (e.g., 'google')
oauthId String?

skills String[]
experience Experience[]
project Project[]
resume String?

oauthProvider OauthProvider? // Tracks OAuth provider (e.g., 'google')
oauthId String?

blockedByAdmin DateTime?
onBoard Boolean @default(false)
onBoard Boolean @default(false)
}

enum OauthProvider {
GOOGLE
}


model VerificationToken {
token String
token String
identifier String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
type TokenType
@@unique([token,identifier])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
type TokenType

@@unique([token, identifier])
}

enum TokenType {
enum TokenType {
EMAIL_VERIFICATION
RESET_PASSWORD
}
Expand Down Expand Up @@ -80,32 +80,43 @@ model Job {
isVerifiedJob Boolean @default(false) @map("is_verified_job")
postedAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id],onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}

model Experience {
id Int @id @default(autoincrement())
companyName String
id Int @id @default(autoincrement())
companyName String
designation String
EmploymentType EmployementType
address String
workMode WorkMode
currentWorkStatus Boolean
startDate DateTime
endDate DateTime?
description String
userId String
user User @relation(fields: [userId] ,references: [id])
description String
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}

model Project {
id Int @id @default(autoincrement())
projectName String
projectSummary String
projectLiveLink String?
projectGithub String
userId String
user User @relation(fields: [userId] , references: [id])
id Int @id @default(autoincrement())
projectName String
projectThumbnail String?
projectSummary String
projectLiveLink String?
projectGithub String
stack ProjectStack @default(OTHERS)
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}

enum ProjectStack {
GO
PYTHON
MERN_NEXTJS
CuriousCoder00 marked this conversation as resolved.
Show resolved Hide resolved
AI_GPT_APIS
JAVA
OTHERS
}

enum Currency {
Expand Down
5 changes: 4 additions & 1 deletion src/app/profile/experience/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export default function AccountExperiencePage() {
router.push(`${APP_PATHS.SIGNIN}?redirectTo=/profile`);
}, [session.status, router]);
return (
<div>
<div className="md:container flex flex-col w-full gap-4">
<div className="flex justify-between items-center">
<span>Experience</span>
</div>
<UserExperience />
</div>
);
Expand Down
5 changes: 4 additions & 1 deletion src/app/profile/projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export default function AccountProjectPage() {
router.push(`${APP_PATHS.SIGNIN}?redirectTo=/profile`);
}, [session.status, router]);
return (
<div className="overflow-x-hidden">
<div className="md:container flex flex-col w-full gap-4">
<div className="flex justify-between items-center">
<span>Projects</span>
</div>
<UserProjects />
</div>
);
Expand Down
5 changes: 4 additions & 1 deletion src/app/profile/resume/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export default function AccountResumePage() {
router.push(`${APP_PATHS.SIGNIN}?redirectTo=/profile`);
}, [session.status, router]);
return (
<div className="m-auto">
<div className="md:container flex flex-col w-full gap-4">
<div className="flex justify-between items-center">
<span>Resume</span>
</div>
<UserResume />
</div>
);
Expand Down
5 changes: 4 additions & 1 deletion src/app/profile/skills/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export default function AccountResumePage() {
router.push(`${APP_PATHS.SIGNIN}?redirectTo=/profile`);
}, [session.status, router]);
return (
<div>
<div className="md:container flex flex-col w-full gap-4">
<div className="flex justify-between items-center">
<span>Skills</span>
</div>
<UserSkills />
</div>
);
Expand Down
53 changes: 39 additions & 14 deletions src/components/profile/UserProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import {
CardHeader,
CardTitle,
} from '../ui/card';
import { LucideGithub, SquareArrowOutUpRightIcon } from 'lucide-react';

export function UserProjects() {
const { toast } = useToast();
const [projects, setProjects] = useState<Project[]>();

useEffect(() => {
async function fetchProjects() {
try {
Expand Down Expand Up @@ -43,35 +45,58 @@ export function UserProjects() {
}

return (
<div className="space-y-2 mb-2">
<div className="grid grid-cols-4 gap-3 mt-4">
{projects.map((item: Project) => (
<Card
key={item.id}
className=" border-2 hover:bg-slate-100 dark:hover:bg-slate-900 text-black dark:text-white transition-shadow duration-300"
className="flex flex-col md:col-span-2 col-span-4 border-2 hover:bg-slate-100 dark:hover:bg-slate-900 text-black dark:text-white transition-shadow duration-300"
>
<div className="flex items-center justify-center aspect-video w-full h-[200px] overflow-hidden object-contain rounded-2xl p-1 mt-1">
{item.projectThumbnail ? (
<img
alt={item.projectName}
src={item.projectThumbnail}
className={`h-[200px] hover:scale-110 transition-transform duration-300`}
/>
) : (
<div className="flex items-center justify-center h-[200px] rounded-2xl bg-slate-400 dark:bg-slate-900">
<span className="text-3xl font-semibold">
{item.projectName}
</span>
</div>
)}
</div>
<CardHeader>
<CardTitle className="text-lg font-semibold">
<CardTitle className="text-lg font-semibold uppercase flex items-center justify-between">
{item.projectName}
</CardTitle>
</CardHeader>
<CardContent className="">
<CardContent className="flex items-center justify-start">
<p className="mb-4">{item.projectSummary}</p>
</CardContent>
<CardFooter className="flex justify-between">
{item.projectLiveLink && (
{item.stack && (
<div className="flex items-center gap-2">
<span className="text-xs font-semibold">Stack:</span>
<span className="text-xs">{item.stack}</span>
</div>
)}
<div className="flex items-center justify-center gap-4">
{item.projectLiveLink && (
<Link
href={item.projectLiveLink}
className="text-blue-500 hover:underline"
>
<SquareArrowOutUpRightIcon size={16} />
</Link>
)}
<Link
href={item.projectLiveLink}
href={item.projectGithub}
className="text-blue-500 hover:underline"
>
Live Project
<LucideGithub size={16} />
CuriousCoder00 marked this conversation as resolved.
Show resolved Hide resolved
</Link>
)}
<Link
href={item.projectGithub}
className="text-blue-500 hover:underline"
>
GitHub Repository
</Link>
</div>
</CardFooter>
</Card>
))}
Expand Down
Loading
Loading