Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
270 commits
Select commit Hold shift + click to select a range
e7e93b5
created models for Product and Partner, seeded data to MongoDB.
LindaSchonfeldt Aug 11, 2025
9073721
installed Zustand and created stores
LindaSchonfeldt Aug 11, 2025
2ab335f
working on the backend connecting to the frontend.
LindaSchonfeldt Aug 11, 2025
aa7d1d9
got the rendering to work again
LindaSchonfeldt Aug 12, 2025
7c7471d
working on some styling
LindaSchonfeldt Aug 12, 2025
1e3cacc
working on the React Hook Form and related stuff
LindaSchonfeldt Aug 12, 2025
82ae2fd
created working Cart and HamburgerMenu component
LindaSchonfeldt Aug 12, 2025
87d37a4
fixed the Nav layout on bigger screens
LindaSchonfeldt Aug 13, 2025
36fec6b
minor styling + Cart updates
LindaSchonfeldt Aug 13, 2025
9a5df4b
updated some styling for FeaturedFika
LindaSchonfeldt Aug 13, 2025
10febf2
new branch, local .env files
Bianka2112 Aug 14, 2025
ce29f5f
updated Cart, starting a branch instead
LindaSchonfeldt Aug 14, 2025
0f3adf2
ourstory page text, basic formatting
Bianka2112 Aug 14, 2025
c265258
ourstory mission grid with images, need to adjust img size
Bianka2112 Aug 14, 2025
c4cfce6
worked on the Cart, Form and Checkout
LindaSchonfeldt Aug 14, 2025
28a3774
worked on the Form and Cart
LindaSchonfeldt Aug 14, 2025
be773c9
created other card for FeaturedFika
LindaSchonfeldt Aug 15, 2025
74f1e28
worked on the section FeaturedFika and added a new component: Limited…
LindaSchonfeldt Aug 15, 2025
c92ddfb
added styled hashtag, fixed imgs
Bianka2112 Aug 15, 2025
c4cbb5b
Merge pull request #1 from LindaSchonfeldt/frontend/our-story
Bianka2112 Aug 15, 2025
8bf2e30
Merge pull request #2 from LindaSchonfeldt/cart-feature
LindaSchonfeldt Aug 15, 2025
5932827
.
LindaSchonfeldt Aug 15, 2025
72d7028
Updated OrderForm
LindaSchonfeldt Aug 15, 2025
2beca6b
created function to submit order
LindaSchonfeldt Aug 15, 2025
a398489
.
LindaSchonfeldt Aug 15, 2025
4226775
created and updated routes and functions for orders and customers
LindaSchonfeldt Aug 15, 2025
3772544
added totalCost to Order, styled OrderForm and Checkout
LindaSchonfeldt Aug 15, 2025
f302660
added clearing function to the Cart after submitting Form, the Cart n…
LindaSchonfeldt Aug 15, 2025
579ecc5
worked on Company login
LindaSchonfeldt Aug 15, 2025
6f3e5f1
created controllers for the routes
LindaSchonfeldt Aug 17, 2025
e5612a8
-
LindaSchonfeldt Aug 17, 2025
20c67c1
-
LindaSchonfeldt Aug 17, 2025
895e6d9
updates to components
LindaSchonfeldt Aug 17, 2025
e6e3500
worked on roles: Admin, Customer and Company
LindaSchonfeldt Aug 18, 2025
7d7fe35
working on auth, controllers and routes
LindaSchonfeldt Aug 18, 2025
45e296b
-
LindaSchonfeldt Aug 18, 2025
5c6cd4e
updated auth
LindaSchonfeldt Aug 18, 2025
ba68e88
intial form, backend model, code cleanup on rename
Bianka2112 Aug 18, 2025
4d3be6c
-
LindaSchonfeldt Aug 18, 2025
79b9e98
contact title
Bianka2112 Aug 18, 2025
7cf2c75
Merge pull request #3 from LindaSchonfeldt/feature/contactUs
Bianka2112 Aug 18, 2025
a7bf6cf
-
LindaSchonfeldt Aug 18, 2025
4f2028f
Merge branch 'auth'
LindaSchonfeldt Aug 18, 2025
98b6339
worked on adding a DropdownMenu to the ProductCard
LindaSchonfeldt Aug 18, 2025
23feb56
backend routes for contact form
Bianka2112 Aug 19, 2025
dd09511
worked to fix the Shop functions, like being able to add different si…
LindaSchonfeldt Aug 19, 2025
f314237
created Login icon in Nav and working on isLoggedIn logic
LindaSchonfeldt Aug 19, 2025
53efafa
simplified Login page
LindaSchonfeldt Aug 19, 2025
7d9d9fd
small fix to Carousel
LindaSchonfeldt Aug 19, 2025
143f97e
worked on Shop and Company styling elements
LindaSchonfeldt Aug 19, 2025
cea28db
contact backend working and adds to DB
Bianka2112 Aug 19, 2025
4bc3351
contact form submits- frontend connects to BE and DB
Bianka2112 Aug 19, 2025
07c86e8
adjust button component padding- global effect
Bianka2112 Aug 19, 2025
edec912
some err handling in contact form
Bianka2112 Aug 19, 2025
f808727
Merge pull request #4 from LindaSchonfeldt/backend/contact-form-routes
Bianka2112 Aug 19, 2025
21b8ca3
Merge pull request #5 from LindaSchonfeldt/frontend/contact-form
Bianka2112 Aug 19, 2025
214bb30
worked on some more styling and routes
LindaSchonfeldt Aug 19, 2025
b20099b
Merge branch 'main' of https://github.com/LindaSchonfeldt/naima-website
LindaSchonfeldt Aug 19, 2025
98eead2
worked on styling for ProductCard and Products
LindaSchonfeldt Aug 19, 2025
15fd5d3
-
LindaSchonfeldt Aug 20, 2025
c3722a9
testing new color palette with dummy page
Bianka2112 Aug 20, 2025
c1218c0
trying to add react responsive masonry to Products page
LindaSchonfeldt Aug 20, 2025
e8f9e51
update theme colors to new client palette, update button, footer comps
Bianka2112 Aug 20, 2025
808e88b
socialproof, carousel, color updates
Bianka2112 Aug 20, 2025
9cf76f2
working on the Company dashboard
LindaSchonfeldt Aug 20, 2025
f9195e7
-
LindaSchonfeldt Aug 20, 2025
780b02f
update vite.config, added babel plugin (Update npm i! to run)
Bianka2112 Aug 20, 2025
07d0e2f
-
LindaSchonfeldt Aug 20, 2025
5ca1768
updated ProtectedRoute
LindaSchonfeldt Aug 20, 2025
615493d
update radisson partner img in DB and FE
Bianka2112 Aug 20, 2025
e7c3bf9
Merge pull request #6 from LindaSchonfeldt/colors-style
Bianka2112 Aug 20, 2025
c07e736
worked on the company pages
LindaSchonfeldt Aug 20, 2025
ba872fb
Merge branch 'products'
LindaSchonfeldt Aug 20, 2025
e9734da
Merge branch 'company'
LindaSchonfeldt Aug 20, 2025
73c92e3
-
LindaSchonfeldt Aug 20, 2025
b395d8d
removed Login
LindaSchonfeldt Aug 20, 2025
19e34a7
mint for main color
Bianka2112 Aug 20, 2025
0020047
fix socialproof scroll and on mobile
Bianka2112 Aug 20, 2025
79586ca
working on the ProductCard, the bottom half, mostly
LindaSchonfeldt Aug 20, 2025
d83a771
worked on the Dashboard and added a new route for it (company/dashboard)
LindaSchonfeldt Aug 20, 2025
ce71603
worked on the CompanyMenu and its components
LindaSchonfeldt Aug 20, 2025
9c6917e
updated ProductCard to include a QuantitySelector that works with the…
LindaSchonfeldt Aug 21, 2025
15f6189
got the ProductsGrid to work on different screen-sizes
LindaSchonfeldt Aug 21, 2025
2704926
Merge branch 'main' of https://github.com/LindaSchonfeldt/naima-website
LindaSchonfeldt Aug 21, 2025
4663504
added Orders to CompanyDashboard, working on adding Settings
LindaSchonfeldt Aug 21, 2025
7f1b1ef
Added mockup settings to CompanySettings
LindaSchonfeldt Aug 21, 2025
c7c8764
BE and FE for basic map with retailers locations
Bianka2112 Aug 21, 2025
2ed4051
Merge pull request #7 from LindaSchonfeldt/frontend-socialproof
Bianka2112 Aug 21, 2025
b1b122d
Merge pull request #8 from LindaSchonfeldt/feature/findus-map
Bianka2112 Aug 21, 2025
7b27f22
trying to solve a backend issue with loading the Company's orders to …
LindaSchonfeldt Aug 21, 2025
5bc7559
trying to get the Checkout to work
LindaSchonfeldt Aug 21, 2025
06ccec3
-
LindaSchonfeldt Aug 21, 2025
bdb170b
Merge branch 'dashboard'
LindaSchonfeldt Aug 21, 2025
b3ec81b
Merge branch 'cart-feature'
LindaSchonfeldt Aug 21, 2025
e964e69
got the CompanyToken to come along with each login
LindaSchonfeldt Aug 21, 2025
9374276
working on the Order logic
LindaSchonfeldt Aug 21, 2025
df2deb2
update map src to public folder for production
Bianka2112 Aug 22, 2025
e62f664
Merge pull request #9 from LindaSchonfeldt/edit-map
Bianka2112 Aug 22, 2025
fc99497
backend files for map
Bianka2112 Aug 22, 2025
411aa96
Merge pull request #10 from LindaSchonfeldt/new-edit-map
Bianka2112 Aug 22, 2025
1065600
jwt secret fix for development
Bianka2112 Aug 22, 2025
3414ef3
map icons update
Bianka2112 Aug 22, 2025
b5e15aa
customized map icons for better readability and matched brand palette
Bianka2112 Aug 22, 2025
99edd09
worked on basic styling like margins
LindaSchonfeldt Aug 22, 2025
447848e
Merge branch 'products'
LindaSchonfeldt Aug 22, 2025
d3d876c
Merge branch 'dashboard'
LindaSchonfeldt Aug 22, 2025
273be47
small layout fixes
LindaSchonfeldt Aug 22, 2025
9dc1cb5
-
LindaSchonfeldt Aug 22, 2025
a807b45
updated padding in ProductCard
LindaSchonfeldt Aug 22, 2025
9da5443
styling for Cart and ProductCard
LindaSchonfeldt Aug 23, 2025
46e5732
Merge pull request #11 from LindaSchonfeldt/map-edits
Bianka2112 Aug 24, 2025
f1c770f
framer install dep! quick motion component
Bianka2112 Aug 24, 2025
e7fdf68
nav underline animation
Bianka2112 Aug 24, 2025
eac16a2
update nav colors
Bianka2112 Aug 24, 2025
af08818
hamburger menu colors fix, add animations
Bianka2112 Aug 24, 2025
351ced1
Merge pull request #12 from LindaSchonfeldt/animations
Bianka2112 Aug 24, 2025
514b2b5
mobile menu over map, prevent scroll
Bianka2112 Aug 25, 2025
8c665c7
fix ham menu onClose, clicks, etc
Bianka2112 Aug 25, 2025
7fd24dc
worked on creating an ImageGrid
LindaSchonfeldt Aug 25, 2025
ecfc497
Merge with Products page to use Zustand store for
LindaSchonfeldt Aug 25, 2025
0ccd26b
Merge branch 'products'
LindaSchonfeldt Aug 25, 2025
8e0150d
added an image to ContactUs
LindaSchonfeldt Aug 25, 2025
b275ac0
updated some styling for OurStory and ContactUs
LindaSchonfeldt Aug 25, 2025
9e83738
-
LindaSchonfeldt Aug 25, 2025
1b1b8bf
contact form page anim, form validations with anim
Bianka2112 Aug 25, 2025
ca32e51
helper hook inView, reveal comp, anim OurStory page
Bianka2112 Aug 25, 2025
022125f
social icons color fix
Bianka2112 Aug 25, 2025
3fb273b
update social links to work, styling
Bianka2112 Aug 25, 2025
4af47f7
version 2 of footer with naima banner
Bianka2112 Aug 25, 2025
3a669d4
another version for footer with overlay/banner
Bianka2112 Aug 25, 2025
c01affd
responsive footer tweak
Bianka2112 Aug 25, 2025
5b8a00c
small anim on home/feature fika
Bianka2112 Aug 25, 2025
97098a6
chore(ui): remove unused Stagger component
Bianka2112 Aug 25, 2025
ac71aff
Merge branch 'main' into animations
Bianka2112 Aug 25, 2025
94a7e9e
Merge pull request #13 from LindaSchonfeldt/animations
Bianka2112 Aug 25, 2025
614b093
update about/OurStory formatting, style
Bianka2112 Aug 25, 2025
180faf0
changes to ContactUs
LindaSchonfeldt Aug 26, 2025
53fa9d9
Merge branch 'main' of https://github.com/LindaSchonfeldt/naima-website
LindaSchonfeldt Aug 26, 2025
9477598
changed color on :focous on OrderForm
LindaSchonfeldt Aug 26, 2025
417a21f
minor styling changes
LindaSchonfeldt Aug 26, 2025
eda2ba3
-
LindaSchonfeldt Aug 26, 2025
d3702f9
update index with brand favicon
Bianka2112 Aug 26, 2025
0124093
Merge remote-tracking branch 'origin/main'
Bianka2112 Aug 26, 2025
703dca4
a11y on carousel
Bianka2112 Aug 26, 2025
2b31f95
-
LindaSchonfeldt Aug 26, 2025
2a70f7b
touched up the Products page. Added image and info overlays and style…
LindaSchonfeldt Aug 26, 2025
e6e2624
-
LindaSchonfeldt Aug 26, 2025
e37ffcf
Merge branch 'products'
LindaSchonfeldt Aug 26, 2025
ba618cf
add skiplink, a11y homepage touches
Bianka2112 Aug 26, 2025
ee86370
tiny Shop code tweak, add #main to pages for skiplink
Bianka2112 Aug 26, 2025
2b01bed
fixed the auth problem with ordering
LindaSchonfeldt Aug 26, 2025
8d48e88
changed price from SEK to $, and working on OrderDetails
LindaSchonfeldt Aug 27, 2025
c8ab6cf
Merge branch 'orders'
LindaSchonfeldt Aug 27, 2025
84a4970
patched the Order logic after merge
LindaSchonfeldt Aug 27, 2025
2460f0d
ham updates, anim on company login
Bianka2112 Aug 27, 2025
1c86fcc
finally got the OrderDetails to display for each OrderItem
LindaSchonfeldt Aug 27, 2025
0c18c06
Merge branch 'main' into a11y
Bianka2112 Aug 27, 2025
eb96f79
Merge pull request #14 from LindaSchonfeldt/a11y
Bianka2112 Aug 27, 2025
66539a3
minor styling done to Button
LindaSchonfeldt Aug 27, 2025
d63d11c
Merge branch 'orders'
LindaSchonfeldt Aug 27, 2025
05a69fb
fixed the Cart menu layout
LindaSchonfeldt Aug 27, 2025
b11c7ff
patch for CartMenu
LindaSchonfeldt Aug 27, 2025
2bd5da8
update to Products page, with info overlay
LindaSchonfeldt Aug 27, 2025
a5edcb2
added MotionReveal to some Company pages and patched CartMenu layout
LindaSchonfeldt Aug 27, 2025
d91b4ab
dashboard nav updates
Bianka2112 Aug 27, 2025
101bbc4
dashboard nav, style a11y
Bianka2112 Aug 27, 2025
251dc9c
update skiplink for 100 lighthouse 🥳
Bianka2112 Aug 27, 2025
608bc6c
draft readme
Bianka2112 Aug 27, 2025
b89d5e7
server api endpoints
Bianka2112 Aug 27, 2025
010b4f5
remove test-server file
Bianka2112 Aug 27, 2025
3c7c3f8
Merge pull request #15 from LindaSchonfeldt/readme/docs
Bianka2112 Aug 27, 2025
aee62b3
render catering/wholesalers on products page
Bianka2112 Aug 27, 2025
648e1a7
martinSer logo
Bianka2112 Aug 27, 2025
dd5385d
ex validator dep, update BE + FE contact form
Bianka2112 Aug 27, 2025
1687b3f
Merge pull request #16 from LindaSchonfeldt/feature/catering
Bianka2112 Aug 27, 2025
0d8e34e
Merge pull request #17 from LindaSchonfeldt/feat/validation
Bianka2112 Aug 27, 2025
220a202
project readme + contactform
Bianka2112 Aug 28, 2025
a18aa38
added README to backend
LindaSchonfeldt Aug 28, 2025
e7ae32f
added contact sales to LoginForm
LindaSchonfeldt Aug 28, 2025
a4eee4c
npm run build - hosting on Netlify
LindaSchonfeldt Aug 28, 2025
702aaff
fixing errors for Netlify
LindaSchonfeldt Aug 28, 2025
5ac40a2
-
LindaSchonfeldt Aug 28, 2025
50f85f4
added .nvmrc and netlify.toml files in the frontend folder
LindaSchonfeldt Aug 28, 2025
e826fba
added backend url to api.js
LindaSchonfeldt Aug 28, 2025
b71ea1b
solving node 18 vs 22 issues
LindaSchonfeldt Aug 28, 2025
454c6c0
benefits section with img, text and animated
Bianka2112 Aug 28, 2025
3247186
styling text cards
Bianka2112 Aug 28, 2025
a304cad
mobile img fix
Bianka2112 Aug 28, 2025
bfd1990
updated the path to cateringPartners
LindaSchonfeldt Aug 28, 2025
c725d7d
deleted dist
LindaSchonfeldt Aug 28, 2025
1f70ef8
-
LindaSchonfeldt Aug 28, 2025
a38b77e
added production links
LindaSchonfeldt Aug 28, 2025
92c61d5
Merge pull request #18 from LindaSchonfeldt/feat/health-page
Bianka2112 Aug 28, 2025
e01a348
patch to backend/server.js
LindaSchonfeldt Aug 28, 2025
bb91238
changed the carousel images
LindaSchonfeldt Aug 28, 2025
52d0475
added /api to API_BASE
LindaSchonfeldt Aug 28, 2025
19661a6
slogan added to Hero
LindaSchonfeldt Aug 28, 2025
55c1278
made the slogan softer
LindaSchonfeldt Aug 28, 2025
cbd18e2
minor fixes to Carousel and overall performance
LindaSchonfeldt Aug 28, 2025
5477008
-
LindaSchonfeldt Aug 28, 2025
5854954
benefits img stagger, ultra wide fix
Bianka2112 Aug 28, 2025
7759ca6
Merge pull request #19 from LindaSchonfeldt/fix/home
Bianka2112 Aug 28, 2025
2f08b37
added patch to normalize the API base
LindaSchonfeldt Aug 28, 2025
80d538e
Merge branch 'main' of https://github.com/LindaSchonfeldt/naima-website
LindaSchonfeldt Aug 28, 2025
8157134
added scroll to top on route change, with respect for reduced motion …
LindaSchonfeldt Aug 28, 2025
3456186
made the ImageGrid overlay render into document.body via a portal so …
LindaSchonfeldt Aug 28, 2025
9570b42
changed the contact link
LindaSchonfeldt Aug 28, 2025
e9ab0b8
latest order first
LindaSchonfeldt Aug 28, 2025
3f82d10
added a small cart utils and added a Total to CartMenu
LindaSchonfeldt Aug 28, 2025
424e382
added mock footer links
LindaSchonfeldt Aug 28, 2025
cec2485
patched the SocialProof roll effect
LindaSchonfeldt Aug 28, 2025
49ec195
-
LindaSchonfeldt Aug 28, 2025
153412d
added contrast to hero
Bianka2112 Aug 28, 2025
ba3ec4f
patch for slower speed for SocialProof
LindaSchonfeldt Aug 29, 2025
5f6affc
login validation
Bianka2112 Aug 29, 2025
6d265a1
Merge branch 'main' of https://github.com/LindaSchonfeldt/naima-website
Bianka2112 Aug 29, 2025
c606481
catering logos
Bianka2112 Aug 29, 2025
13e351c
fixed the price not following the order
LindaSchonfeldt Aug 29, 2025
9d98d95
Merge branch 'price'
LindaSchonfeldt Aug 29, 2025
f3e2324
removed console.logs and unnecessary folders/files from /frontend
LindaSchonfeldt Aug 30, 2025
4e87f96
removed console.logs from /backend
LindaSchonfeldt Aug 30, 2025
662651c
added environment, and file structure notes to the frontend README
LindaSchonfeldt Aug 30, 2025
6f079a4
adjust mobile
Bianka2112 Sep 1, 2025
fe691db
small change styling
Bianka2112 Sep 1, 2025
485c9e7
Merge pull request #20 from LindaSchonfeldt/fix/mobile
Bianka2112 Sep 1, 2025
631c36b
Update README.md
Bianka2112 Sep 4, 2025
86cefe2
Update README.md
Bianka2112 Sep 4, 2025
650ba94
Update README.md
Bianka2112 Sep 4, 2025
efbba09
Update README.md
Bianka2112 Sep 4, 2025
d667f72
Update developer links in README.md
LindaSchonfeldt Sep 4, 2025
0b9dc79
added portraits to the README
LindaSchonfeldt Sep 4, 2025
8d47a76
-
LindaSchonfeldt Sep 4, 2025
002ee4a
-
LindaSchonfeldt Sep 4, 2025
14a1a62
-
LindaSchonfeldt Sep 4, 2025
79e7aa3
centering the images in the README
LindaSchonfeldt Sep 4, 2025
5df1309
-
LindaSchonfeldt Sep 4, 2025
4dd4c81
-
LindaSchonfeldt Sep 4, 2025
0c508a5
-
LindaSchonfeldt Sep 4, 2025
033b35e
-
LindaSchonfeldt Sep 4, 2025
92ca1ca
-
LindaSchonfeldt Sep 4, 2025
0128b75
-
LindaSchonfeldt Sep 4, 2025
3b5706a
-
LindaSchonfeldt Sep 4, 2025
3d06363
-
LindaSchonfeldt Sep 4, 2025
ca6371c
-
LindaSchonfeldt Sep 4, 2025
00542da
-
LindaSchonfeldt Sep 4, 2025
6b8ec35
-
LindaSchonfeldt Sep 4, 2025
d56e3bd
Refactor gradient backgrounds in Shade component and remove unused St…
LindaSchonfeldt Oct 5, 2025
1a8c404
Remove unused StyledSlogan component from Hero section
LindaSchonfeldt Oct 10, 2025
0e5826d
Add demo user credentials to README
LindaSchonfeldt Oct 10, 2025
f808a14
Enhance README by adding a header for demo user credentials
LindaSchonfeldt Oct 10, 2025
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
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
90 changes: 83 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,89 @@
# Final Project
<img src="https://github.com/user-attachments/assets/0087564e-2352-4c3d-b8ae-f44eab60acaf" alt="Naima_logo" width="300" height="200">

