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

Pwa testing #70

Merged
merged 411 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
411 commits
Select commit Hold shift + click to select a range
ce07274
cache
kutlwano10 Oct 31, 2024
6e78658
updated my local deployment
kutlwano10 Oct 31, 2024
ee250ef
"Added compound text index to RecipeSchema for title, description, an…
SABELOMAWELA Oct 31, 2024
cfb2d3c
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
SABELOMAWELA Oct 31, 2024
06c8103
.
KitsoMogale Nov 1, 2024
550a233
Update RecipeCard component: changed function signature, added two us…
Mmakgosana Nov 1, 2024
a2824a2
Added mouse enter event handler to RecipeCard component to cycle thro…
Mmakgosana Nov 1, 2024
fa938e9
Added handleMouseLeave function and event handler to RecipeCard compo…
Mmakgosana Nov 1, 2024
d461e04
Added onMouseEnter and onMouseLeave event handlers to RecipeCard comp…
Mmakgosana Nov 1, 2024
ffe6a7e
Refactored RecipeCard component: removed unnecessary whitespace, refo…
Mmakgosana Nov 1, 2024
efaa935
display count of filtered recipes
KitsoMogale Nov 1, 2024
885a096
Merge branches 'deployment' and 'deployment' of https://github.com/Ch…
Mmakgosana Nov 1, 2024
96d2ee7
idk
KitsoMogale Nov 1, 2024
aeb5f61
testing db connection
KitsoMogale Nov 1, 2024
209e864
Merge branch 'Filter-Sort' of https://github.com/Cheplusplus/ASE_2024…
KitsoMogale Nov 1, 2024
4065fd4
pulled Filter-Sort
KitsoMogale Nov 1, 2024
0a49bde
updated url
KitsoMogale Nov 1, 2024
652bced
brought back categories
KitsoMogale Nov 1, 2024
fa9eaf2
categories are fetchable
KitsoMogale Nov 1, 2024
d25eba3
about
KitsoMogale Nov 1, 2024
35970fb
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KitsoMogale Nov 3, 2024
302f5c0
close button red
KitsoMogale Nov 3, 2024
461143a
clear all filters
KitsoMogale Nov 3, 2024
6f238bb
force-dynamic
KitsoMogale Nov 4, 2024
5daee73
fixing categories fetching
KitsoMogale Nov 4, 2024
702574c
console.log res from categories api
KitsoMogale Nov 4, 2024
ae210de
res.statusText
KitsoMogale Nov 4, 2024
225e698
content-type
KitsoMogale Nov 4, 2024
b647f34
categories
KitsoMogale Nov 4, 2024
7b266df
console.log(recipes)
KitsoMogale Nov 4, 2024
d4887eb
.
KitsoMogale Nov 4, 2024
c0e1567
idk
KitsoMogale Nov 4, 2024
e1fb186
testing
KitsoMogale Nov 4, 2024
8fa6ad8
import Image
KitsoMogale Nov 4, 2024
0166642
.
KitsoMogale Nov 4, 2024
db28bc1
req.query
KitsoMogale Nov 4, 2024
6050652
testing
KitsoMogale Nov 4, 2024
9c51a38
testing
KitsoMogale Nov 4, 2024
a578c3b
idk
KitsoMogale Nov 4, 2024
e1c1676
idk
KitsoMogale Nov 4, 2024
60a437d
force-dynamic
KitsoMogale Nov 4, 2024
d03f736
canceled recipeData
KitsoMogale Nov 4, 2024
a716648
.
KitsoMogale Nov 4, 2024
b473a56
yes
KitsoMogale Nov 4, 2024
dddad7d
.
KitsoMogale Nov 4, 2024
589f592
idk
KitsoMogale Nov 4, 2024
4358f4e
idk
KitsoMogale Nov 4, 2024
1cd884d
i still dk
KitsoMogale Nov 4, 2024
ac19df3
.
KitsoMogale Nov 4, 2024
b90ff08
./
KitsoMogale Nov 4, 2024
9be664b
.idk
KitsoMogale Nov 4, 2024
ac3111c
lets go
KitsoMogale Nov 4, 2024
f3a62cb
idk
KitsoMogale Nov 4, 2024
0edbb24
.
KitsoMogale Nov 4, 2024
ddb848b
idk
KitsoMogale Nov 4, 2024
333af75
.
KitsoMogale Nov 4, 2024
3bcc146
idk
KitsoMogale Nov 4, 2024
2ba05d7
idk
KitsoMogale Nov 4, 2024
6dad538
slide 123
KitsoMogale Nov 4, 2024
1706064
back to square one in api/recipe and api/categories
KitsoMogale Nov 4, 2024
2ad8efe
.
KitsoMogale Nov 4, 2024
953ec6b
idk
KitsoMogale Nov 4, 2024
a813800
testing
KitsoMogale Nov 5, 2024
c59bb15
fetched straight from recipeGrid
KitsoMogale Nov 5, 2024
8baf521
fixed response.ok
KitsoMogale Nov 5, 2024
c2d4586
response.ok
KitsoMogale Nov 5, 2024
e8ca1f1
res.ok
KitsoMogale Nov 5, 2024
c8de55d
headers
KitsoMogale Nov 5, 2024
69278e6
.
KitsoMogale Nov 5, 2024
3a5291e
.
KitsoMogale Nov 5, 2024
9fc6dda
.
KitsoMogale Nov 5, 2024
da153bc
.
KitsoMogale Nov 5, 2024
9d9f763
.
KitsoMogale Nov 5, 2024
df4f093
.
KitsoMogale Nov 5, 2024
5e713b1
.
KitsoMogale Nov 5, 2024
26290aa
.
KitsoMogale Nov 5, 2024
a76e7a7
.
KitsoMogale Nov 5, 2024
bc045fb
.
KitsoMogale Nov 5, 2024
aad907b
.
KitsoMogale Nov 5, 2024
62fc18f
Added logout functionality to Navbar component
Phillip-tech Nov 5, 2024
531db88
Created sign in page
Phillip-tech Nov 5, 2024
c1e03ca
Added sign-in page with imports and function declarations
Phillip-tech Nov 5, 2024
bcbf32d
Added SignIn function and state variables to sign-in page
Phillip-tech Nov 5, 2024
4888f3e
Added handleSubmit function to SignIn component
Phillip-tech Nov 5, 2024
ae01516
Added handleGoogleSignIn function to SignIn component
Phillip-tech Nov 5, 2024
4cc8152
Added sign in page layout and header
Phillip-tech Nov 5, 2024
529ef07
Added email input field to sign-in page
Phillip-tech Nov 5, 2024
c2aa5ec
Added password input field and submit button to sign-in page
Phillip-tech Nov 5, 2024
182600f
Added Google sign-in button to sign-in page
Phillip-tech Nov 5, 2024
640210d
Created sign-up page
Phillip-tech Nov 5, 2024
8918e8e
Added sign-up page with imports and function declarations
Phillip-tech Nov 5, 2024
71a0526
Added SignUp function and state variables to sign-up page
Phillip-tech Nov 5, 2024
9728a25
Added handleSubmit function to SignUp component
Phillip-tech Nov 5, 2024
6bfbd76
ok
KitsoMogale Nov 5, 2024
68d2271
Added handleGoogleSignUp function to SignUp component
Phillip-tech Nov 5, 2024
17521c9
Added sign up page layout and header
Phillip-tech Nov 5, 2024
9bb77e5
Added email input field to sign-up page
Phillip-tech Nov 5, 2024
f3912f9
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KitsoMogale Nov 5, 2024
e573a7a
Added password input field to sign-up page
Phillip-tech Nov 5, 2024
0990053
Added error message display and submit button to sign-up page
Phillip-tech Nov 5, 2024
a0eb707
Created Google sign-up button to sign-up page
Phillip-tech Nov 5, 2024
9e9575b
it now works
KitsoMogale Nov 5, 2024
745644e
installed next-auth dependencies
Karabo-M-Radebe Nov 5, 2024
e0356de
created a route file for the Google and Email login using the next-au…
Karabo-M-Radebe Nov 5, 2024
00b00c4
Merge branch 'Authentication' of https://github.com/Cheplusplus/ASE_2…
Karabo-M-Radebe Nov 5, 2024
c6e401c
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
Karabo-M-Radebe Nov 5, 2024
261a7f1
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
kutlwano10 Nov 5, 2024
2398087
merged Authentication
kutlwano10 Nov 5, 2024
d89e15c
created a session provider component
Karabo-M-Radebe Nov 5, 2024
79480e7
commented out the sign-in and sign-out pages
Karabo-M-Radebe Nov 5, 2024
65c2235
wrapped the body in the session provider to make it global component
Karabo-M-Radebe Nov 5, 2024
e277d8f
refactored code to ensure links have the correct routes and the butto…
Karabo-M-Radebe Nov 5, 2024
a81679f
Merge branch 'Authentication' of https://github.com/Cheplusplus/ASE_2…
kutlwano10 Nov 6, 2024
d60af9e
Created google keys and Fixed the google LogIn Bug
kutlwano10 Nov 6, 2024
7328eac
Made the UserSession to be available when the user is online and disp…
kutlwano10 Nov 6, 2024
cf9ea63
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
kutlwano10 Nov 7, 2024
1f385b0
Merge branch 'auth-googleKeys' of https://github.com/Cheplusplus/ASE_…
kutlwano10 Nov 7, 2024
9d39b20
import SkeletonGrid canceled
KitsoMogale Nov 7, 2024
9b25f10
Merge branch 'Authentication' of https://github.com/Cheplusplus/ASE_2…
KitsoMogale Nov 7, 2024
2a3b748
.
KitsoMogale Nov 7, 2024
e86777a
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KitsoMogale Nov 7, 2024
816714a
added emailProvider route
kutlwano10 Nov 7, 2024
da04ddf
Created a user Schema
kutlwano10 Nov 8, 2024
5f0e149
edit description button
KitsoMogale Nov 8, 2024
8ff7008
cant sign in
kutlwano10 Nov 8, 2024
8455702
text area
KitsoMogale Nov 8, 2024
e963160
Profile Page with Editable Fields
Nov 10, 2024
27ab1f1
Implement theme toggling and filter/sort component
KoketsoMoilwe20 Nov 11, 2024
fc91751
Implement theme toggle functionality in Navbar component
KoketsoMoilwe20 Nov 11, 2024
cae2c9c
Update RecipeCard styling for theme intergration
KoketsoMoilwe20 Nov 11, 2024
dd659d1
Add theme management with ThemeProvider and ThemeToggle component
KoketsoMoilwe20 Nov 11, 2024
2476f4c
Define custom CSS variables for light and dark themes in global.css
KoketsoMoilwe20 Nov 11, 2024
a72e007
Integrate ThemeProvider and adjust layout for light/dark theme support
KoketsoMoilwe20 Nov 11, 2024
c532031
Enhance homepage with gradient backgrounds and decorative elements
KoketsoMoilwe20 Nov 11, 2024
0fd40ca
editing description textarea and endpoint
KitsoMogale Nov 12, 2024
0809b1b
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KitsoMogale Nov 12, 2024
7076315
completed #130, #140 and #157
Nov 12, 2024
19aefe8
signup/signin with email/password
KitsoMogale Nov 12, 2024
83b67f6
done with mail
kutlwano10 Nov 13, 2024
a6a59fe
added profile route
KitsoMogale Nov 13, 2024
0c945d8
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
kutlwano10 Nov 13, 2024
dccb70c
Updated RecipeDetailCard component with new features and styling changes
Kea-Angel-Ntheledi Nov 13, 2024
f199509
Update tailwind.config.js
KoketsoMoilwe20 Nov 14, 2024
e6334df
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KoketsoMoilwe20 Nov 14, 2024
c52030b
Update dependencies
KoketsoMoilwe20 Nov 14, 2024
61f70d0
Added useEffect hook to update document title, reformatted code with …
Phillip-tech Nov 14, 2024
05b7f9b
Added a wallpaper
kutlwano10 Nov 14, 2024
848a6fa
Update Dark Mode theme
KoketsoMoilwe20 Nov 14, 2024
0f793d1
Merge remote-tracking branch 'origin' into emailProvider
kutlwano10 Nov 14, 2024
7d0c7dc
Save theme preference to localStorage
KoketsoMoilwe20 Nov 14, 2024
5292fa0
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KoketsoMoilwe20 Nov 14, 2024
218ad70
Aligned the loading state with the layout
kutlwano10 Nov 14, 2024
fffc3b0
update the Home page to support the theme system
KoketsoMoilwe20 Nov 14, 2024
6814e06
aligned the loading with the layout for the wallpaper
kutlwano10 Nov 14, 2024
4354c3a
Refactored SearchBar component: updated useEffect hook, removed unnec…
Phillip-tech Nov 14, 2024
34e8861
Update debounce timeouts in SearchBar component
Phillip-tech Nov 14, 2024
2e09417
Update SearchBar: change auto-submit delay from 500ms to 300ms, add U…
Phillip-tech Nov 14, 2024
bd80936
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
Phillip-tech Nov 14, 2024
6ecc4cd
Changed logo color
kutlwano10 Nov 14, 2024
133523e
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KitsoMogale Nov 14, 2024
ada3367
fixed authentication bugs and updated profile
KitsoMogale Nov 14, 2024
1e00e6f
Added useEffect hook to set document title with recipe title
Phillip-tech Nov 14, 2024
fa96441
rearranged but was not necessary I think
KitsoMogale Nov 14, 2024
a5aa032
change page.js back to server component
KoketsoMoilwe20 Nov 14, 2024
f14c339
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KoketsoMoilwe20 Nov 14, 2024
0baa006
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
kutlwano10 Nov 15, 2024
24f8001
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
kutlwano10 Nov 15, 2024
63c4e46
.
KitsoMogale Nov 15, 2024
51c1af7
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KitsoMogale Nov 15, 2024
42eeb86
pulled deployment, everything still the same
KitsoMogale Nov 15, 2024
476e52b
editing profile works
KitsoMogale Nov 17, 2024
e669380
update session.user.email when updating profile
KitsoMogale Nov 17, 2024
0020a00
cleared console.logs
KitsoMogale Nov 17, 2024
4411cbe
udjusted users schema
KitsoMogale Nov 17, 2024
5288c96
Update user.js
KitsoMogale Nov 17, 2024
8a560d4
Update User.js
KitsoMogale Nov 17, 2024
b079675
updated users schema
KitsoMogale Nov 17, 2024
7544fbb
.
KitsoMogale Nov 17, 2024
f6cd330
block google account updates
KitsoMogale Nov 17, 2024
03e3236
styled profile edit component
KitsoMogale Nov 17, 2024
c2af59c
send user back to previous page after logging in
KitsoMogale Nov 17, 2024
bd6423f
addreview getreviews components and api endpoints
KitsoMogale Nov 17, 2024
bf3a397
reviews api endpoints
KitsoMogale Nov 18, 2024
0174b4e
adds review and rating and fetches them
KitsoMogale Nov 18, 2024
247859f
edit and delete review
KitsoMogale Nov 18, 2024
b825dd2
Fix theme to apply to the entire page
KoketsoMoilwe20 Nov 18, 2024
e75c67c
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KoketsoMoilwe20 Nov 18, 2024
e2a04dc
Created a Route for all recipes
kutlwano10 Nov 18, 2024
3c77f23
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
kutlwano10 Nov 18, 2024
207137a
merged deployment with layout theme
kutlwano10 Nov 18, 2024
ac630c4
Changed the redirect links to router to 'all' recipes when filtering …
kutlwano10 Nov 18, 2024
a08979f
must be loggedin to add review
KitsoMogale Nov 18, 2024
087e6e0
error handling for auth
KitsoMogale Nov 18, 2024
023b693
number of paginated pages
KitsoMogale Nov 18, 2024
06b2ad1
cause reviews to rerender after adding
KitsoMogale Nov 18, 2024
8ba6cb6
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KitsoMogale Nov 18, 2024
3187ff5
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KitsoMogale Nov 18, 2024
97fe4e0
text to speech for instructions
KitsoMogale Nov 18, 2024
d1e2bce
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KitsoMogale Nov 18, 2024
21eb64d
adjust code flow
KitsoMogale Nov 19, 2024
e62bde5
Making recipe detail page much more readable in dark mode
KoketsoMoilwe20 Nov 19, 2024
c26e162
making code more maintainable and consistent
KoketsoMoilwe20 Nov 19, 2024
76dfc50
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KoketsoMoilwe20 Nov 19, 2024
88acba0
Update page.jsx
KoketsoMoilwe20 Nov 19, 2024
8ac259c
Added a button to view all Recipes
kutlwano10 Nov 19, 2024
bc56902
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
kutlwano10 Nov 19, 2024
05958d6
url in lib/api
KitsoMogale Nov 19, 2024
4a0eca4
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KitsoMogale Nov 19, 2024
b981cd3
reccommended recipes
KitsoMogale Nov 19, 2024
2d4b73d
added icons for the signed in user on the navbar and Refactored the N…
kutlwano10 Nov 19, 2024
51f43f1
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
kutlwano10 Nov 19, 2024
a712950
Removed logout code in the navbar that is not working
Phillip-tech Nov 19, 2024
7b1feae
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
Phillip-tech Nov 19, 2024
9f14722
Updated cross-spawn version from 7.0.3 to 7.0.6 in package-lock.json
Phillip-tech Nov 19, 2024
92aaa9f
implemented a method to force user to sign out only if they are signe…
kutlwano10 Nov 19, 2024
356e3ad
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
kutlwano10 Nov 19, 2024
e0d2c42
customized theme for menu
kutlwano10 Nov 19, 2024
6f1c238
added speechRecognition
KitsoMogale Nov 19, 2024
c6baa27
stopVoiceCommands
KitsoMogale Nov 19, 2024
099ce72
pause and resume voice commands work, this is crazy
KitsoMogale Nov 19, 2024
fe1668d
Added next-pwa configuration to next.config.mjs
Phillip-tech Nov 20, 2024
16d6fe1
Removed comment in next.config.mjs
Phillip-tech Nov 20, 2024
7e6fa27
Add initial web app manifest file for Recipe Rush
Phillip-tech Nov 20, 2024
0046454
Added icons array to manifest.json
Phillip-tech Nov 20, 2024
7fb8da6
Added a Logo and Aligned layout icons on the navbar
kutlwano10 Nov 20, 2024
f95bd51
changed wallpaper and optomized the images
kutlwano10 Nov 20, 2024
7e66907
hq level optomized images
kutlwano10 Nov 20, 2024
77720b9
'next step', 'go back' ,'repeat'
KitsoMogale Nov 20, 2024
42333f8
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
KitsoMogale Nov 20, 2024
ebb9dec
Updated manifest.json: changed description, added orientation, and fi…
Phillip-tech Nov 21, 2024
6628279
Added two new icon sizes (72x72 and 96x96) to manifest.json
Phillip-tech Nov 21, 2024
c9306ef
Added new icon sizes to manifest.json
Phillip-tech Nov 21, 2024
7dd9fc4
Added new icon size 384x384 to manifest.json and removed trailing whi…
Phillip-tech Nov 21, 2024
27e6c99
Added image of the user on Profile page
kutlwano10 Nov 21, 2024
c864c7e
Installed next-pwa
Phillip-tech Nov 21, 2024
66fc693
Updated layout.js to include manifest.json
Phillip-tech Nov 21, 2024
c9ff213
Removed Recipe Rush - Logo.png
Phillip-tech Nov 21, 2024
4782c8d
Added next-pwa to package.json
Phillip-tech Nov 21, 2024
79baee5
Refactored next.config.mjs
Phillip-tech Nov 21, 2024
13e8ff3
Added 152x152 size icon
Phillip-tech Nov 21, 2024
305c53a
Updated icon sources in manifest.json to use /logo.png for all sizes
Phillip-tech Nov 21, 2024
3eb44ef
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
kutlwano10 Nov 21, 2024
5c6a0a1
Implemented sw.js and workbox
Phillip-tech Nov 21, 2024
a321086
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
Phillip-tech Nov 21, 2024
596be8f
Merge branch 'deployment' of https://github.com/Cheplusplus/ASE_2024_…
Phillip-tech Nov 21, 2024
0df2452
updated packages
Phillip-tech Nov 21, 2024
855b818
Done
kutlwano10 Nov 25, 2024
ee27b66
used serwist for pwa , it has configured the offline configs
kutlwano10 Nov 25, 2024
644b311
updated
kutlwano10 Nov 25, 2024
7561ea4
Merge branch 'Layout-theme' of https://github.com/Cheplusplus/ASE_202…
kutlwano10 Nov 25, 2024
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
35 changes: 35 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

