diff --git a/.env b/.env index 2b7afe7..8e48114 100644 --- a/.env +++ b/.env @@ -1,13 +1,14 @@ # Created by Vercel CLI -NX_DAEMON="false" +NX_DAEMON="" POSTGRES_DATABASE="verceldb" -POSTGRES_HOST="ep-winter-limit-145193-pooler.ap-southeast-1.postgres.vercel-storage.com" -POSTGRES_PASSWORD="18rfAJokLFCU" -POSTGRES_PRISMA_URL="postgres://default:18rfAJokLFCU@ep-winter-limit-145193-pooler.ap-southeast-1.postgres.vercel-storage.com/verceldb?pgbouncer=true&connect_timeout=15" -POSTGRES_URL="postgres://default:18rfAJokLFCU@ep-winter-limit-145193-pooler.ap-southeast-1.postgres.vercel-storage.com/verceldb" -POSTGRES_URL_NON_POOLING="postgres://default:18rfAJokLFCU@ep-winter-limit-145193.ap-southeast-1.postgres.vercel-storage.com/verceldb" +POSTGRES_HOST="ep-wild-dew-687907-pooler.ap-southeast-1.postgres.vercel-storage.com" +POSTGRES_PASSWORD="yGnlUEjr0ta6" +POSTGRES_PRISMA_URL="postgres://default:yGnlUEjr0ta6@ep-wild-dew-687907-pooler.ap-southeast-1.postgres.vercel-storage.com/verceldb?pgbouncer=true&connect_timeout=15" +POSTGRES_URL="postgres://default:yGnlUEjr0ta6@ep-wild-dew-687907-pooler.ap-southeast-1.postgres.vercel-storage.com/verceldb" +POSTGRES_URL_NON_POOLING="postgres://default:yGnlUEjr0ta6@ep-wild-dew-687907.ap-southeast-1.postgres.vercel-storage.com/verceldb" POSTGRES_USER="default" -TURBO_REMOTE_ONLY="true" +TURBO_REMOTE_ONLY="" +TURBO_RUN_SUMMARY="" VERCEL="1" VERCEL_ENV="development" VERCEL_GIT_COMMIT_AUTHOR_LOGIN="" diff --git a/package-lock.json b/package-lock.json index cf2c9a0..ade38ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "pantry-pilot-2", + "name": "pantry-pilot", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/public/img/heroImg/beef.png b/public/img/heroImg/beef.png deleted file mode 100644 index 1ba6ae0..0000000 Binary files a/public/img/heroImg/beef.png and /dev/null differ diff --git a/public/img/heroImg/bun.png b/public/img/heroImg/bun.png deleted file mode 100644 index ec5d31c..0000000 Binary files a/public/img/heroImg/bun.png and /dev/null differ diff --git a/public/img/heroImg/burger.jpg b/public/img/heroImg/burger.jpg deleted file mode 100644 index 366f826..0000000 Binary files a/public/img/heroImg/burger.jpg and /dev/null differ diff --git a/public/img/heroImg/cheese.png b/public/img/heroImg/cheese.png deleted file mode 100644 index 52220cc..0000000 Binary files a/public/img/heroImg/cheese.png and /dev/null differ diff --git a/public/img/heroImg/egg.png b/public/img/heroImg/egg.png deleted file mode 100644 index 385a4a7..0000000 Binary files a/public/img/heroImg/egg.png and /dev/null differ diff --git a/public/img/heroImg/ketchup.png b/public/img/heroImg/ketchup.png deleted file mode 100644 index bd3c4bd..0000000 Binary files a/public/img/heroImg/ketchup.png and /dev/null differ diff --git a/public/img/heroImg/lettuce.png b/public/img/heroImg/lettuce.png deleted file mode 100644 index e93c5c8..0000000 Binary files a/public/img/heroImg/lettuce.png and /dev/null differ diff --git a/public/img/heroImg/olive_oil.png b/public/img/heroImg/olive_oil.png deleted file mode 100644 index dabb929..0000000 Binary files a/public/img/heroImg/olive_oil.png and /dev/null differ diff --git a/public/img/heroImg/onion.png b/public/img/heroImg/onion.png deleted file mode 100644 index 92d36f1..0000000 Binary files a/public/img/heroImg/onion.png and /dev/null differ diff --git a/public/img/heroImg/tomato.png b/public/img/heroImg/tomato.png deleted file mode 100644 index 378ada2..0000000 Binary files a/public/img/heroImg/tomato.png and /dev/null differ diff --git a/public/img/ingCategoryIcon/fish.png b/public/img/ingCategoryIcon/fish.png deleted file mode 100644 index 7c3f641..0000000 Binary files a/public/img/ingCategoryIcon/fish.png and /dev/null differ diff --git a/public/img/ingCategoryIcon/fruits.png b/public/img/ingCategoryIcon/fruits.png deleted file mode 100644 index a9b4629..0000000 Binary files a/public/img/ingCategoryIcon/fruits.png and /dev/null differ diff --git a/public/img/ingCategoryIcon/meats.png b/public/img/ingCategoryIcon/meats.png deleted file mode 100644 index 4cd99f4..0000000 Binary files a/public/img/ingCategoryIcon/meats.png and /dev/null differ diff --git a/public/img/ingCategoryIcon/pantryEssentials.png b/public/img/ingCategoryIcon/pantryEssentials.png deleted file mode 100644 index 1f668d8..0000000 Binary files a/public/img/ingCategoryIcon/pantryEssentials.png and /dev/null differ diff --git a/public/img/ingCategoryIcon/poultry.png b/public/img/ingCategoryIcon/poultry.png deleted file mode 100644 index 87c66a2..0000000 Binary files a/public/img/ingCategoryIcon/poultry.png and /dev/null differ diff --git a/public/img/ingCategoryIcon/vegetablesGreens.png b/public/img/ingCategoryIcon/vegetablesGreens.png deleted file mode 100644 index 5adf83d..0000000 Binary files a/public/img/ingCategoryIcon/vegetablesGreens.png and /dev/null differ diff --git a/public/img/logo.svg b/public/img/logo.svg deleted file mode 100644 index c80f424..0000000 --- a/public/img/logo.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/public/img/navIcon/cupboard.svg b/public/img/navIcon/cupboard.svg deleted file mode 100644 index 3bcb2fc..0000000 --- a/public/img/navIcon/cupboard.svg +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/public/img/navIcon/home.svg b/public/img/navIcon/home.svg deleted file mode 100644 index 70b532d..0000000 --- a/public/img/navIcon/home.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/img/navIcon/profile.svg b/public/img/navIcon/profile.svg deleted file mode 100644 index e421268..0000000 --- a/public/img/navIcon/profile.svg +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/public/img/navIcon/recipe.svg b/public/img/navIcon/recipe.svg deleted file mode 100644 index caabb85..0000000 --- a/public/img/navIcon/recipe.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/public/img/oldLogo.png b/public/img/oldLogo.png deleted file mode 100644 index b0dfd0b..0000000 Binary files a/public/img/oldLogo.png and /dev/null differ diff --git a/public/img/productImg/foodbox.png b/public/img/productImg/foodbox.png deleted file mode 100644 index 90be5d7..0000000 Binary files a/public/img/productImg/foodbox.png and /dev/null differ diff --git a/public/img/productImg/rendang.png b/public/img/productImg/rendang.png deleted file mode 100644 index 2521d0d..0000000 Binary files a/public/img/productImg/rendang.png and /dev/null differ diff --git a/public/img/productImg/spaghetti.png b/public/img/productImg/spaghetti.png deleted file mode 100644 index 476df9e..0000000 Binary files a/public/img/productImg/spaghetti.png and /dev/null differ diff --git a/public/img/team.png b/public/img/team.png deleted file mode 100644 index e0a34a6..0000000 Binary files a/public/img/team.png and /dev/null differ diff --git a/public/img/teamorg.png b/public/img/teamorg.png deleted file mode 100644 index 68a53f5..0000000 Binary files a/public/img/teamorg.png and /dev/null differ diff --git a/src/app/(auth)/login/page.tsx b/src/app/(auth)/login/page.tsx deleted file mode 100644 index 36f0949..0000000 --- a/src/app/(auth)/login/page.tsx +++ /dev/null @@ -1,95 +0,0 @@ -"use client"; -import React, { useState } from "react"; -import Header from "@/components/Header"; -import Link from "next/link"; -import { signIn, useSession } from "next-auth/react"; - -const Login = () => { - const [email, setEmail] = useState(""); - const [password, setPassword] = useState(""); - const session = useSession(); - - const handleLogin = async () => { - const result = await signIn("credentials", { - email, - password, - redirect: false, // Disable automatic redirect - }); - - if (!result?.error) { - // You can access the user object from the session - if (session.data?.user?.isAdmin === true) { - window.location.href = "/dashboard/admin"; // Redirect to admin dashboard - } - if (session.data?.user?.isAdmin === false) { - window.location.href = "/dashboard/user"; // Redirect to user dashboard - } - } else { - console.log(result.error); // Handle login error - } - }; - - return ( - <> -
-
-

