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

initial resume commit #111

Merged
merged 1 commit into from
Nov 3, 2024
Merged
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
12 changes: 12 additions & 0 deletions resume-app/.env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
NEXTAUTH_URL=
AUTH_SECRET=

AUTH_GITHUB_ID=
AUTH_GITHUB_SECRET=

S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
S3_BUCKET_REGION=

EMAIL_USER=
EMAIL_PASS=
3 changes: 3 additions & 0 deletions resume-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
.env
.next
2 changes: 2 additions & 0 deletions resume-app/app/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { handlers } from "auth"
export const { GET, POST } = handlers
58 changes: 58 additions & 0 deletions resume-app/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;

--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;

--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;

--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;

--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;

--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;

--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;

--destructive: 0 84.2% 60.2%;
--destructive-foreground: 210 40% 98%;

--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--ring: 222.2 84% 4.9%;

--radius: 0.5rem;
}
}

@layer base {
* {
@apply border-border;
}

body {
@apply bg-background text-foreground;
}
}

*{
-ms-overflow-style: none;
}
::-webkit-scrollbar {
display: none;
}

html {
scroll-behavior: smooth;
}
79 changes: 79 additions & 0 deletions resume-app/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import "./globals.css";
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import Header from "@/components/header";
import { SessionProvider } from "next-auth/react";
import { auth } from "@/auth";
import dotenv from "dotenv";
import { NextUIProvider } from "@nextui-org/react";
import { ThemeProvider as NextThemesProvider } from "next-themes";
import { ThemeSwitcher } from "@/components/ui/Theme";

dotenv.config();

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "Resume checker",
description: "Free resume checker and analyzer. Get instant feedback on your resume and improve your chances of landing your dream job.",
keywords: ["resume checker", "resume feedback", "resume improvement", "job application helper"],
authors: [{ name: "Sanjay" }],
openGraph: {
title: "Resume checker",
description: "Free resume checker and analyzer",
type: "website",
url: "https://7cb9-2405-201-c029-507f-9ded-5240-d879-b885.ngrok-free.app/",
images: [
{
url: "/images/og-banner.png",
width: 1200,
height: 630,
alt: "Resume checker preview",
},
],
},
twitter: {
card: "summary_large_image",
title: "Resume checker",
description: "Free resume checker and analyzer",
images: ["/images/og-banner.png"],
},
robots: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
"max-video-preview": -1,
"max-image-preview": "large",
"max-snippet": -1,
},
},
verification: {
google: "your-google-verification-code", // Add your Google Search Console verification code
},
};

export default async function RootLayout({
children,
}: React.PropsWithChildren) {
const session = await auth();

return (
<html lang="en" suppressHydrationWarning>
<body
className="flex h-full min-h-screen w-full flex-col justify-between bg-background"
suppressHydrationWarning
>
<NextUIProvider>
<NextThemesProvider attribute="class" defaultTheme="dark">
<SessionProvider session={session} basePath="/auth">
<Header />
{children}
</SessionProvider>
</NextThemesProvider>
</NextUIProvider>
</body>
</html>
);
}
76 changes: 76 additions & 0 deletions resume-app/app/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// @ts-nocheck
"use client";

import { Card, CardContent } from "@/components/ui/card";
import { useRef, useState, useEffect } from "react";
import { ClipLoader } from "react-spinners";
import { useSession } from "next-auth/react";
import { Button } from "@/components/ui/button";
import UploadButton from "@/components/ui/UploadButton";
import Header from "@/components/header";
import { worker } from "@/lib/workerInit";
import { toast, ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import Site from "./site";

export default function Main({ session }) {
const [loading, setLoading] = useState(true);
const fileInputRef = useRef<HTMLInputElement | null>(null);

useEffect(() => {
setLoading(false);
}, []);

const handleFileChange = async (e: any, isDragDrop: boolean = false) => {
const files = isDragDrop ? e.dataTransfer.files : e.target.files;

if (files && files.length > 0) {
const file = files[0];
const validTypes = [
"application/pdf",
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
];

if (validTypes.includes(file.type)) {
fileInputRef.current.value = "";
setLoading(true);

try {
worker(file.name, file).then(async data => {
setLoading(false);
toast("Successfully uploaded...");
}).catch((error) => {
setLoading(false);
toast("Couldn't upload file...");
console.error("Upload failed:", error);
})
} catch (error) {
setLoading(false);
toast("Couldn't upload file...");
console.error("Upload failed:", error);
}
} else {
toast("Please upload a PDF, DOC, or DOCX file");
}
}
};

return (
<>
{loading ? (
<div className="w-full flex justify-center items-center">
<ClipLoader />
</div>
) : (
<Site
fileInputRef={fileInputRef}
loading={loading}
session={session}
handleFileChange={handleFileChange}
/>
)}
<ToastContainer />
</>
);
}
13 changes: 13 additions & 0 deletions resume-app/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// @ts-nocheck
import { auth } from "@/auth";
import Main from "./main";

export default async function Component() {
const session = await auth();

return (
<>
<Main session={session}/>
</>
);
}
Loading