env:
MONGODB_URI: ${{ vars.MONGODB_URI }}
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
environment: build
env:
MONGODB_URI: ${{ secrets.MONGODB_URI }}
NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }}
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm i
- run: npm run build
60 changes: 60 additions & 0 deletions app/about.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import Image from 'next/image';

const AboutUs = () =>{
return (
<section className="py-24 bg-white">
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div className="text-center max-w-3xl mx-auto">
<h1 className="text-4xl font-bold text-gray-900 mb-4">Meet Our Team</h1>
<p className="text-lg text-gray-600">
We’re the passionate developers behind Recipe Rush, dedicated to making culinary exploration easy, fun, and accessible for everyone. Our team brings together diverse skills and a shared love for cooking to build a platform that inspires people to try new recipes, master classics, and find joy in the kitchen.
</p>
</div>
<div className="flex flex-wrap mt-12 justify-center gap-y-14 max-w-3xl mx-auto lg:max-w-full">
{[
{ name: "Nomusa Mtshali", role: "add role", imgSrc: "https://via.placeholder.com/150", github: "https://github.com/nomusamtshali", linkin: "https://www.linkedin.com/in/nomusa-mtshali/" },
{ name: "Phillip Bogopane", role: "add role", imgSrc: "https://via.placeholder.com/150", github: "https://github.com/Phillip-tech", linkin: "https://linkedin.com/in/username" },
{ name: "Kutlwano Ramotebele", role: "add role", imgSrc: "https://via.placeholder.com/150", github: "https://github.com/kutlwano10", linkin: "https://www.linkedin.com/in/kutlwano-ramotebele-769461296/" },
{ name: "Kealeboga A Ntheledi", role: "add role", imgSrc: "https://via.placeholder.com/150", github: "https://github.com/Kea-Angel-Ntheledi", linkin: "https://linkedin.com/in/username" },
{ name: "Koketso Moilwe", role: "add role", imgSrc: "https://via.placeholder.com/150", github: "https://github.com/KoketsoMoilwe20", linkin: "https://www.linkedin.com/in/koketsomoilwe/" },
{ name: "Karabo M. Radebe", role: "add role", imgSrc: "https://via.placeholder.com/150", github: "https://github.com/Karabo-M-Radebe", linkin: "https://www.linkedin.com/in/karabo-m-radebe/" },
{ name: "Kitso Mogale", role: "add role", imgSrc: "https://via.placeholder.com/150", github: "https://github.com/KitsoMogale", linkin: "https://www.linkedin.com/in/kitso-mogale-200663321/" },
{ name: "Mmakgosana Makgaka", role: "add role", imgSrc: "https://via.placeholder.com/150", github: "https://github.com/Mmakgosana", linkin: "https://www.linkedin.com/in/mmakgosana-makgaka-b32478313/" },
{ name: "Mateo Benzien", role: "add role", imgSrc: "https://via.placeholder.com/150", github: "https://github.com/Mateo-Benzien", linkin: "https://www.linkedin.com/in/mateo-benzien-857864302/" },
{ name: "Sabelo Mawela", role: "add role", imgSrc: "https://via.placeholder.com/150", github: "https://github.com/SABELOMAWELA", linkin: "https://www.linkedin.com/in/sabelo-mawela-480793296/" },
].map((member, index) => (
<div key={index} className="group block text-center lg:w-1/5 sm:w-1/3 min-[450px]:w-1/2 w-full">
<div className="relative mb-5">
<Image
src={member.imgSrc}
alt={`${member.name} image`}
width={112} // 112px for width
height={112} // 112px for height
className="rounded-2xl object-cover transition-all duration-500 border-2 border-solid border-transparent group-hover:border-indigo-600"
/>
</div>
<h4 className="text-xl text-gray-900 font-semibold text-center mb-2 transition-all duration-500 group-hover:text-indigo-600">{member.name}</h4>
<span className="text-gray-500 text-center block transition-all duration-500 group-hover:text-gray-900">{member.role}</span>
<div className="space-x-4 mt-4">
<a href={member.github} target="_blank" rel="noopener noreferrer" className="w-7 h-7 inline-flex items-center justify-center rounded-full bg-gray-100 hover:bg-gray-200">
{/* GitHub Icon */}
<svg xmlns="http://www.w3.org/2000/svg" width="12px" fill="#333" viewBox="0 0 24 24">
<path d="M12 .5C5.371.5 0 5.872 0 12.5c0 5.25 3.438 9.75 8.205 11.388.6.111.793-.261.793-.577v-2.273c-3.338.724-4.043-1.607-4.043-1.607-.546-1.383-1.333-1.752-1.333-1.752-1.086-.742.083-.727.083-.727 1.204.085 1.84 1.237 1.84 1.237 1.067 1.843 2.8 1.309 3.487.999.107-.772.418-1.309.76-1.607-2.665-.3-5.465-1.334-5.465-5.935 0-1.314.47-2.387 1.236-3.224-.124-.303-.536-1.53.116-3.184 0 0 1.007-.322 3.298 1.228a11.364 11.364 0 0 1 3.005-.405c1.018.005 2.043.138 3.005.405 2.29-1.55 3.298-1.228 3.298-1.228.653 1.654.241 2.88.118 3.184.766.837 1.236 1.91 1.236 3.224 0 4.616-2.804 5.633-5.475 5.93.429.37.813 1.099.813 2.221v3.287c0 .318.191.694.797.577C20.563 22.25 24 17.75 24 12.5 24 5.872 18.629.5 12 .5z"/>
</svg>
</a>
<a href={member.linkin} target="_blank" rel="noopener noreferrer" className="w-7 h-7 inline-flex items-center justify-center rounded-full bg-gray-100 hover:bg-gray-200">
{/* LinkedIn Icon */}
<svg xmlns="http://www.w3.org/2000/svg" width="14px" fill="#333" viewBox="0 0 24 24">
<path d="M23.994 24v-.001H24v-8.802c0-4.306-.927-7.623-5.961-7.623-2.42 0-4.044 1.328-4.707 2.587h-.07V7.976H8.489v16.023h4.97v-7.934c0-2.089.396-4.109 2.983-4.109 2.549 0 2.587 2.384 2.587 4.243V24zM.396 7.977h4.976V24H.396zM2.882 0C1.291 0 0 1.291 0 2.882 0 4.47 1.291 5.765 2.882 5.765S5.765 4.47 5.765 2.882C5.765 1.291 4.47 0 2.882 0z"/>
</svg>
</a>
</div>
</div>
))}
</div>
</div>
</section>
);
};