Login

-
-
- - setEmail(e.target.value)} - /> -
-
- -
- setPassword(e.target.value)} - /> - {/* */} -
-
- - -
-

- Not Registered? - - -   Sign up - - -

-
- - ); -}; - -export default Login; diff --git a/src/app/(auth)/register/page.tsx b/src/app/(auth)/register/page.tsx deleted file mode 100644 index a6cedd1..0000000 --- a/src/app/(auth)/register/page.tsx +++ /dev/null @@ -1,135 +0,0 @@ -"use client"; -import Header from "@/components/Header"; -import Link from "next/link"; -import { signIn } from "next-auth/react"; -import { ChangeEvent, useState } from "react"; - -export default function RegisterPage() { - const [showPassword, setShowPassword] = useState(false); - - const togglePasswordVisibility = () => { - setShowPassword(!showPassword); - }; - - let [loading, setLoading] = useState(false); - let [formValues, setFormValues] = useState({ - name: "", - email: "", - password: "", - }); - - const onSubmit = async (e: React.FormEvent) => { - e.preventDefault(); - setLoading(true); - - try { - const res = await fetch("/api/register", { - method: "POST", - body: JSON.stringify(formValues), - headers: { - "Content-Type": "application/json", - }, - }); - - setLoading(false); - if (!res.ok) { - alert((await res.json()).message); - return; - } - - signIn(undefined, { callbackUrl: "/" }); - } catch (error: any) { - setLoading(false); - console.error(error); - alert(error.message); - } - }; - - const handleChange = (event: ChangeEvent) => { - const { name, value } = event.target; - setFormValues({ ...formValues, [name]: value }); - }; - return ( - <> -
-
-

Create Account

-
-
- - -
-
- - -
-
- -
- - -
-
- -
-

- Already have an account? - - -   Sign in - - -

-
- - ); -} diff --git a/src/app/api/auth/[...nextauth]/route.ts b/src/app/api/auth/[...nextauth]/route.ts deleted file mode 100644 index 721d9ec..0000000 --- a/src/app/api/auth/[...nextauth]/route.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { authOptions } from "@/lib/auth"; -import NextAuth from "next-auth"; - -const handler = NextAuth(authOptions); -export { handler as GET, handler as POST }; - diff --git a/src/app/api/register/route.ts b/src/app/api/register/route.ts deleted file mode 100644 index 7777a3e..0000000 --- a/src/app/api/register/route.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { prisma } from "@/lib/prisma"; -import { hash } from "bcrypt"; -import { NextResponse } from "next/server"; - -export async function POST(req: Request) { - try { - const { name, email, password } = (await req.json()) as { - name: string; - email: string; - password: string; - isAdmin: boolean; - }; - const hashed_password = await hash(password, 12); - - const user = await prisma.user.create({ - data: { - name, - email: email.toLowerCase(), - password: hashed_password, - isAdmin: false, - }, - }); - - return NextResponse.json({ - user: { - name: user.name, - email: user.email, - isAdmin: user.isAdmin, - }, - }); - } catch (error: any) { - return new NextResponse( - JSON.stringify({ - status: "error", - message: error.message, - }), - { status: 500 } - ); - } -} \ No newline at end of file diff --git a/src/app/api/session/route.ts b/src/app/api/session/route.ts deleted file mode 100644 index 6b210d4..0000000 --- a/src/app/api/session/route.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { getServerSession } from "next-auth"; -import { authOptions } from "@/lib/auth"; -import { NextResponse } from "next/server"; - -export async function GET(request: Request) { - const session = await getServerSession(authOptions); - - return NextResponse.json({ - authenticated: !!session, - session, - }); -} diff --git a/src/app/dashboard/admin/IngredientAdd.tsx b/src/app/dashboard/admin/IngredientAdd.tsx deleted file mode 100644 index 9bf3008..0000000 --- a/src/app/dashboard/admin/IngredientAdd.tsx +++ /dev/null @@ -1,189 +0,0 @@ -"use client"; -import React, { useState, ChangeEvent, FormEvent } from "react"; - -interface Ingredient { - id: number; - name: string; - category: string; -} - -const IngredientsPage: React.FC = () => { - const [ingredients, setIngredients] = useState([]); - const [newIngredient, setNewIngredient] = useState({ - id: 0, - name: "", - category: "", - }); - const [editMode, setEditMode] = useState(false); - const [editIngredientId, setEditIngredientId] = useState(null); - - const handleChange = ( - e: ChangeEvent - ) => { - const { name, value } = e.target; - setNewIngredient((prevIngredient) => ({ - ...prevIngredient, - [name]: value, - })); - }; - - const handleSubmit = (e: FormEvent) => { - e.preventDefault(); - if ( - newIngredient.name.trim() === "" || - newIngredient.category.trim() === "" - ) { - return; - } - - if (editMode && editIngredientId !== null) { - // Editing existing ingredient - const updatedIngredients = ingredients.map((ingredient) => - ingredient.id === editIngredientId - ? { ...newIngredient, id: ingredient.id } - : ingredient - ); - setIngredients(updatedIngredients); - setEditMode(false); - setEditIngredientId(null); - } else { - // Adding new ingredient - const newId = - ingredients.length > 0 ? ingredients[ingredients.length - 1].id + 1 : 1; - const updatedIngredients = [ - ...ingredients, - { ...newIngredient, id: newId }, - ]; - setIngredients(updatedIngredients); - } - - setNewIngredient({ id: 0, name: "", category: "" }); - }; - - const handleDelete = (id: number) => { - const updatedIngredients = ingredients.filter( - (ingredient) => ingredient.id !== id - ); - setIngredients(updatedIngredients); - if (editMode && editIngredientId === id) { - setEditMode(false); - setEditIngredientId(null); - } - }; - - const handleEdit = (id: number) => { - const ingredientToEdit = ingredients.find( - (ingredient) => ingredient.id === id - ); - if (ingredientToEdit) { - setNewIngredient(ingredientToEdit); - setEditMode(true); - setEditIngredientId(id); - } - }; - - const handleCancelEdit = () => { - setNewIngredient({ id: 0, name: "", category: "" }); - setEditMode(false); - setEditIngredientId(null); - }; - - return ( -
-
-

Ingredient | Add

-
-
-
- - -
-
- - -
- {editMode ? ( -
- - -
- ) : ( - - )} -
- -

Ingredients List

- {ingredients.length === 0 ? ( -

No ingredients added yet.

- ) : ( -
    - {ingredients.map((ingredient) => ( -
  • - - {ingredient.name} - {ingredient.category} - -
    - - -
    -
  • - ))} -
- )} -
- ); -}; - -export default IngredientsPage; diff --git a/src/app/dashboard/admin/OrderAdd.tsx b/src/app/dashboard/admin/OrderAdd.tsx deleted file mode 100644 index c89e516..0000000 --- a/src/app/dashboard/admin/OrderAdd.tsx +++ /dev/null @@ -1,138 +0,0 @@ -import React, { FC } from "react"; - -interface OrderAddProps {} - -const OrderAdd: FC = ({}) => { - return ( - <> -
-

Orders

- {/* */} -
- {/* */} -
- - -
-
- {/* */} -
    -
    -
  • -
    -

    Rizfi Ferdiansyah

    -

    Beef Steak

    -
    - -
    -
    -
  • -
    -
  • -
    -

    Rizfi Ferdiansyah

    -

    beef, leek, lemongrass, tamarind, lime leaves...

    -
    - -
    -
    -
  • -
    -
  • -
    -

    Rizfi Ferdiansyah

    -

    beef, leek, lemongrass, tamarind, lime leaves...

    -
    - -
    -
    -
  • -
    -
  • -
    -

    Rizfi Ferdiansyah

    -

    Beef Steak

    -
    - -
    -
    -
  • -
    -
  • -
    -

    Rizfi Ferdiansyah

    -

    beef, leek, lemongrass, tamarind, lime leaves...

    -
    - -
    -
    -
  • -
    -
  • -
    -

    Rizfi Ferdiansyah

    -

    beef, leek, lemongrass, tamarind, lime leaves...

    -
    - -
    -
    -
  • -
- {/* */} - -
- - ); -}; - -export default OrderAdd; diff --git a/src/app/dashboard/admin/RecipeAdd.tsx b/src/app/dashboard/admin/RecipeAdd.tsx deleted file mode 100644 index c2f8e10..0000000 --- a/src/app/dashboard/admin/RecipeAdd.tsx +++ /dev/null @@ -1,198 +0,0 @@ -"use client"; -import React, { useState, ChangeEvent } from "react"; - -interface Ingredient { - name: string; - amount: string; - measurement: string; -} - -interface Recipe { - foodName: string; - foodImage: File | null; - description: string; - ingredients: Ingredient[]; - steps: string; -} - -const RecipeAdd: React.FC = () => { - const [recipe, setRecipe] = useState({ - foodName: "", - foodImage: null, - description: "", - ingredients: [{ name: "", amount: "", measurement: "" }], - steps: "", - }); - - const handleChange = ( - e: ChangeEvent, - index?: number - ) => { - const { name, value } = e.target; - if (name === "foodImage") { - const file = (e.target as HTMLInputElement).files?.[0] || null; - setRecipe({ ...recipe, [name]: file }); - } else if (index !== undefined) { - const ingredients = [...recipe.ingredients]; - ingredients[index][name as keyof Ingredient] = value; - setRecipe({ ...recipe, ingredients }); - } else { - setRecipe({ ...recipe, [name]: value }); - } - }; - - const handleAddIngredient = () => { - setRecipe({ - ...recipe, - ingredients: [ - ...recipe.ingredients, - { name: "", amount: "", measurement: "" }, - ], - }); - }; - - const handleRemoveIngredient = (index: number) => { - const ingredients = [...recipe.ingredients]; - ingredients.splice(index, 1); - setRecipe({ ...recipe, ingredients }); - }; - - const handleSubmit = (e: React.MouseEvent) => { - e.preventDefault(); - alert(JSON.stringify(recipe, null, 2)); - }; - - return ( - <> -
-
-

Recipe | Add

-
-
- {/* */} -
- - -
- {/* */} -
- - -
- {/* */} -
- - -
- {/* */} -
-
- {/* */} - - {recipe.ingredients.map((ingredient, index) => ( -
- handleChange(e, index)} - className="border gray-300 rounded px-3 py-2 mr-2 col-span-2" - /> - handleChange(e, index)} - className="border border-gray-300 rounded px-3 py-2 mr-2" - /> - - {index > 0 && ( - - )} -
- ))} - -
-
- {/* */} -
- - -
- -
-
- - ); -}; - -export default RecipeAdd; diff --git a/src/app/dashboard/admin/RestoAdd.tsx b/src/app/dashboard/admin/RestoAdd.tsx deleted file mode 100644 index bf6f05a..0000000 --- a/src/app/dashboard/admin/RestoAdd.tsx +++ /dev/null @@ -1,217 +0,0 @@ -import React, { useState, ChangeEvent, FC } from "react"; -interface RestoAddProps {} - -interface MenuItem { - foodName: string; - recipe: string; - price: number | string; - image: File | null; - description: string; -} - -interface Restaurant { - name: string; - image: File | null; - description: string; - location: string; - menu: MenuItem[]; -} - -const RestoAdd: FC = () => { - const [restaurant, setRestaurant] = useState({ - name: "", - image: null, - description: "", - location: "", - menu: [ - { foodName: "", recipe: "", price: "", image: null, description: "" }, - ], - }); - - const handleChange = ( - e: ChangeEvent, - index?: number - ) => { - const { name, value } = e.target; - if (name === "image" || name === "menuImage") { - const file = (e.target as HTMLInputElement).files?.[0] || null; - setRestaurant({ ...restaurant, [name]: file }); - } else if (index !== undefined) { - const menu = [...restaurant.menu]; - menu[index] = { - ...menu[index], - [name as keyof MenuItem]: value, - }; - setRestaurant({ ...restaurant, menu }); - } else { - setRestaurant({ ...restaurant, [name]: value }); - } - }; - - const handleAddMenuItem = () => { - setRestaurant({ - ...restaurant, - menu: [ - ...restaurant.menu, - { foodName: "", recipe: "", price: 0, image: null, description: "" }, - ], - }); - }; - - const handleRemoveMenuItem = (index: number) => { - const menu = [...restaurant.menu]; - menu.splice(index, 1); - setRestaurant({ ...restaurant, menu }); - }; - - const handleSubmit = (e: React.MouseEvent) => { - e.preventDefault(); - alert(JSON.stringify(restaurant, null, 2)); - }; - - const recipes = ["Recipe 1", "Recipe 2", "Recipe 3"]; - - return ( -
-
-

Restaurant | Add

-
-
-
- - -
-
- - -
-
- - -
-
- - -
- - -
- {restaurant.menu.map((menuItem, index) => ( -
-
- handleChange(e, index)} - className="border border-gray-300 rounded px-3 py-2 col-span-2" - /> - - handleChange(e, index)} - className="border border-gray-300 rounded px-3 py-2 col-span-1" - /> - handleChange(e, index)} - className="border border-gray-300 rounded px-3 py-2 col-span-1" - /> -
-
- - {index > 0 && ( - - )} -
-
- ))} - -
- -
-
- ); -}; - -export default RestoAdd; diff --git a/src/app/dashboard/admin/page.tsx b/src/app/dashboard/admin/page.tsx deleted file mode 100644 index 94733bc..0000000 --- a/src/app/dashboard/admin/page.tsx +++ /dev/null @@ -1,90 +0,0 @@ -"use client"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import React, { useState } from "react"; -import { - faBowlFood, - faUtensils, - faReceipt, - faCarrot, -} from "@fortawesome/free-solid-svg-icons"; -import RestoAdd from "./RestoAdd"; -import RecipeAdd from "./RecipeAdd"; -import OrderAdd from "./OrderAdd"; -import IngredientAdd from "./IngredientAdd"; -import { LogoutButton } from "@/components/Buttons"; -import { getServerSession } from "next-auth"; -import { redirect } from "next/navigation"; - -const AdminDashboard = async () => { - const [activeTab, setActiveTab] = useState("tab1"); - - const handleTabChange = (tabName: string) => { - setActiveTab(tabName); - }; - - const session = await getServerSession(); - - if (!session) { - redirect("/login"); - } - - return ( - <> -
- {/* */} -
-
-
handleTabChange("tab1")} - className={`flex gap-4 items-center cursor-pointer hover:text-white ${ - activeTab === "tab1" ? "text-white" : "text-rose-300" - }`} - > - -

Ingredient

-
-
handleTabChange("tab2")} - className={`flex gap-4 items-center cursor-pointer hover:text-white ${ - activeTab === "tab2" ? "text-white" : "" - }`} - > - -

