A modern, responsive ecommerce frontend built with React and Vite.
The application provides a complete online shopping experience including product browsing, cart management, authentication, checkout, Stripe payment integration, order history, and a protected admin dashboard.
This project is the frontend application for a full-stack hair oil ecommerce platform.
It communicates with a separate Node.js/Express backend through REST APIs.
- Customer storefront
- Product browsing
- Shopping cart
- User authentication
- Forgot Password / Reset Password
- Checkout
- Stripe payment
- Order history
- Admin dashboard
- Product management
- Order management
- User management
- Analytics
- Admin messages
- π Home page
- ποΈ Product listing
- π Product details
- π Product search
- π·οΈ Category filtering
- π° Price filtering
- π Shopping cart
- β Increase product quantity
- β Decrease product quantity
- β Remove cart items
- πΎ Persistent cart using Local Storage
- π€ User registration
- π User login
- ποΈ Show/hide password
- π Forgot Password
- π Reset Password
- π¦ Place orders
- π³ Stripe Checkout
- β Payment success page
- π My Orders
- π± Responsive design
The application includes a protected admin panel accessible only to authorized administrators.
- Revenue statistics
- Monthly sales information
- Total products
- Total users
- Total orders
- Inventory information
- Low-stock products
- Top-selling products
- Recent orders
- Recent users
- Business statistics
- Sales information
- Revenue data
- Visual charts using Recharts
- Create products
- Edit products
- Delete products
- Search products
- Product pagination
- Product images
- Cloudinary image upload
- View all orders
- Search orders
- View order details
- Update order status
- Cancel pending orders
- Export orders as CSV
- View registered users
- Search users
- Admin-protected routes
- Admin message management
- View customer messages
The admin dashboard includes:
- Collapsible sidebar
- Sidebar navigation icons
- Responsive layout
- Dashboard cards
- Tables
- Charts
- Admin-only protected routes
- React
- Vite
- JavaScript
- React Router DOM
- Context API
- Axios
- React Hook Form
- Yup
- CSS Modules
- Custom CSS
- React Icons
- Lucide React
- PrimeReact
- PrimeIcons
- Recharts
- Stripe
@stripe/react-stripe-js@stripe/stripe-js
npm install axios
npm install react-router-dom
npm install react-hook-form
npm install yup
npm install @hookform/resolvers
npm install react-icons
npm install lucide-react
npm install primereact primeicons
npm install recharts
npm install @stripe/react-stripe-js
npm install @stripe/stripe-jsUiHairOil/
β
βββ public/
β
βββ src/
β β
β βββ api/
β β βββ Axios.js
β β
β βββ assets/
β β
β βββ components/
β β βββ Navbar.jsx
β β βββ Footer.jsx
β β βββ AdminRoute.jsx
β β βββ ScrollToTop.jsx
β β βββ admin/
β β βββ AdminLayout.jsx
β β βββ Sidebar.jsx
β β
β βββ context/
β β βββ CartContext.jsx
β β
β βββ pages/
β β βββ Home.jsx
β β βββ Products.jsx
β β βββ ProductDetails.jsx
β β βββ About.jsx
β β βββ Contact.jsx
β β βββ Cart.jsx
β β βββ Login.jsx
β β βββ Register.jsx
β β βββ ForgotPassword.jsx
β β βββ ResetPassword.jsx
β β β
β β βββ admin/
β β β βββ AdminDashboard.jsx
β β β βββ AdminProducts.jsx
β β β βββ AdminCreateProduct.jsx
β β β βββ AdminEditProduct.jsx
β β β βββ AdminOrders.jsx
β β β βββ AdminOrderDetails.jsx
β β β βββ AdminStatsDashboard.jsx
β β β βββ AdminUser.jsx
β β β βββ AdminMessages.jsx
β β β
β β βββ order/
β β βββ Checkout.jsx
β β βββ OrderSuccess.jsx
β β βββ MyOrders.jsx
β β βββ PaymentSuccess.jsx
β β
β βββ utils/
β β βββ auth.js
β β
β βββ validations/
β β βββ authSchema.js
β β
β βββ Styles/
β β
β βββ App.jsx
β βββ main.jsx
β
βββ .env
βββ .gitignore
βββ package.json
βββ vite.config.js
βββ README.md
The frontend uses Vite environment variables.
Create a local .env file:
VITE_API_URL=http://localhost:5000For production, this value should point to the deployed backend API.
Example:
VITE_API_URL=https://your-production-backend-urlNever commit your real .env file to GitHub.
The repository should contain .env.example instead:
VITE_API_URL=git clone git@github.com:Faiza-tech/hairoilFrontend.gitcd hairoilFrontendnpm installCreate:
.env
and add:
VITE_API_URL=http://localhost:5000npm run devThe Vite development server normally runs on:
http://localhost:5173
Create a production build:
npm run buildPreview the production build locally:
npm run previewScreenshots can be stored inside:
screenshots/
Recommended screenshots:
- Home page
- Products page
- Product details
- Shopping cart
- Login
- Forgot Password
- Reset Password
- Checkout
- Stripe payment
- Payment success
- My Orders
- Admin dashboard
- Analytics
- Product management
- Order management
- User management
Example:

The customer checkout flow is:
Browse Products
β
Add to Cart
β
Checkout
β
Enter Shipping Details
β
Stripe Checkout
β
Payment
β
Payment Success
β
Order Confirmation
β
Order History
Register
β
Login
β
JWT Authentication
β
Protected Requests
β
User Account
Forgot Password:
Forgot Password
β
Enter Email
β
Backend Sends Reset Email
β
Open Reset Link
β
Create New Password
β
Login With New Password
Admin Login
β
AdminRoute Protection
β
Admin Dashboard
β
βββββββββββββββββ
β Dashboard β
β Analytics β
β Products β
β Orders β
β Users β
β Messages β
βββββββββββββββββ
The admin sidebar can be collapsed to provide more workspace for the dashboard.
Through this project I worked with:
- React component architecture
- Vite
- React Router
- Protected routes
- JWT authentication
- Context API
- Local Storage
- REST API integration
- Axios interceptors
- Form validation
- React Hook Form
- Yup
- Stripe Checkout
- Payment confirmation
- Order management
- Admin dashboard architecture
- CRUD operations
- Search and filtering
- Pagination
- Recharts
- Cloudinary
- Responsive UI design
- Forgot Password / Reset Password workflows
- Email-based authentication workflows
Potential future improvements include:
- β€οΈ Wishlist
- β Product reviews and ratings
- ποΈ Coupon system
- π·οΈ Discount management
- π Dark mode
- π Multi-language support
- π± Progressive Web App support
- π More notification features
- π¦ Advanced inventory management
- π More advanced analytics
Backend repository:
https://github.com/Faiza-tech/hairoilbackend
Faiza
GitHub:
https://github.com/Faiza-tech
If you find this project useful, feel free to β the repository.