export default AboutUs;
14 changes: 14 additions & 0 deletions app/all/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react'
import RecipeGrid from '../components/RecipeGrid'

const AllRecipes = ({searchParams}) => {
return (
<div className="relative pt-16">
<section className="w-full">
<RecipeGrid searchParams={searchParams} />
</section>
</div>
)
}

export default AllRecipes
39 changes: 39 additions & 0 deletions app/api/10Recipes/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import connectToDatabase from "@/app/lib/connectMongoose";
import Recipe from "@/app/models/Recipe";
import { NextResponse } from "next/server";

export async function GET(req) {
try {
await connectToDatabase();

const recipes = await Recipe.aggregate([
{
$lookup: {
from: "reviews",
localField: "_id",
foreignField: "recipeId",
as: "reviews",
},
},
{
$addFields: {
averageRating: { $avg: "$reviews.rating" },
},
},
{
$sort: { averageRating: -1 },
},
{
$limit: 10,
},
]);

return NextResponse.json({ success: true, recipes });
} catch (error) {
console.error("Error fetching recipes:", error);
return NextResponse.json(
{ success: false, message: "Failed to fetch recipes." },
{ status: 500 }
);
}
}
34 changes: 34 additions & 0 deletions app/api/addReview/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import connectToDatabase from "@/app/lib/connectMongoose";
import Review from "@/app/models/reviews";
import { NextResponse } from "next/server";

