Skip to content

Commit

Permalink
Merge pull request #3 from Judge-Paul/v1
Browse files Browse the repository at this point in the history
V1
  • Loading branch information
Judge-Paul authored Aug 21, 2023
2 parents 1917a90 + bc6fc86 commit 864113c
Show file tree
Hide file tree
Showing 37 changed files with 3,141 additions and 267 deletions.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions README.md → client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
# JobWriteAI
# CoverWriteAi

JobWriteAI is a website that leverages the power of AI and GPT-3 technology to help job seekers create professional and personalized cover letters in a matter of minutes. Our platform is designed to simplify the job application process and help you stand out from the crowd by generating custom cover letters that match your experience and qualifications.
CoverWriteAI is a website that leverages the power of AI and GPT-3 technology to help job seekers create professional and personalized cover letters in a matter of minutes. Our platform is designed to simplify the job application process and help you stand out from the crowd by generating custom cover letters that match your experience and qualifications.

## Installation

Expand Down Expand Up @@ -57,7 +57,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Judge-Paul"><img src="https://avatars.githubusercontent.com/u/110723341?v=4?s=100" width="100px;" alt="Judge-Paul Ogebe"/><br /><sub><b>Judge-Paul Ogebe</b></sub></a><br /><a href="https://github.com/Judge-Paul/jobwrite-ai/commits?author=Judge-Paul" title="Code">💻</a> <a href="https://github.com/Judge-Paul/jobwrite-ai/commits?author=Judge-Paul" title="Documentation">📖</a> <a href="https://github.com/Judge-Paul/jobwrite-ai/pulls?q=is%3Apr+reviewed-by%3AJudge-Paul" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Judge-Paul"><img src="https://avatars.githubusercontent.com/u/110723341?v=4?s=100" width="100px;" alt="Judge-Paul Ogebe"/><br /><sub><b>Judge-Paul Ogebe</b></sub></a><br /><a href="https://github.com/Judge-Paul/coverwrite-ai/commits?author=Judge-Paul" title="Code">💻</a> <a href="https://github.com/Judge-Paul/coverwrite-ai/commits?author=Judge-Paul" title="Documentation">📖</a> <a href="https://github.com/Judge-Paul/coverwrite-ai/pulls?q=is%3Apr+reviewed-by%3AJudge-Paul" title="Reviewed Pull Requests">👀</a></td>
</tr>
</tbody>
</table>
Expand Down
4 changes: 2 additions & 2 deletions index.html → client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="google-site-verification" content="23XufbDHBlhKy2wvMDOypKfHZhvAyneuSqIsp2jrMLI" />
<title>JobWriteAI</title>
<title>CoverWriteAI</title>
</head>
<body>
<div id="root"></div>
Expand Down
7 changes: 5 additions & 2 deletions package.json → client/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "jobwrite-ai",
"name": "coverwrite-ai",
"private": true,
"version": "0.0.0",
"type": "module",
Expand All @@ -20,7 +20,10 @@
"react": "^18.2.0",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^18.2.0",
"react-icons": "^4.7.1"
"react-icons": "^4.7.1",
"react-loading-skeleton": "^3.3.1",
"react-router-dom": "^6.15.0",
"sonner": "^0.6.2"
},
"devDependencies": {
"@types/react": "^18.0.27",
Expand Down
File renamed without changes.
Binary file added client/public/favicon.ico
Binary file not shown.
File renamed without changes
51 changes: 51 additions & 0 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React, { Fragment, lazy } from "react";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import lazyLoading from "./components/lazyLoading";
import Navbar from "./components/Navbar";
import Footer from "./components/Footer";

const Home = lazyLoading(() => import("./pages/Home"));
const NotFound = lazyLoading(() => import("./pages/NotFound"));
const Create = lazyLoading(() => import("./pages/Create"));

// Layout component for rendering routes with navbar and footer
const Layout = ({ children }) => (
<div>
<Navbar />
{children}
<Footer />
</div>
);

export default function App() {
return (
<BrowserRouter>
<Routes>
<Route
element={
<Layout>
<Home />
</Layout>
}
path="/"
/>
<Route
element={
<Layout>
<Create />
</Layout>
}
path="/create"
/>
<Route
element={
<Layout>
<NotFound />
</Layout>
}
path="/*"
/>
</Routes>
</BrowserRouter>
);
}
Binary file added client/src/assets/hero.webp
Binary file not shown.
Binary file added client/src/assets/icon.webp
Binary file not shown.
Binary file added client/src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/sad-robot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions client/src/components/Footer.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import React from "react";
import { FaGithub, FaTwitter, FaYoutube, FaHashnode } from "react-icons/fa6";
import { Link } from "react-router-dom";

export default function Footer() {
return (
<footer className="bg-[#9fcaff] font-workSans backdrop-blur-md pt-12 pb-6">
<div className="mx-auto px-4 overflow-hidden sm:px-6 lg:px-8 pt-8 border-t-2 border-white">
<nav
className="-mx-5 -my-2 flex flex-wrap justify-center"
aria-label="Footer"
>
<Link
to="#"
className="px-5 py-2 text-base font-semibold text-blue-700 hover:text-blue-500"
>
About
</Link>
<Link
to="#"
className="px-5 py-2 text-base font-semibold text-blue-700 hover:text-blue-500"
>
Pricing
</Link>
<Link
to="https://github.com/Judge-Paul/coverwrite-ai"
className="px-5 py-2 text-base font-semibold text-blue-700 hover:text-blue-500"
>
Contributing
</Link>
</nav>
<div className="mt-8 flex justify-center space-x-4">
<Link
to="https://x.com/jadge_dev"
className="text-blue-700 hover:bg-blue-500 px-1.5 py-1 rounded-md"
>
<span className="sr-only">Twitter</span>
<FaTwitter className="h-6 w-6" />
</Link>
<Link
to="https://github.com/Judge-Paul"
className="text-blue-700 hover:bg-blue-500 px-1.5 py-1 rounded-md"
>
<span className="sr-only">GitHub</span>
<FaGithub className="h-6 w-6" />
</Link>
<Link
to="https://hashnode.com/@jadge"
className="text-blue-700 hover:bg-blue-500 px-1.5 py-1 rounded-md"
>
<span className="sr-only">Hashnode</span>
<FaHashnode className="h-6 w-6" />
</Link>
<Link
to="https://youtube.com/@jadge_dev23"
className="text-blue-700 hover:bg-blue-500 px-1.5 py-1 rounded-md"
>
<span className="sr-only">Youtube</span>
<FaYoutube className="h-6 w-6" />
</Link>
</div>
<div className="text-center mt-10">
<Link
to="https://github.com/Judge-Paul/coverwrite-ai/issues"
className="mt-5 text-base text-blue-700"
>
Have a feature you want to add or noticed a bug?{" "}
<span className="hover:text-blue-500">Create an Issue</span>
</Link>
</div>
<p className="mt-5 text-center text-base text-blue-700">
&copy; 2023 CoverWriteAI. All rights reserved.
</p>
</div>
</footer>
);
}
49 changes: 49 additions & 0 deletions client/src/components/Form.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React, { useState } from "react";
import axios from "axios";

function Form() {
const [prompt, setPrompt] = useState("");
const [generatedText, setGeneratedText] = useState("");

const handleSubmit = async (e) => {
e.preventDefault();

try {
const response = await axios.post("http://localhost:3000/generate", {
prompt,
});
setGeneratedText(response.data.result[0].candidates[0].output);
} catch (error) {
console.error(error);
// Handle error
}
};

return (
<div>
<form onSubmit={handleSubmit}>
<input
type="text"
value={prompt}
onChange={(e) => setPrompt(e.target.value)}
placeholder="Enter your prompt"
className="block border border-black mt-20"
/>
<button
type="submit"
className="bg-blue-500 rounded-sm text-white p-1.5 mt-5"
>
Generate Text
</button>
</form>
{generatedText && (
<div>
<h2>Generated Text:</h2>
<p className="whitespace-pre w-96">{generatedText}</p>
</div>
)}
</div>
);
}

export default Form;
8 changes: 8 additions & 0 deletions client/src/components/Home.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from "react";

export default function Home() {
return (
<div>
</div>
)
}
33 changes: 17 additions & 16 deletions src/Components/Modal.jsx → client/src/components/Modal.jsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
import React, { useState } from "react";
import CopyToClipboard from "react-copy-to-clipboard";
import { jsPDF } from "jspdf";
import { FaDownload } from "react-icons/fa"
import { FaDownload } from "react-icons/fa";
const doc = new jsPDF("p", "in", "a4");

export default function Modal({ showModal, closeModal, text }) {
export default function Modal({ showModal, setShowModal, text }) {
const [editableText, setEditableText] = useState(text);
const [copied, setCopied] = useState(false)
const [copied, setCopied] = useState(false);

function savePDF(text) {
let lMargin=20;
let rMargin=20;
let pdfInMM=210; // width of A4 in mm
let doc = new jsPDF("p","mm","a4");
let lines = doc.splitTextToSize(text, (pdfInMM-lMargin-rMargin));
let lMargin = 20;
let rMargin = 20;
let pdfInMM = 210; // width of A4 in mm
let doc = new jsPDF("p", "mm", "a4");
let lines = doc.splitTextToSize(text, pdfInMM - lMargin - rMargin);
doc.text(lMargin, 20, lines);
doc.save('Cover Letter.pdf');
doc.save("Cover Letter.pdf");
}

return (
<>
{showModal ? (
<>
<div
className="justify-center items-center flex overflow-x-hidden overflow-y-auto fixed inset-0 z-50 outline-none focus:outline-none"
>
<div className="justify-center items-center flex overflow-x-hidden overflow-y-auto fixed inset-0 z-50 outline-none focus:outline-none">
<div className="relative w-auto my-6 mx-auto max-w-3xl">
<div className="border-0 rounded-lg shadow-lg relative flex flex-col w-full md:w-[600px] bg-white outline-none focus:outline-none">
<div className="relative p-6 h-96">
Expand All @@ -35,21 +33,24 @@ export default function Modal({ showModal, closeModal, text }) {
/>
</div>
<div className="flex items-center justify-end p-6 border-t border-solid border-slate-200 rounded-b">
<button
<button
onClick={() => savePDF(editableText)}
className="bg-blue-500 text-white font-bold py-3 px-4 rounded hover:bg-blue-700 mr-3"
>
<FaDownload />
</button>
<CopyToClipboard text={editableText} onCopy={() => setCopied(true)}>
<CopyToClipboard
text={editableText}
onCopy={() => setCopied(true)}
>
<button className="bg-blue-500 text-white font-bold py-2 px-4 rounded hover:bg-blue-700">
{copied ? "Copied!" : "Copy to clipboard"}
</button>
</CopyToClipboard>
<button
className="text-red-500 background-transparent font-bold uppercase px-6 py-2 text-sm outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150"
type="button"
onClick={closeModal}
onClick={() => setShowModal(false)}
>
Close
</button>
Expand All @@ -62,4 +63,4 @@ export default function Modal({ showModal, closeModal, text }) {
) : null}
</>
);
}
}
Loading

1 comment on commit 864113c

@vercel
Copy link

@vercel vercel bot commented on 864113c Aug 21, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

coverwrite-ai – ./

coverwrite.vercel.app
coverwrite-ai-git-main-judge-paul.vercel.app
coverwrite-ai-judge-paul.vercel.app

Please sign in to comment.