Skip to content

Commit

Permalink
various bug fixes and polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgerhant committed Aug 19, 2023
1 parent 749402f commit 4756b0e
Show file tree
Hide file tree
Showing 23 changed files with 332 additions and 271 deletions.
1 change: 1 addition & 0 deletions @types/user.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ export type FirebaseContext = {
setIPData : Dispatch<SetStateAction<DocumentData | null>>;
resetStatisticsData: Dispatch<SetStateAction<DocumentData | null>>;
resetData: ()=>void;
resetAllData: ()=>void;
}
88 changes: 55 additions & 33 deletions app/(landingpages)/about/page.tsx
Original file line number Diff line number Diff line change
@@ -1,60 +1,82 @@
import logo from "@/public/Logo.svg"
import clientSubmission from "@/public/clientSubmission.png"
import clientSubmission from "@/public/mediumClientSide2.png"//"@/public/clientSubmission.png"
import serverSubmission from "@/public/mediumServerSide.png"//from "@/public/serverSubmission.png"
import medium from "@/public/medium.png"
import words from "@/public/words.png"
import portrait from "@/public/portrait2.jpg"
export default function Page() {

return (
<>
<div className="flex w-full overflow-y-scroll h-[100vh] justify-center">
<div className="flex flex-col w-full max-w-[1400px] ">
<div className="bg-white h-[65px] flex flex-row justify-between items-center">
<div className="flex w-full justify-center">
<div className="flex flex-col w-full max-w-[1400px]">
<div className="bg-white h-[65px] max-w-[1400px] flex flex-row justify-between items-center">
<div className="flex flex-row">
<a href="/" className="font-bold text-[25px] py-1 whitespace-nowrap flex flex-row
align-center mt-1">
<img src={logo.src} className="w-[40px] mt-[-2px] mr-1"/>
Print Submit
</a>
<a href="/about" className="mt-[14px] h-6 ml-14 text-[16px] text-gray-700 px-3 bg-gray-200 rounded-xl cursor-pointer">
About
</a>
<a href="/pricing" className="mt-[14px] h-[25px] ml-8 text-[16px] text-gray-700 px-3 cursor-pointer">
Pricing
</a>
<a href="/contact" className="mt-[14px] h-6 ml-8 text-[16px] text-gray-700 px-3 cursor-pointer">
Contact
</a>
<a href="/" className="font-bold text-[25px] py-1 whitespace-nowrap flex flex-row
align-center mt-1">
<img src={logo.src} className="w-[40px] mt-[-2px] mr-1"/>
Print Submit
</a>
<a href="/about" className="mt-[14px] h-6 ml-14 text-[16px] bg-gray-200 rounded-xl text-gray-700 px-3 cursor-pointer">
About
</a>
<a href="/pricing" className="mt-[14px] h-[25px] ml-8 text-[16px] text-gray-700 px-3 cursor-pointer">
Pricing
</a>
<a href="/contact" className="mt-[14px] h-6 ml-8 text-[16px] text-gray-700 px-3 cursor-pointer">
Contact
</a>
</div>
<div className="flex w-1/2 items-center justify-end cursor-pointer">
<a href="/login" className="font-semibold text-blue-600 py-1 px-2 rounded-lg hover:bg-gray-600/[0.1]">Login</a>
<a href="/register" className="font-semibold text-blue-600 ml-2 py-1 px-2 rounded-lg hover:bg-gray-600/[0.1]">Create account</a>
<a href="/submissions?continue=guest" className="min-w-[170px] font-semibold text-center py-2 ml-3 mr-4 bg-blue-600 hover:bg-blue-700 text-white rounded-md cursor-pointer">Go to Dashboard</a>
<a href="/login" className="font-semibold text-blue-600 py-1 px-2 rounded-lg hover:bg-gray-600/[0.1]">Login</a>
<a href="/register" className="font-semibold text-blue-600 ml-2 py-1 px-2 rounded-lg hover:bg-gray-600/[0.1]">Create account</a>
<a href="/submissions?continue=guest" className="min-w-[170px] font-semibold text-center py-2 ml-3 mr-4 bg-blue-600 hover:bg-blue-700 text-white rounded-md cursor-pointer">Go to Dashboard</a>
</div>
</div>

</div>

<div className="border w-[850px] mt-14 px-10 py-4 self-center shadow">
<div className="flex flex-row mb-2">
<div className="h-[70px] w-[70px] rounded-xl bg-gray-300"/>
<div className="flex flex-row mb-2 items-center">
<img className="h-[75px] w-[75px] rounded-full" src={portrait.src}/>
<div className="flex flex-col ml-4 justify-end">
<p className="text-lg font-bold text-gray-700">Developer</p>
<p className="text-2xl">Adam Gerhant</p>
</div>
</div>
<hr/>
<div className="text text-gray-800 mt-2 w">Hi, I'm Adam. I had the idea for Print Submit after starting a 3D printing service at my local library,
<div className="text text-gray-800 mt-2 w">Hi, I&apos;m Adam. I had the idea for Print Submit after starting a 3D printing service at my local library,
and realizing there were no good tools for creating an online submission form specifically for 3D print requests.
This app helps simplify this process and includes many security, customizeablilty, and quality of life features.</div>
</div>

<div className="w-[900px] self-center mt-10 flex flex-col">
<p className="font-semibold text-xl">How a server side submission process enables maximum security</p>
<p className="text-gray-800 mt-2">THe simplest way to upload files to a server is by allowing the database to be publicly writeable,


<div className="w-[900px] mb-[100px] self-center mt-20 flex flex-col text-xl text-gray-800 ">
<p className="text-2xl">Server side submission process for maximum security</p>

<hr className="w-[900px] self-center"/>

<p className="text-gray-800 mt-4 text-lg">The simplest way to upload files to a server is by allowing the database to be publicly writeable,
and have the client send files as needed. However, this is not a safe method, since there is no way to enfore security. Any data can be uploaded at any time.
</p>
<img className="w-[600px] self-center"src={clientSubmission.src}/>
<p className="text-gray-800 mt-2">With client side submissions, if a user can upload a file, then a malicious user can as well. This is why Print Submit
<img className="w-[600px] self-center mt-4"src={clientSubmission.src}/>
<p className="text-gray-800 mt-2 text-lg">With a client side submission process, if a user can upload a file, then a malicious user can as well. This is why Print Submit
uses a server side submission process.
The basic process beind this is to first verify the request, send a temporary upload link to the user, and then verify if the correct files were submitted.
</p>
<img className="w-[600px] self-center mt-4"src={serverSubmission.src}/>
<p className="text-gray-800 mt-2 text-lg"> The basic process beind this is to first verify the request, then send a temporary storage key to the user which can be used to upload files.
This allows for the database and storage and be locked, which provides security against attacks and malicious users.
</p>
<div className="self-center w-[630px] mt-8">
<p className="self-center text-left">Read the full article for a more detailed explanation</p>
</div>
<a href="https://medium.com/@adamgerhant/server-side-upload-process-to-cloud-storage-and-firestore-with-cloud-functions-c748384eee91"
target="_blank"
className="p-4 border self-center hover:shadow-lg transition mt-2 relative">
<img className="w-[600px] z-1 self-center cursor-pointer"src={medium.src}/>
<img className="z-2 absolute bottom-[28px] left-[148px] w-[60px]"src={words.src}/>
</a>
</div>

</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions app/(landingpages)/pricing/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default function Page() {
</a>
</div>

<div className="w-[400px] h-[730px] p-10 border-2 border-gray-300 rounded-xl shadow-[0_0px_30px_#ddd6fe]">
<div className="w-[400px] h-[730px] p-10 border-2 border-[#ddd6fe] shadow-[0px_0px_5px_#ddd6fe] border-gray-300 rounded-xl ">
<p className="font-bold text-2xl">Premium</p>
<div className="flex flex-row items-baseline mt-1">
<span className="font-bold text-4xl ">$5</span>
Expand Down Expand Up @@ -206,7 +206,7 @@ export default function Page() {

</div>
<div className="mx-2 mt-6 px-4 py-2 w-[290px] border-[1px] border-violet-700 bg-violet-700 rounded flex flex-row justify-between cursor-pointer hover:bg-white text-white hover:text-violet-700 ease-out duration-200 shadow-[0_0_10px_#6d28d9]">
<p className="text-[15px] font-semibold">Buy now</p>
<p className="text-[15px] font-semibold">Temporarily Unavailable</p>
<BsArrowRight className="h-full w-[22px]"/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/(landingpages)/privacy/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function Page() {
Registration information: We store information you provide us on this site when creating an account or filling out a form. This information commonly includes name and email address.
</div>
<div className="text-xl mt-2">
Billing information: Our integrations with third party payment gateways are for processing only. We don't store or log any sensitive cardholder data provided by you or your form users.
Billing information: Our integrations with third party payment gateways are for processing only. We don&apos;t store or log any sensitive cardholder data provided by you or your form users.
</div>
<div className="text-xl mt-2">
Submission and Form data: When using the form editor, your changes are saved to a third party database provider. We currently use the Firebase Firestore database. Submissions are stored in a similar manner, but also include Google Cloud Storage for file storage.
Expand Down
8 changes: 3 additions & 5 deletions app/(main)/(dashboard)/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useRouter } from 'next/navigation';
import { getAuth, deleteUser } from "firebase/auth";

const Header = () => {
const {resetData, accountInformation} = useFirebaseContext() as FirebaseContext;
const {resetAllData, accountInformation} = useFirebaseContext() as FirebaseContext;
const {currentUser} = useAuthContext() as UserContext;
const [confirmDeleteAccount, setConfirmDeleteAccount] = useState(false);

Expand All @@ -21,9 +21,7 @@ const Header = () => {

const handleClickOutside = (event:any) => {
let clickedOutside = true
console.log("path: ")
event.composedPath().map((element: { className: any; })=>{
console.log(element.className);
if(element.className=="profileWrapper"){
clickedOutside = false;
}
Expand All @@ -47,7 +45,7 @@ const Header = () => {
const router = useRouter();
const signOutFunction = () =>{
signOut(auth).then(()=>{
resetData();
resetAllData();
router.push("/register?redirect=false")
})
}
Expand Down Expand Up @@ -81,7 +79,7 @@ const Header = () => {
Profile
</button>
<div className="profileWrapper">
{isOpen && <Profile resetData={resetData} accountInformation={accountInformation} setConfirmDeleteAccount={setConfirmDeleteAccount}/>}
{isOpen && <Profile resetData={resetAllData} accountInformation={accountInformation} setConfirmDeleteAccount={setConfirmDeleteAccount}/>}
</div>
</div>
{confirmDeleteAccount&&
Expand Down
2 changes: 1 addition & 1 deletion app/(main)/(dashboard)/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const Profile = ({resetData, accountInformation, setConfirmDeleteAccount}:any,
}
{!accountInformation&&
<>
<p>Getting account type:</p>
<p>Getting account type</p>
</>
}

Expand Down
6 changes: 5 additions & 1 deletion app/(main)/(dashboard)/emails/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FirebaseContext } from "@/@types/user";
import Emails from "./Emails"
import { getAuth } from "firebase/auth";
const EmailPage = () =>{
const {emailData, setEmailData, submissionFormData} = useFirebaseContext() as FirebaseContext;
const {emailData, setEmailData, submissionFormData, accountInformation} = useFirebaseContext() as FirebaseContext;
const [loading, setLoading] = useState(false);
if(emailData&&submissionFormData){
const auth = getAuth();
Expand Down Expand Up @@ -88,6 +88,10 @@ const EmailPage = () =>{
</div>
<p className="description">This is the account emails will be sent from. This account can be any Google account</p>
</div>
{accountInformation&&accountInformation.accountType=="Guest"&&
<div className='guestNotice'>
Note: Emails cannot be sent from a guest account
</div>}
</div>

</div>
Expand Down
Loading

0 comments on commit 4756b0e

Please sign in to comment.