export async function POST(req) {
await connectToDatabase();

try {
const { recipeId, comment, rating, reviewerName } = await req.json();

// Validate request data
if ( !comment || !rating ) {
return NextResponse.json(
{ error: "All fields are required" },
{ status: 400 }
);
}

// Create a new review document
const newReview = new Review({ recipeId, comment, rating, reviewerName });
const savedReview = await newReview.save();

// Return success response
return NextResponse.json(savedReview, { status: 201 });
} catch (error) {
console.error("Error saving review:", error);

// Return error response
return NextResponse.json(
{ error: "Failed to add review" },
{ status: 500 }
);
}
}
58 changes: 58 additions & 0 deletions app/api/auth/[...nextauth]/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import NextAuth from "next-auth";
import GoogleProvider from "next-auth/providers/google";
import CredentialsProvider from "next-auth/providers/credentials";
import { MongoDBAdapter } from "@auth/mongodb-adapter";
import { clientPromise } from "@/app/lib/connectMongoose";
import User from "@/app/models/user";
import bcrypt from "bcrypt";

const authOptions = {
adapter: MongoDBAdapter(clientPromise, {
databaseName: "devdb", // Explicitly specify your database
collections: {
users: "users",
accounts: "accounts",
sessions: "sessions",
},
}),
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
}),
CredentialsProvider({
name: "Credentials",
credentials: {
email: { label: "Email", type: "email" },
password: { label: "Password", type: "password" },
},
async authorize(credentials) {
const { email, password } = credentials;
const user = await User.findOne({ email });
if (!user) throw new Error("No user found with this email");
const isValid = await bcrypt.compare(password, user.password);
if (!isValid) throw new Error("Invalid password");
return { id: user._id.toString(), email: user.email, name: user.name };
},
}),
],
secret: process.env.NEXTAUTH_SECRET,
session: { strategy: "jwt" },
callbacks: {
async session({ session, token }) {
session.user.id = token.sub;
session.user.email = token.email;
session.user.provider = token.provider;
return session;
},
async jwt({ token, account }) {
if (account) {
token.provider = account.provider;
}
return token;
},
},
};