Replace this readme with your own information about your project.
# Naima — Fika with Benefits

Start by briefly describing the assignment in a sentence or two. Keep it short and to the point.
A full-stack MERN app for Naima, a Swedish fika brand. The site showcases products, the brand story, an interactive store map, and a company dashboard for wholesale partners.

## The problem
## 🧩 The assignment

Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next?
Build a production-style full-stack web app with persistent data, authentication, and a modern, accessible UX. Ship a public site and protected “company” area, integrate at least one external service, and document everything.

## View it live
## The plan

Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about.
Goals

- Represent Naima’s brand online (products, story, social, where to buy).
- Serve real data from a backend (products, partners, retailers).
- Provide a simple, secure wholesale dashboard.
- Be fast and accessible.

Approach

- Plan: MVP → iterate. Start with static JSON/data and progressively wire backend.
- Tech choices:
- Frontend: React (Vite), styled-components, Zustand, Framer Motion, React Hook Form, Leaflet.
- Backend: Express, Mongoose/MongoDB Atlas, JWT auth, express-validator, rate-limit.
- Performance: lazy images, pre-geocoded retailers, simple animations that respect prefers-reduced-motion.
- A11y first: skip link, keyboard hamburger with focus trap, visible focus, ≥44px tap targets, ARIA-labeled carousel dots.
If we had more time: admin CRUD, IG Graph API with caching, tests, and analytics.

