This project is a fully functional online shop built with Next.js, React, and TypeScript. The application fetches products from the Noroff API and allows users to browse products, search, view details, add items to a shopping cart, and complete a checkout process.
https://onlineshop-jsframeworks.netlify.app/
https://github.com/NoroffFEU/jsfw-2025-v1-wanawsha-js-frameworks
For Portfolio 2, I reviewed the project and made improvements to prepare it for professional presentation.
- Improved the product details page layout
- Increased spacing between product information sections
- Improved the presentation of product images
- Refined typography for product titles, prices and descriptions
- Improved the reviews section layout and readability
- Improved responsiveness on smaller screens
- Updated project documentation and README
Products are fetched from the Noroff API and displayed in a responsive grid layout.
Each product card shows:
- Product image
- Product title
- Price
- Discounted price (with strike-through on the original price)
- Rating
- Discount percentage badge
- Product image
- Product title
- Price
- Discounted price (with strike-through on the original price)
- Rating
- Discount percentage badge
Users can add items directly to the cart from this page.
Users can search for products using the search bar on the homepage. Products are filtered dynamically based on the search query.
The shopping cart allows users to:
- Add products
- Remove products
- Adjust quantities
- See the total price
- View the cart item count in the header
Cart data is stored in localStorage, so it persists after page refresh.
Users can proceed to checkout from the cart page. After checkout:
- The user is redirected to a Checkout Success page
- The cart is cleared
- A confirmation message is shown
Notifications appear when
- A product is added to the cart
- A product is removed from the cart
The contact page includes a validated form with the following rules:
- Full Name: minimum 3 characters
- Subject: minimum 3 characters
- Email: must be valid
- Message: minimum 10 characters
Error messages are shown if validation fails.
- Next.js
- React
- TypeScript
- CSS Modules
- Noroff Online Shop API
Data is fetched from the Noroff API:
GET /online-shop
GET /online-shop/
API documentation:
https://docs.noroff.dev/docs/v2/basic/online-shop
Clone the repository:
git clone https://github.com/NoroffFEU/jsfw-2025-v1-wanawsha-js-frameworksNavigate into the project folder:
cd jsfw-2025-v1-wanawsha-js-frameworksInstall dependencies:
npm installRun the development server:
npm run devOpen the project in the browser:
http://localhost:3000 src
app
cart
contact
checkout
success
product
[id]
loading.tsx
page.tsx
components
Header
ProductCard
ProductSearch
AddToCartButton
store
CartContext
services
api
types
Wanawsha Ahmad
JavaScript Frameworks Course Assignment – Front-End Development at Noroff