export const GET = NextAuth(authOptions);
export const POST = NextAuth(authOptions);
39 changes: 39 additions & 0 deletions app/api/auth/register/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// pages/api/auth/register.js
import bcrypt from "bcrypt";
import User from "@/app/models/user"; // Assuming your User model is here
import connectToDatabase from "@/app/lib/connectMongoose";
import { NextResponse } from "next/server";

export async function POST(req) {
await connectToDatabase();

// Log to confirm request received
console.log("signup123");

// Parse JSON from the request body
const { email, password, name } = await req.json();
console.log(email, password, name);

// Check if the email is already in use
const existingUser = await User.findOne({ email });
if (existingUser) {
// console.log(existingUser)
return NextResponse.json({ error: "Email already in use" }, { status: 400 });
}
// Hash the password
const saltRounds = 10;
const hashedPassword = await bcrypt.hash(password, saltRounds);
//console.log(User.schema.paths);

// Create and save the new user
const newUser = new User({
email,
password: hashedPassword,
name,
});

await newUser.validate(); // Check validation errors
await newUser.save();
// Return success response
return NextResponse.json({ message: "User registered successfully" }, { status: 201 });
}
36 changes: 36 additions & 0 deletions app/api/categories/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import connectToDatabase from '@/app/lib/connectMongoose';
// pages/api/categories.js
import { NextResponse } from 'next/server';
import Categories from "@/app/models/categories";