Recipe

-
-
handleTabChange("tab3")} - className={`flex gap-4 items-center cursor-pointer hover:text-white ${ - activeTab === "tab3" ? "text-white" : "" - }`} - > - -

Resto

-
-
handleTabChange("tab4")} - className={`flex gap-4 items-center cursor-pointer hover:text-white ${ - activeTab === "tab4" ? "text-white" : "" - }`} - > - -

Order

-
-
- -
-
-
- {/* */} -
- {activeTab === "tab1" && } - {activeTab === "tab2" && } - {activeTab === "tab3" && } - {activeTab === "tab4" && } -
-
- - ); -}; - -export default AdminDashboard; diff --git a/src/app/dashboard/user/page.tsx b/src/app/dashboard/user/page.tsx deleted file mode 100644 index a152638..0000000 --- a/src/app/dashboard/user/page.tsx +++ /dev/null @@ -1,213 +0,0 @@ -import Image from "next/image"; -import home from "../../../../public/img/navIcon/home.svg"; -import pantry from "../../../../public/img/navIcon/cupboard.svg"; -import recipe from "../../../../public/img/navIcon/recipe.svg"; -import profile from "../../../../public/img/navIcon/profile.svg"; -import IngredientCard from "@/components/IngredientCard"; -import RecipeCard from "@/components/RecipeCard"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { - faMagnifyingGlass, - faRightFromBracket, -} from "@fortawesome/free-solid-svg-icons"; -import "@fortawesome/fontawesome-svg-core/styles.css"; -import "../../../../fontawesome"; -import { getServerSession } from "next-auth"; -import { redirect } from "next/navigation"; -import { PrismaClient } from "@prisma/client"; -import { LogoutButton } from "@/components/Buttons"; -const prisma = new PrismaClient(); - -const getIngredients = async () => { - const res = await prisma.ingredient.findMany({ - select: { - id: true, - name: true, - category: true, - }, - }); - return res; -}; - -const getCategories = async () => { - const res = await prisma.category.findMany({ - select: { - id: true, - name: true, - img: true, - ingredients: true, - }, - }); - return res; -}; - -const getRecipes = async () => { - const res = await prisma.recipe.findMany({ - select: { - id: true, - name: true, - img: true, - ingredients: true, - }, - }); - return res; -}; - -const UserDashboard = async () => { - const session = await getServerSession(); - - if (!session) { - redirect("/login"); - } - - const [ingredients, categories, recipes] = await Promise.all([ - getIngredients(), - getCategories(), - getRecipes(), - ]); - return ( -
-
- {/* */} -
- {/* */} -
-
-
PantryPilot
-
You have 0 ingredients
-
-
- - -
-
- {/* */} -
- {/* IngredientCard */} - {categories.map((e, i) => ( - - ingredient.name.toString() - )} - maxIngCount={e.ingredients.length} - imgPath={e.img ?? ""} - > - ))} -
-
- {/* */} -
- {/* */} -
-
-
- You can make 420 Recipes -
-
- - -
-
-
- - -
-
- {/* */} -
- {/* Recipe Card */} - {recipes.map((e, i) => ( - - ))} -
-
- {/* */} - -
-
- ); -}; - -export default UserDashboard; diff --git a/src/app/favicon.ico b/src/app/favicon.ico deleted file mode 100644 index 718d6fe..0000000 Binary files a/src/app/favicon.ico and /dev/null differ diff --git a/src/app/globals.css b/src/app/globals.css deleted file mode 100644 index ea734f5..0000000 --- a/src/app/globals.css +++ /dev/null @@ -1,17 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -:root { - --foreground-rgb: 0, 0, 0; - --background-start-rgb: 214, 219, 220; - --background-end-rgb: 255, 255, 255; -} - -@media (prefers-color-scheme: dark) { - :root { - --foreground-rgb: 255, 255, 255; - --background-start-rgb: 0, 0, 0; - --background-end-rgb: 0, 0, 0; - } -} diff --git a/src/app/layout.tsx b/src/app/layout.tsx deleted file mode 100644 index febeade..0000000 --- a/src/app/layout.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import "./globals.css"; -import { Inter } from "next/font/google"; -import { NextAuthProvider } from "./providers"; - -const inter = Inter({ subsets: ["latin"] }); - -export const metadata = { - title: "Pantry Pilot", - description: "Web kelompok 5", -}; - -export default function RootLayout({ - children, -}: { - children: React.ReactNode; -}) { - return ( - - - {children} - - - ); -} diff --git a/src/app/page.tsx b/src/app/page.tsx deleted file mode 100644 index ea1e809..0000000 --- a/src/app/page.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import Header from "@/components/Header"; -import Main from "@/components/Main"; -import Footer from "@/components/Footer"; - -const Home = () => { - return ( - <> -
-
-
-
-
- - ); -}; - -export default Home; diff --git a/src/app/providers.tsx b/src/app/providers.tsx deleted file mode 100644 index dca15b1..0000000 --- a/src/app/providers.tsx +++ /dev/null @@ -1,11 +0,0 @@ -"use client"; - -import { SessionProvider } from "next-auth/react"; - -type Props = { - children?: React.ReactNode; -}; - -export const NextAuthProvider = ({ children }: Props) => { - return {children}; -}; diff --git a/src/app/test/page.tsx b/src/app/test/page.tsx deleted file mode 100644 index afdcd14..0000000 --- a/src/app/test/page.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { - LoginButton, - RegisterButton, - LogoutButton, - ProfileButton, -} from "@/components/Buttons"; -import { getServerSession } from "next-auth"; -import { authOptions } from "@/lib/auth"; - -export default async function Home() { - const session = await getServerSession(authOptions); - console.log(session); - - return ( -
-
- - - - - -

Server Session

-
{JSON.stringify(session)}
-
-
- ); -} diff --git a/src/components/AboutUs.tsx b/src/components/AboutUs.tsx deleted file mode 100644 index 446d3d2..0000000 --- a/src/components/AboutUs.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import Image from "next/image"; -import Link from "next/link"; -import team from "../../public/img/team.png"; -import React, { FC } from "react"; - -interface AboutUsProps {} - -const AboutUs: FC = ({}) => { - return ( - <> -
-
-
-

Who are we?

-
-
- team picture -
-
-

- Here at Pantry Pilot, we believe that cooking delicious, healthy - meals at home should be easy and stress-free. -

-

- That's why we've created a platform that helps you make - the most of the ingredients you have in your pantry, fridge, and - freezer. With our innovative recipe generator, you can quickly and - easily find recipes that match your dietary preferences and - available ingredients. -

-

- Our mission is to make home cooking more accessible and enjoyable - for everyone, regardless of their cooking skills or experience. -

- - - -
-
-
- - ); -}; - -export default AboutUs; diff --git a/src/components/Buttons.tsx b/src/components/Buttons.tsx deleted file mode 100644 index 3bbf8d6..0000000 --- a/src/components/Buttons.tsx +++ /dev/null @@ -1,35 +0,0 @@ -"use client"; - -import { signIn, signOut } from "next-auth/react"; -import Link from "next/link"; - -export const LoginButton = () => { - return ( - - ); -}; - -export const RegisterButton = () => { - return ( - - Register - - ); -}; - -export const LogoutButton = () => { - return ( - - ); -}; - -export const ProfileButton = () => { - return Profile; -}; diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx deleted file mode 100644 index 0c2573f..0000000 --- a/src/components/Footer.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React, { FC } from "react"; - -interface FooterProps {} - -const Footer: FC = ({}) => { - return ( - <> -
-
- - © 2023 Pantry Pilot. All rights reserved. - -
-
- - ); -}; - -export default Footer; diff --git a/src/components/Header.tsx b/src/components/Header.tsx deleted file mode 100644 index 7b712bf..0000000 --- a/src/components/Header.tsx +++ /dev/null @@ -1,111 +0,0 @@ -"use client"; -import { signIn } from "next-auth/react"; -import Link from "next/link"; -import Image from "next/image"; -import logo from "../../public/img/logo.svg"; -import React, { useState } from "react"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faBurger } from "@fortawesome/free-solid-svg-icons"; -import "@fortawesome/fontawesome-svg-core/styles.css"; -import "../../fontawesome"; - -interface Props {} - -const Header: React.FC = ({}) => { - const [isNavHidden, setIsNavHidden] = useState(true); - - const toggleNav = () => { - setIsNavHidden((prevState) => !prevState); - }; - - const hideNav = () => { - setIsNavHidden(true); - }; - - return ( -
-
- {/* Logo */} -
- - Pantry pilot logo - -
- {/* Nav */} -
- {/* Hamburger Menu */} - - {/* Mobile Menu */} -
-
- -
-
- {/* Desktop Menu */} -
    -
  • - About Us -
  • -
  • - Contact -
  • -
  • - - - -
  • -
-
-
-
- ); -}; - -export default Header; diff --git a/src/components/Hero.tsx b/src/components/Hero.tsx deleted file mode 100644 index 94637d8..0000000 --- a/src/components/Hero.tsx +++ /dev/null @@ -1,171 +0,0 @@ -"use client"; -import Link from "next/link"; -import React, { useState, FC } from "react"; -import burger from "../../public/img/heroImg/burger.jpg"; -import Image from "next/image"; -import IngredientBox from "./IngredientBox"; -import HeroButton from "./HeroButton"; -import IngredientCard from "./IngredientCard"; -import ingData from "../data/IngredientData.json"; - -const Hero: React.FC = ({}) => { - const ingredientImgPath = [ - "/img/heroImg/bun.png", - "/img/heroImg/beef.png", - "/img/heroImg/lettuce.png", - "/img/heroImg/tomato.png", - "/img/heroImg/onion.png", - "/img/heroImg/cheese.png", - "/img/heroImg/egg.png", - "/img/heroImg/olive_oil.png", - "/img/heroImg/ketchup.png", - ]; - - const buttons = [ - { - id: "kitchen", - title: "Kitchen", - subtitle: "Any ingredients you have in your kitchen", - }, - { - id: "pantry", - title: "Pantry", - subtitle: "Input them into our pantry", - }, - { - id: "recipe", - title: "Recipe", - subtitle: "And we'll show you the recipes you can make!", - }, - ]; - - const [activeStyle, setActiveStyle] = useState("kitchen"); - - const handleToggleActive = (style: string) => { - setActiveStyle(style); - }; - - const fewIngData = ingData.ingredients.slice(0, 4); - - return ( -
- {/* Hero Left */} -
- {/* Heading */} -

- Navigate your
- Pantry -
- like a
- pro. -

- {/* Subheading */} -

- Input any ingredients you have in your kitchen and we'll show you - recipes you can make! -

- {/* Call to Action */} -
- - - -
-
- - {/* Hero Middle */} -
- {/* Hero style 1 */} - {activeStyle === "kitchen" && ( -
- {ingredientImgPath.map((path, index) => ( - - ))} -
- )} - {/* Hero style 2 */} - {activeStyle === "pantry" && ( -
- {/* Ingredient card */} - {fewIngData.map((e, i) => ( - - ))} -
- )} - {/* Hero style 3 */} - {activeStyle === "recipe" && ( -
-
- classic burger -

Classic Burger

- -

Ingredients:

-
    -
  • 1 lb ground beef
  • -
  • 1 tsp salt
  • -
  • 1/2 tsp black pepper
  • -
  • 4 slices cheese
  • -
  • 4 hamburger buns
  • -
  • - Lettuce, tomato, onion, ketchup, mustard, and mayo for serving -
  • -
- -

Instructions:

-
    -
  1. Preheat grill to high.
  2. -
  3. - In a large bowl, combine ground beef, salt, and black pepper. - Mix well and form into four patties. -
  4. -
  5. - Grill patties for 3-4 minutes per side, or until fully cooked. - During the last minute of cooking, add a slice of cheese to - each patty. -
  6. -
  7. - To assemble, place lettuce, tomato, and onion on the bottom - half of each bun. Top with a cooked patty and your desired - condiments. Serve immediately. -
  8. -
-
-
- )} -
- - {/* Hero Right */} -
- {buttons.map((button, index) => ( - handleToggleActive(`${button.id}`)} - > - ))} -
-
- ); -}; - -export default Hero; diff --git a/src/components/HeroButton.tsx b/src/components/HeroButton.tsx deleted file mode 100644 index e6d43b8..0000000 --- a/src/components/HeroButton.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import React from "react"; - -interface HeroButtonProps { - active: boolean; - onClick: () => void; - title: string; - subtitle: string; -} - -const HeroButton: React.FC = ({ - active, - onClick, - title, - subtitle, -}) => { - return ( - - ); -}; - -export default HeroButton; diff --git a/src/components/Ingredient.tsx b/src/components/Ingredient.tsx deleted file mode 100644 index 952325a..0000000 --- a/src/components/Ingredient.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import React, { FC } from "react"; - -interface IngredientProps { - name: string; -} - -const Ingredient: FC = ({ name }) => { - return ( - <> -
- {name} -
- - ); -}; - -export default Ingredient; diff --git a/src/components/IngredientBox.tsx b/src/components/IngredientBox.tsx deleted file mode 100644 index cfb2f2b..0000000 --- a/src/components/IngredientBox.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import React, { FC } from "react"; -import Image from "next/image"; - -interface IngredientBoxProps { - src: string; - alt: string; -} - -const IngredientBox: FC = ({ src, alt }) => { - return ( - <> -
- {alt} -
- - ); -}; - -export default IngredientBox; diff --git a/src/components/IngredientCard.tsx b/src/components/IngredientCard.tsx deleted file mode 100644 index a0a7fd0..0000000 --- a/src/components/IngredientCard.tsx +++ /dev/null @@ -1,78 +0,0 @@ -"use client"; -import React, { FC, useState } from "react"; -import Image from "next/image"; -import Ingredient from "./Ingredient"; - -interface IngredientCardProps { - title: string; - ingCount: number; - ingredients: Array; - maxIngCount: number; - imgPath: string; -} - -const IngredientCard: FC = ({ - title, - ingCount, - ingredients, - maxIngCount, - imgPath, -}) => { - const [showMore, setShowMore] = useState(false); - - const toggleShowMore = () => { - setShowMore(!showMore); - }; - - return ( - <> - {/* Card */} -
- {/* Card Top */} -
- {/* Card logo */} -
- {`${title} -
- {/* Card title and ingredient */} -
-
{title}
-
- {ingCount}/{maxIngCount} Ingredients -
-
-
- {/* Card bottom */} -
- {/* Ingredients */} - {!showMore && - ingredients - .slice(0, 10) - .map((ingredient, index) => ( - - ))} - {showMore && - ingredients.map((ingredient, index) => ( - - ))} - {/* Show More button */} - {ingredients.length > 10 && ( -
- -
- )} -
-
- - ); -}; - -export default IngredientCard; diff --git a/src/components/Main.tsx b/src/components/Main.tsx deleted file mode 100644 index cf165d0..0000000 --- a/src/components/Main.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import React, { useState } from "react"; -import Hero from "./Hero"; -import Products from "./ProductsServices"; -import AboutUs from "./AboutUs"; -import Testimonials from "./Testimonials"; - -interface Props {} - -const Main: React.FC = ({}) => { - return ( - <> -
- {/* Hero */} - - {/* Products & Services */} - - {/* Who are we? */} - - {/* What our customers say */} - -
- - ); -}; - -export default Main; diff --git a/src/components/ProductsServices.tsx b/src/components/ProductsServices.tsx deleted file mode 100644 index b20eb92..0000000 --- a/src/components/ProductsServices.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import React, { FC } from "react"; -import Image from "next/image"; - -interface ProductsServicesProps {} - -const ProductsServices: FC = ({}) => { - const products = [ - { - path: "/img/productImg/rendang.png", - title: "Local Recipes", - content: - "Experience the unique and delicious flavors of your with our collection of local recipes! Discover easy-to-follow recipes that will make mealtime a memorable experience for you and your loved ones.", - }, - { - path: "/img/productImg/spaghetti.png", - title: "International Recipes", - content: - "Explore the world through your taste buds with our collection of international recipes! From classNameic French cuisine to spicy Indian curries, discover new and exciting flavors that will take your taste buds on a culinary journey.", - }, - { - path: "/img/productImg/foodbox.png", - title: "Food Order", - content: - "Try out new flavors from your favorite restaurants before cooking! Order from nearby restaurants and get delicious meals delivered straight to your door. Explore new cuisines with ease.", - }, - ]; - - return ( - <> -
-
-

What we offer

-
-
-
- {products.map((product, index) => ( -
-
- {`Image -
-
-

- {product.title} -

-

- {product.content} -

-
-
- ))} -
-
-
- - ); -}; - -export default ProductsServices; diff --git a/src/components/RecipeCard.tsx b/src/components/RecipeCard.tsx deleted file mode 100644 index 2b2838a..0000000 --- a/src/components/RecipeCard.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import Image from "next/image"; -import React, { FC } from "react"; - -interface RecipeCardProps { - name: string; - ingCount: number; - imgPath: string; -} - -const RecipeCard: FC = ({ name, ingCount, imgPath }) => { - return ( - <> - {/* Recipe Card */} -
- {/* Card Image */} -
- {`${name} -
- {/* Recipe Details */} -
-
{name}
-
- You have all {ingCount} Ingredients -
-
-
- - ); -}; - -export default RecipeCard; diff --git a/src/components/TestimonialCard.tsx b/src/components/TestimonialCard.tsx deleted file mode 100644 index b2f9ddb..0000000 --- a/src/components/TestimonialCard.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import Image from "next/image"; -import React, { FC } from "react"; - -interface TestimonialCardProps { - content: string; - name: string; - location: string; - isWoman: boolean; - id: number; -} - -const TestimonialCard: FC = ({ - content, - name, - location, - isWoman, - id, -}) => { - return ( - <> -
-
-
-

"{content}"

-
-
- testimonial author -
-
-

{name}

-

{location}

-
-
-
-
-
- - ); -}; - -export default TestimonialCard; - -// "I have tried many recipe websites but none of them are as -// easy to use and accurate as Pantry Pilot. I'm always able to -// find a great recipe based on what I have in my fridge." diff --git a/src/components/Testimonials.tsx b/src/components/Testimonials.tsx deleted file mode 100644 index 10c984b..0000000 --- a/src/components/Testimonials.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import React, { FC } from "react"; -import TestimonialCard from "./TestimonialCard"; - -interface TestimonialsProps {} - -const Testimonials: FC = ({}) => { - const reviews = [ - { - name: "Jane Doe", - isWoman: true, - location: "Los Angeles, CA", - content: - "I have tried many recipe websites but none of them are as easy to use and accurate as Pantry Pilot. I'm always able to find a great recipe based on what I have in my fridge.", - }, - { - name: "Mike", - isWoman: false, - location: "Houston, TX", - content: - "As someone who's not the most confident cook, I love how easy these recipes are to follow. They've helped me step up my cooking game and impress my friends and family!", - }, - { - name: "Sofia", - isWoman: true, - location: "New York City, NY", - content: - "I've tried a ton of different recipe websites, but this one is by far the best. The recipes are delicious and unique, and the fact that I can order food directly from the site is great!", - }, - { - name: "Rachel", - isWoman: true, - location: "Chicago, IL", - content: - "This tool has saved me so much time and money on meal planning. I no longer have to guess what to make for dinner or run to the grocery store for a single ingredient.", - }, - { - name: "Jessica", - isWoman: true, - location: "Miami, FL", - content: - "This website is a lifesaver! I'm always looking for new recipes, and the fact that I can customize them based on what's in my pantry is amazing. Highly recommend!", - }, - ]; - - return ( - <> -
-

- What our customers say -

-
- {reviews.map((review, index) => ( - - ))} -
-
- - ); -}; - -export default Testimonials; diff --git a/src/data/IngredientData.json b/src/data/IngredientData.json deleted file mode 100644 index c0cc16e..0000000 --- a/src/data/IngredientData.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "ingredients": [ - { - "title": "Pantry Essentials", - "ingCount": 1, - "ingredients": [ - "butter", "egg", "garlic", "milk", "onion", "sugar", "flour", "olive oil", "garlic powder", "rice", "salt", "pepper", "baking powder", "baking soda", "vanilla extract", "soy sauce", "canned tomatoes", "honey", "maple syrup", "pasta", "bread crumbs" - ], - "maxIngCount": 40, - "imgPath": "/img/ingCategoryIcon/pantryEssentials.png" - }, - { - "title": "Vegetables & Greens", - "ingCount": 2, - "ingredients": [ - "garlic", "onion", "bell pepper", "carrot", "scallion", "tomato", "potato", "red onion", "celery", "jalapeno", "spinach", "broccoli", "cabbage", "zucchini", "mushrooms", "asparagus", "corn", "green beans", "lettuce", "radish" - ], - "maxIngCount": 100, - "imgPath": "/img/ingCategoryIcon/vegetablesGreens.png" - }, - { - "title": "Meats", - "ingCount": 3, - "ingredients": [ - "bacon", "ground beef", "beef steak", "ham", "pork loin", "sausage", "prosciutto", "beef roast", "ground pork", "Italian sausage", "chicken", "turkey", "lamb", "veal", "duck", "veal", "liver", "pepperoni", "chorizo", "salami" - ], - "maxIngCount": 100, - "imgPath": "/img/ingCategoryIcon/meats.png" - }, - { - "title": "Fruits", - "ingCount": 4, - "ingredients": [ - "lemon", "lime", "apple", "orange", "banana", "raisins", "pineapple", "mango", "peach", "date", "strawberries", "blueberries", "raspberries", "blackberries", "kiwi", "watermelon", "grapes", "melon", "pear", "plum" - ], - "maxIngCount": 100, - "imgPath": "/img/ingCategoryIcon/fruits.png" - }, - { - "title": "Poultry", - "ingCount": 5, - "ingredients": [ - "chicken breast", "chicken thighs", "cooked chicken", "ground turkey", "whole chicken", "whole turkey", "chicken leg", "chicken wings", "turkey breast", "ground chicken", "duck breast", "quail", "goose", "turkey legs", "turkey wings", "guinea fowl", "cornish hen" - ], - "maxIngCount": 82, - "imgPath": "/img/ingCategoryIcon/poultry.png" - }, - { - "title": "Fish", - "ingCount": 6, - "ingredients": [ - "salmon", "smoked salmon", "cod", "tilapia", "tuna steak", "halibut", "whitefish", "sea bass", "red snapper", "trout", "anchovies", "sardines", "mackerel", "shrimp", "lobster", "crab", "clams", "mussels", "oysters", "squid" - ], - "maxIngCount": 100, - "imgPath": "/img/ingCategoryIcon/fish.png" - } - ] -} diff --git a/src/data/RecipeData.json b/src/data/RecipeData.json deleted file mode 100644 index f6ebf8a..0000000 --- a/src/data/RecipeData.json +++ /dev/null @@ -1,225 +0,0 @@ -{ - "recipe": [ - { - "name": "Grilled Salmon with Lime Butter Sauce", - "ingCount": 3, - "imgPath": "" - }, - { - "name": "Pasta Carbonara", - "ingCount": 5, - "imgPath": "" - }, - { - "name": "Chicken Parmesan", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Vegetable Stir-Fry", - "ingCount": 6, - "imgPath": "" - }, - { - "name": "Beef Tacos", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Caprese Salad", - "ingCount": 3, - "imgPath": "" - }, - { - "name": "Garlic Shrimp Scampi", - "ingCount": 5, - "imgPath": "" - }, - { - "name": "Mushroom Risotto", - "ingCount": 6, - "imgPath": "" - }, - { - "name": "Greek Salad", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Teriyaki Chicken", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Roasted Vegetables", - "ingCount": 5, - "imgPath": "" - }, - { - "name": "Spaghetti Bolognese", - "ingCount": 6, - "imgPath": "" - }, - { - "name": "Honey Glazed Salmon", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Quinoa Salad", - "ingCount": 5, - "imgPath": "" - }, - { - "name": "Stuffed Bell Peppers", - "ingCount": 6, - "imgPath": "" - }, - { - "name": "Chicken Caesar Salad", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Beef Stir-Fry", - "ingCount": 5, - "imgPath": "" - }, - { - "name": "Pesto Pasta", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Lemon Herb Chicken", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Eggplant Parmesan", - "ingCount": 5, - "imgPath": "" - }, - { - "name": "Caesar Salad", - "ingCount": 3, - "imgPath": "" - }, - { - "name": "Shrimp Fried Rice", - "ingCount": 6, - "imgPath": "" - }, - { - "name": "Mango Salsa Chicken", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Roasted Garlic Potatoes", - "ingCount": 5, - "imgPath": "" - }, - { - "name": "Sausage and Peppers", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Lemon Butter Chicken", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Pineapple Fried Rice", - "ingCount": 5, - "imgPath": "" - }, - { - "name": "Beef Burritos", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Spinach and Feta Stuffed Chicken", - "ingCount": 6, - "imgPath": "" - }, - { - "name": "Tomato Mozzarella Salad", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Sticky Sesame Chicken", - "ingCount": 5, - "imgPath": "" - }, - { - "name": "Mushroom and Spinach Omelette", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Honey Mustard Salmon", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Caprese Stuffed Avocado", - "ingCount": 5, - "imgPath": "" - }, - { - "name": "Vegetable Lasagna", - "ingCount": 6, - "imgPath": "" - }, - { - "name": "Chicken Noodle Soup", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Avocado Toast", - "ingCount": 3, - "imgPath": "" - }, - { - "name": "Garlic Butter Shrimp Pasta", - "ingCount": 5, - "imgPath": "" - }, - { - "name": "Stuffed Mushrooms", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Teriyaki Salmon", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Cauliflower Fried Rice", - "ingCount": 5, - "imgPath": "" - }, - { - "name": "Pesto Chicken", - "ingCount": 4, - "imgPath": "" - }, - { - "name": "Broccoli Cheddar Soup", - "ingCount": 5, - "imgPath": "" - }, - { - "name": "Honey Soy Chicken", - "ingCount": 4, - "imgPath": "" - } - ] -} - diff --git a/src/lib/auth.ts b/src/lib/auth.ts deleted file mode 100644 index 0990c44..0000000 --- a/src/lib/auth.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { prisma } from "@/lib/prisma"; -import { compare } from "bcrypt"; -import type { NextAuthOptions, User } from "next-auth"; -import CredentialsProvider from "next-auth/providers/credentials"; - -export const authOptions: NextAuthOptions = { - session: { - strategy: "jwt", - }, - providers: [ - CredentialsProvider({ - name: "Sign in", - credentials: { - email: { - label: "Email", - type: "email", - placeholder: "example@example.com", - }, - password: { label: "Password", type: "password" }, - - }, - async authorize(credentials, req) { - if (!credentials?.email || !credentials.password) { - return null; - } - - const user = await prisma.user.findUnique({ - where: { - email: credentials.email, - }, - }); - - if (!user || !(await compare(credentials.password, user.password))) { - return null; - } - - return { - id: user.id, - email: user.email, - name: user.name, - isAdmin: user.isAdmin - } as unknown as User; // Cast the return value to the User type - } - }), - ], - callbacks: { - session: ({ session, token }) => { - return { - ...session, - user: { - ...session.user, - id: token.id, - isAdmin: token.isAdmin - }, - }; - }, - jwt: ({ token, user }) => { - if (user) { - const u = user as unknown as any; - return { - ...token, - id: u.id, - isAdmin: u.isAdmin, - }; - } - return token; - }, - }, - pages: { - signIn: "/login", - } -}; diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts deleted file mode 100644 index 8919c42..0000000 --- a/src/lib/prisma.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { PrismaClient } from "@prisma/client"; - -const globalForPrisma = global as unknown as { prisma: PrismaClient }; - -export const prisma = - globalForPrisma.prisma || - new PrismaClient({ - log: ["query"], - }); - -if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma; diff --git a/src/types/interfaces.ts b/src/types/interfaces.ts deleted file mode 100644 index 38507ea..0000000 --- a/src/types/interfaces.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface User { - name?: string | null | undefined; - isAdmin: boolean; -} \ No newline at end of file diff --git a/src/types/next-auth.d.ts b/src/types/next-auth.d.ts deleted file mode 100644 index de220fa..0000000 --- a/src/types/next-auth.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { User } from "./interfaces" - -declare module "next-auth" { - interface Session { - user: User - } -}