## ✨ Highlights

- Modern stack: React + Vite, themeable design system via styled-components.
- Real data: Products & partners from the backend; retailers shown on a map.
- Map: Leaflet + OSM tiles; inline SVG pins tinted with brand palette.
- Auth: JWT; protected company dashboard.
- A11y: Lighthouse Accessibility 100% (skip link, keyboard nav, proper labels).
- Performance: Lazy images, static geocoded JSON, reduced motion support.

## Frontend Structure

The frontend uses a React component-based architecture.
Main folders:
src/components/: Reusable UI components
src/pages/: Route components (views)
src/sections/: Page sections/layouts
src/data/: Static data (models)
src/styles/: Styling system

## Backend Structure

The backend follows an MVC pattern with a service layer (Node.js + Express + MongoDB).

Main layers:

- Routes: URL mapping (presentation/routing)
- Controllers: HTTP request/response handling
- Services: Business logic
- Models: Data access (MongoDB schemas and operations)

Architecture patterns used: MVC, 3-Tier, Layered, and Clean Architecture.

## 🌐 View it live

Deployed Frontend: https://resetwithnaima.netlify.app/

### 🔐 Demo user:

Email: demo@company.com
Password: Demo123!

Deployed Backend: https://naima-website.onrender.com/

## 👩‍💻 Developers - Find us:

<table>
<tr>
<td align="center" width="150">
<img src="https://github.com/LindaSchonfeldt.png" width="80px"/><br />
<sub><a href="https://github.com/LindaSchonfeldt">Linda Schonfeldt</a></sub>
</td>
<td align="center" width="150">
<img src="https://github.com/Bianka2112.png" width="80px"/><br />
<sub><a href="https://github.com/Bianka2112">Bianka R</a></sub>
</td>
<!-- <td align="center" >
<img src="https://user-images.githubusercontent.com/74038190/212750680-266fa8aa-39f1-4e8b-8873-7181dbaf3d7c.gif" />
</td> -->
</tr>
</table>
6 changes: 2 additions & 4 deletions backend/.babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"presets": [
"@babel/preset-env"
]
}
"presets": ["@babel/preset-env"]
}
22 changes: 22 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Dependencies
node_modules/

# Environment variables
.env
.env.local
.env.production

# Logs
*.log
npm-debug.log*

# Database
*.db
*.sqlite

# Uploads
uploads/

# OS
.DS_Store
Thumbs.db
130 changes: 125 additions & 5 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,128 @@
# Backend part of Final Project
# Naima Website — Backend

This project includes the packages and babel setup for an express server, and is just meant to make things a little simpler to get up and running with.
Lightweight README for the backend service (Express + Mongoose).