export async function GET() {
// Connect to MongoDB
await connectToDatabase();
try {
// Fetch the categories document
const categoryDoc = await Categories.findOne({});
if (!categoryDoc) {
return NextResponse.json({ message: "Categories not found" }, { status: 404 },{
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
},
});
}
// Send back the categories array
return NextResponse.json({ categories: categoryDoc.categories }, {
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
},
});
} catch (error) {
console.error("Error fetching categories:", error);
return NextResponse.json({ message: "Internal server error" }, { status: 500 },{
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
},
});
}
}
27 changes: 27 additions & 0 deletions app/api/deleteReview/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import connectToDatabase from "@/app/lib/connectMongoose";
import Review from "@/app/models/reviews";
import { NextResponse } from "next/server";

export async function DELETE(req) {
await connectToDatabase();

try {
const { id } = await req.json();

// Validate
if (!id) {
return NextResponse.json(
{ error: "Review ID is required" },
{ status: 400 }
);
}

// Delete the review
await Review.findByIdAndDelete(id);

return NextResponse.json({ message: "Review deleted successfully" }, { status: 200 });
} catch (error) {
console.error("Error deleting review:", error);
return NextResponse.json({ error: "Failed to delete review" }, { status: 500 });
}
}
31 changes: 31 additions & 0 deletions app/api/editReview/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import connectToDatabase from "@/app/lib/connectMongoose";
import Review from "@/app/models/reviews";
import { NextResponse } from "next/server";

export async function PATCH(req) {
await connectToDatabase();

try {
const { id, comment, rating } = await req.json();

// Validate
if (!id || !comment || !rating) {
return NextResponse.json(
{ error: "All fields are required" },
{ status: 400 }
);
}

// Update the review
const updatedReview = await Review.findByIdAndUpdate(
id,
{ comment, rating },
{ new: true }
);

return NextResponse.json(updatedReview, { status: 200 });
} catch (error) {
console.error("Error editing review:", error);
return NextResponse.json({ error: "Failed to edit review" }, { status: 500 });
}
}
Loading