Skip to content
Merged

Dev #65

Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 3 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# env variables

# to create a secret or env variable,
# to create a secret or env variable, use the following format.

```
kubectl create secret generic NAME_OF_THE_SECRET_KEY --from-literal=KEY=VALUE_FOR_THE_KEY
Expand All @@ -9,29 +9,25 @@ kubectl create secret generic NAME_OF_THE_SECRET_KEY --from-literal=KEY=VALUE_FO
eg- To set jwt secret key,
kubectl create secret generic jwt-secret --from-literal=JWT_SECRET_KEY=this-is-jwt-secret-for-devhive-32iqfhishf78

# api prefix

# api prefix
API_PREFIX = 'api prifix' eg:- /api/v1

# jwt

JWT_SECRET_KEY = your_jwt_secret_key
JWT_REFRESH_SECRET_KEY = your_jwt_refresh_secret_key

# twilio otp sending and verification

TWILIO_ACCOUNT_SID = your_twilio_sid
TWILIO_AUTH_TOKEN = your_twilio_auth_token
TWILIO_SERVICE_SID = your_twilio_service_sid

# cloudinary image upload

CLOUDINARY_API_KEY = your_cloudinary_api_key
CLOUDINARY_API_SECRET = your_cloudinary_api_secret
CLOUDINARY_CLOUD_NAME = your_cloudinary_cloud_name

# mongo atlas utls(Not necessary)

# mongo atlas utls(Not necessary if using mongodb stateful services in the './k8s/stateful' diractory)
MONGO_URL_AUTH = authentication_db_url
MONGO_URL_ADMIN = admin_db_url
MONGO_URL_PROFILE = profile_db_url
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### About

- This is a Job Finding Application.
- This application is built using MERN stack and microservices architecture. Containerized each services to be deployed in kubernetes the cluster.
- This application is built using MERN stack and microservices architecture. Containerized each services to be deployed in kubernetes cluster.
- This application have mainly 3 user roles,
1. admin
2. candidate
Expand Down
16 changes: 8 additions & 8 deletions admin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ const start = async () => {
const jobDeletedEvent = new JobDeletedEventConsumer(kafkaClient);
const paymentcreatedEvent = new PaymentcreatedEventConsumer(kafkaClient);

// await candidateProfileUpdatedEvent.subscribe();
// await recruiterProfileUpdatedEvent.subscribe();
// await jobCreatedEvent.subscribe();
// await jobUpdatedEvent.subscribe();
// await jobDeletedEvent.subscribe();
// await userUpdatedEvent.subscribe();
// await userCreatedEvent.subscribe();
// await paymentcreatedEvent.subscribe();
await candidateProfileUpdatedEvent.subscribe();
await recruiterProfileUpdatedEvent.subscribe();
await jobCreatedEvent.subscribe();
await jobUpdatedEvent.subscribe();
await jobDeletedEvent.subscribe();
await userUpdatedEvent.subscribe();
await userCreatedEvent.subscribe();
await paymentcreatedEvent.subscribe();

app.listen(appConfig.PORT, () => {
console.log(`admin Listening on port ${appConfig.PORT}....`);
Expand Down
2 changes: 0 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,3 @@
"vite": "^4.4.5"
}
}


13 changes: 9 additions & 4 deletions client/src/axios/apiMethods/jobs-service/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ export const filterJobsApi = async (filterData: IFilter, page: number, limit: nu
};

// Candidate
export const getAJobCandidateApi = async (id: string): Promise<IResponse> => {
return await makeApiCall("get", jobApiUrlConfig.getAJobCandidateUrl(id));
export const getAJobCandidateApi = async (jobId: string): Promise<IResponse> => {
return await makeApiCall("get", jobApiUrlConfig.getAJobCandidateUrl(jobId));
};

export const searchJobsCandidateApi = async (searchKey: string, resourceType: string, page: number, limit: number): Promise<IResponse> => {
return await makeApiCall("get", jobApiUrlConfig.getSearchResultsUrl(searchKey, resourceType, page, limit));
};

export const candidateApplyJobApi = async (jobId: string): Promise<IResponse> => {
Expand All @@ -46,10 +50,11 @@ export const getAnAppliedJobApi = async (jobApplicationId: string): Promise<IRes
return await makeApiCall("get", jobApiUrlConfig.getAnAppliedJobUrl(jobApplicationId));
};

export const getAllCandidateAppliedJobsApi = async (candidateId: string, currentPage: number): Promise<IResponse> => {
return await makeApiCall("get", jobApiUrlConfig.getAllCandidateAppliedJobsUrl(candidateId, currentPage));
export const getAllCandidateAppliedJobsApi = async ( page: number, limit: number): Promise<IResponse> => {
return await makeApiCall("get", jobApiUrlConfig.getAllCandidateAppliedJobsUrl(page, limit));
};


export const changeJobApplicationStatusApi = async (jobApplicationId: string, jobApplicationStatus: any): Promise<IResponse> => {
return await makeApiCall("post", jobApiUrlConfig.changeJobApplicationStatusUrl(jobApplicationId), jobApplicationStatus);
};
Expand Down
4 changes: 2 additions & 2 deletions client/src/axios/apiMethods/profile-service/recruiter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export const getACandidateProfileApi = async (userId: string): Promise<IResponse
return await makeApiCall("get", profileApiUrlConfig.getACandidateProfileUrl(userId));
};

export const getAllCandidatesProfilesApi = async (page: number): Promise<IResponse> => {
return await makeApiCall("get", profileApiUrlConfig.getAllCandidatesProfilesUrl(page));
export const getAllCandidatesProfilesApi = async (page: number, limit: number): Promise<IResponse> => {
return await makeApiCall("get", profileApiUrlConfig.getAllCandidatesProfilesUrl(page, limit));
};
22 changes: 0 additions & 22 deletions client/src/components/shimmer/JobCardShimmerLandingPage.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';

const DashboardCardAdminShimmer: React.FC = () => {
return (
<div className="rounded-lg border flex justify-center items-center gap-10 p-10 border-gray-30 shadow-default dark:border-dark dark:bg-gray-700 animate-pulse">
<div className="flex h-16 w-12 items-center justify-center rounded-full bg-gray-400">
{/* Placeholder for icon or children */}
</div>

<div className="mt-4 flex items-end justify-between">
<div>
<h4 className="h-6 w-24 bg-gray-300 rounded animate-pulse" />
<span className="h-4 w-16 bg-gray-300 rounded animate-pulse" />
</div>
</div>
</div>
);
};

export default DashboardCardAdminShimmer;
22 changes: 22 additions & 0 deletions client/src/components/shimmer/job/JobCardShimmer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const JobCardShimmer = () => {
return (
<div className="mx-4 lg:mx-40 pb-4">
<div className="flex flex-col md:flex-row justify-between items-center sm:px-6 py-4 bg-zinc-200 rounded-md border border-gray-200 dark:border-gray-700 shadow-lg animate-pulse hover:border-blue-500 hover:translate-y-1 hover:scale-103">
<div className="flex flex-col items-start gap-3 py-3">
<div className="h-4 w-48 md:w-60 bg-gray-200 rounded-md dark:bg-gray-500 animate-pulse mb-2.5"></div>
<div className="flex items-center gap-4">
<div className="h-4 w-32 md:w-20 bg-gray-200 rounded-md dark:bg-gray-500 animate-pulse mb-2.5"></div>
<div className="h-4 w-32 md:w-20 bg-gray-200 rounded-md dark:bg-gray-500 animate-pulse mb-2.5"></div>
<div className="h-4 w-32 md:w-28 bg-gray-200 rounded-md dark:bg-gray-500 animate-pulse mb-2.5"></div>
</div>
</div>
<div className="flex items-center gap-4 mt-4 md:mt-0">
<div className="h-4 w-32 md:w-32 bg-gray-200 rounded-md dark:bg-gray-500 animate-pulse mb-2.5"></div>
<div className="h-10 w-24 md:w-32 bg-gray-200 rounded-md dark:bg-gray-500 animate-pulse mb-2.5"></div>
</div>
</div>
</div>
);
}

export default JobCardShimmer;
44 changes: 44 additions & 0 deletions client/src/components/shimmer/job/JobDetailsShimmer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React from 'react';

// ShimmerLine Component
interface ShimmerLineProps {
width?: string;
height?: string;
className?: string;
}

const ShimmerLine: React.FC<ShimmerLineProps> = ({ width = "100%", height = "1.5rem", className = "" }) => {
return (
<div className={`bg-gray-300 rounded ${className}`} style={{ width, height }} />
);
};

// JobDetailsCardShimmer Component
interface ShimmerJobDetailsProps {
lines: number;
}

const JobDetailsCardShimmer: React.FC<ShimmerJobDetailsProps> = ({ lines }) => {
return (
<div className="container mx-auto my-8">
<div className="max-w-2xl mx-auto bg-white p-8 rounded shadow-md animate-pulse">
<div className="flex justify-between items-center my-8 mb-4">
<ShimmerLine width="40%" height="2rem" />

</div>
<div className='flex flex-row justify-end'>
<ShimmerLine width="30%" height="1rem" className="font-extrabold" />
</div>
{/* Repeat ShimmerLine for job details */}
{Array.from({ length: lines }).map((_, index) => (
<div key={index} className="mb-4 gap-24 md:gap-44 flex items-center my-8">
<ShimmerLine width="20%" height="1.5rem" className="font-extrabold" />
<ShimmerLine width="20%" height="1.5rem" />
</div>
))}
</div>
</div>
);
};

export default JobDetailsCardShimmer;
23 changes: 23 additions & 0 deletions client/src/components/shimmer/recruiter/CandidateCardShimmer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from "react";

const CandidateCardShimmer: React.FC = () => {
return (
<div className="md:mx-40 mb-4 px-2">
<div className="flex justify-between items-center px-6 py-4 bg-zinc-200 rounded-md border border-gray-200 dark:border-gray-700 shadow-lg animate-pulse hover:border-blue-500 hover:translate-y-1 hover:scale-103">
<div className="flex flex-col items-start gap-3">
<div className="h-4 w-48 md:w-60 bg-gray-200 rounded-md dark:bg-gray-500 animate-pulse mb-1.5"></div>
<div className="flex flex-col items-center gap-4">
<div className="h-4 w-32 md:w-20 bg-gray-200 rounded-md dark:bg-gray-500 animate-pulse mb-1.5"></div>
<div className="h-4 w-32 md:w-20 bg-gray-200 rounded-md dark:bg-gray-500 animate-pulse mb-1.5"></div>
<div className="h-4 w-32 md:w-28 bg-gray-200 rounded-md dark:bg-gray-500 animate-pulse mb-1.5"></div>
</div>
</div>
<div className="flex items-center gap-4 mt-4 md:mt-0">
<div className="h-10 w-24 md:w-32 bg-gray-200 rounded-md dark:bg-gray-500 animate-pulse mb-1.5"></div>
</div>
</div>
</div>
);
};

export default CandidateCardShimmer;
20 changes: 20 additions & 0 deletions client/src/components/shimmer/table/TableShimmer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const TableShimmer = ({ columnCount, rowCount }: { columnCount: number; rowCount: number }) => {
console.log(Array.from({ length: rowCount }));
console.log(Array.from({ length: columnCount }));

return (
<tbody>
{Array.from({ length: columnCount }).map((_, rowIndex) => (
<tr key={rowIndex} className={`${rowIndex % 2 === 0 ? "bg-white" : "bg-gray-200"} border-b`}>
{Array.from({length:rowCount}).map((_: unknown, colIndex: number) => (
<td key={colIndex} className="py-4 px-6 text-center">
<div className="h-4 bg-gray-300 rounded animate-pulse"></div>
</td>
))}
</tr>
))}
</tbody>
);
};

export default TableShimmer;
6 changes: 4 additions & 2 deletions client/src/config/apiUrlsConfig/jobApiUrlConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ const jobApiUrlConfig = {

// Candidate
getAJobCandidateUrl: (id: string) => `${CANDIDATE_JOB_URL}/${id}`,
getSearchResultsUrl: (searchKey: string, resourceType: string, page: number, limit: number) =>
`${CANDIDATE_JOB_URL}/search/${resourceType}/${page}/${limit}?searchKey=${searchKey}`,
candidateApplyJobUrl: (jobId: string) =>
`${CANDIDATE_JOB_URL}/apply/${jobId}`,

getAnAppliedJobUrl: (jobApplicationId: string) =>
`${CANDIDATE_JOB_URL}/application/${jobApplicationId}`,
getAllCandidateAppliedJobsUrl: (candidateId: string, currentPage: number) =>
`${CANDIDATE_JOB_URL}/applied/${candidateId}/${currentPage}`,
getAllCandidateAppliedJobsUrl: (page: number, limit: number) =>
`${CANDIDATE_JOB_URL}/applied/${page}/${limit}`,

checkAppliedUrl: (jobId: string) =>
`${CANDIDATE_JOB_URL}/hasApplied/${jobId}`,
Expand Down
4 changes: 2 additions & 2 deletions client/src/config/apiUrlsConfig/profileApiUrlConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const profileApiUrlConfig = {
// Recruiter
getRecruiterProfileUrl: `${RECRUITER_PROFILE_URL}`,
updategetRecruiterProfileUrl: `${RECRUITER_PROFILE_URL}`,
getAllCandidatesProfilesUrl: (page: number) =>
`${RECRUITER_PROFILE_URL}/candidates/${page}`,
getAllCandidatesProfilesUrl: (page: number, limit: number) =>
`${RECRUITER_PROFILE_URL}/candidates/${page}/${limit}`,
getACandidateProfileUrl: (candidateId: string) =>
`${RECRUITER_PROFILE_URL}/candidate/${candidateId}`,
};
Expand Down
8 changes: 4 additions & 4 deletions client/src/pages/chat/ChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const ChatPage = () => {
return () => {
dispatch(clearChatRooms());
};
}, [selectedChatRoom, selectedChatRoomMessages]);
}, [selectedChatRoom]);

useEffect(() => {
socket.on("chatNotification", () => {
Expand Down Expand Up @@ -145,9 +145,9 @@ const ChatPage = () => {
}
});

return () => {
socket.off("receiveMessage");
};
// return () => {
// socket.off("receiveMessage");
// };
}, [selectedChatRoom, userData.id]);

const sendMessage = (message: string) => {
Expand Down
Loading