## Getting Started
## Overview

1. Install the required dependencies using `npm install`.
2. Start the development server using `npm run dev`.
This Express app provides the API for the Naima website: companies, customers, products, orders, retailers, partners and admin operations. Routes are organized under `routes/` and handlers in `controllers/`. Mongoose models live in `models/`. Basic JWT authentication is implemented in `middleware/auth.js`.

## Requirements

- Node.js 18+ (or your project's target)
- npm
- MongoDB (local or Atlas)

## Quick start

1. Install
```bash
npm install
```
2. Create a `.env` file in this folder (see Environment).
3. Start development server
```bash
npm run dev
```
4. Start production server
```bash
npm start
```

## Environment variables

Create `.env` with at least:

- PORT=3001
- MONGODB_URI=mongodb://localhost:27017/naima
- JWT_SECRET=your_jwt_secret
- NODE_ENV=development

Adjust values to your environment (Atlas connection string, secrets, etc).

## Scripts

Common scripts (expected):

- `npm run dev` — development with auto-reload (nodemon)
- `npm start` — start production server
- `node scripts/seedData.js` — seed data (if present)

Check `package.json` for exact script names in this repo.

## API overview

Routes are mounted in `routes/`:

- `/api/products` — product listing and management (controllers/productControllers.js)
- `/api/orders` — create and manage orders (controllers/orderController.js)
- `/api/company` — company auth/profile (controllers/companyControllers.js)
- `/api/customers` — customer endpoints (controllers/customerControllers.js)
- `/api/retailers` — retailer locations (controllers/retailerController.js)
- `/api/partners` — partners
- `/api/admin` — admin endpoints
- `/api/contact` — contact form messages

Use the route files to see exact endpoints and required params.

## Authentication

- JWT-based. Tokens are signed with `JWT_SECRET`.
- Auth middleware: `middleware/auth.js` — verifies tokens and attaches decoded user to `req`.
- Protect routes by applying `authenticate` and `authorize` where required.

Example header for protected routes:

```
Authorization: Bearer <token>
```

## Models (high level)

Look in `models/` for schemas:

- Company, Customer, Admin
- Product
- Order (items, totalCost, status)
- RetailLocation, Partner, ContactMessage

## Seeding & data import

- `scripts/seedData.js` and `scripts/import-retailers.mjs` are available for seeding and importing retailer geocoded data. Inspect and run with Node as needed.

## Logging & debugging

- Check server console for auth / JWT errors (invalid signature, expired).
- Ensure `MONGODB_URI` is correct when you see connection errors.
- Use Postman / curl to test endpoints. Inspect response status (401 for auth issues, 500 for server errors).

Example: log in (company) and fetch order

```bash
# login -> get token
curl -X POST http://localhost:3001/api/company/login -H "Content-Type: application/json" -d '{"email":"...","password":"..."}'

# fetch order
curl http://localhost:3001/api/orders/<orderId> -H "Authorization: Bearer <token>"
```

## Troubleshooting

- JsonWebTokenError: invalid signature — check `JWT_SECRET` consistency between token issuer and verifier.
- 401 Unauthorized — ensure token is present and not expired.
- CORS issues — check server CORS settings and client origin.
- 500 Server Error — check server console for stack trace and controller errors.

## Deployment

- Set env variables on your host (PORT, MONGODB_URI, JWT_SECRET).
- Use a process manager (pm2) or containerize with Docker.
- Ensure proper CORS and HTTPS handling in production.

## Contributing

- Follow the existing project structure: routes → controllers → models → services.
- Keep controllers focused and move reusable logic to `services/`.

## Contacts

- Repository owner / maintainer: see project-level README or repository meta.
94 changes: 94 additions & 0 deletions backend/controllers/adminControllers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import bcrypt from 'bcryptjs'
import jwt from 'jsonwebtoken'

import Admin from '../models/Admin.js'

// Register a new admin
export const registerAdmin = async (req, res) => {
try {
const { name, email, password } = req.body
if (!password) {
return res.status(400).json({ error: 'Password is required' })
}
const hashedPassword = await bcrypt.hash(password, 10)
const admin = new Admin({
name: req.body.name,
email: req.body.email,
password: hashedPassword,
role: 'admin' // Set role explicitly
})
await admin.save()
res.status(201).json({ message: 'Admin registered!' })
} catch (error) {
res.status(400).json({ error: error.message })
}
}

// Login an admin
export const loginAdmin = async (req, res) => {
const { email, password } = req.body
const admin = await Admin.findOne({ email })
if (!admin) return res.status(401).json({ error: 'Invalid credentials' })

const valid = await bcrypt.compare(password, admin.password)
if (!valid) return res.status(401).json({ error: 'Invalid credentials' })

const token = jwt.sign({ adminId: admin._id }, process.env.JWT_SECRET, {
expiresIn: '1d'
})
res.json({ token, admin: { name: admin.name, email: admin.email } })
}

// Get all admins
export const getAllAdmins = async (req, res) => {
try {
const admins = await Admin.find()
res.json(admins)
} catch (error) {
res.status(500).json({ error: error.message })
}
}

// Get a single admin by ID
export const getAdminById = async (req, res) => {
try {
const admin = await Admin.findById(req.params.id)
if (!admin) return res.status(404).json({ error: 'Admin not found' })
res.json(admin)
} catch (error) {
res.status(500).json({ error: error.message })
}
}

// Update an admin's details
export const updateAdmin = async (req, res) => {
try {
const admin = await Admin.findByIdAndUpdate(req.params.id, req.body, {
new: true,
runValidators: true
})
if (!admin) return res.status(404).json({ error: 'Admin not found' })
res.json(admin)
} catch (error) {
res.status(400).json({ error: error.message })
}
}

// Delete an admin
export const deleteAdmin = async (req, res) => {
try {
const admin = await Admin.findByIdAndDelete(req.params.id)
if (!admin) return res.status(404).json({ error: 'Admin not found' })
res.json({ message: 'Admin deleted successfully' })
} catch (error) {
res.status(500).json({ error: error.message })
}
}

// Middleware to check if the user is an admin
export const isAdmin = (req, res, next) => {
if (req.user.role !== 'admin') {
return res.status(403).json({ error: 'Forbidden' })
}
next()
}
Loading