This project is a React + Vite frontend for a furniture store experience that combines:
- Interactive 3D product preview
- Web-based Augmented Reality (AR) placement
- Role-based product and order management
- Checkout and order tracking workflows
It was built as part of an academic software engineering project focused on practical AR use in e-commerce.
Backend repo (Spring Boot):
Run the backend first, then start this frontend.
- Browse products with 3D previews
- View product details and media carousel
- Place items in cart and complete checkout
- View own orders and order details
- Switch UI theme color
- Open Manage area for product and user management
- Create/edit products and customize model data
- Upload and manage product images
- View all orders, filter by user id or order id
- Update order status and delete orders
- Update user roles (customer, employee, admin)
- Delete users (with master admin safety restriction)
- Framework: React 18 + Vite 5
- 3D/AR: three, @react-three/fiber, @react-three/drei, maath
- State: valtio
- Routing: react-router-dom
- Forms: react-hook-form
- HTTP: axios
- UI: Bootstrap 5, Bootstrap Icons, SweetAlert2, AOS
src/
components/ reusable UI and feature components
canvas/ Three.js and AR scene/camera logic
pages/ route-level pages (products, login, manage, orders, etc.)
store/ global valtio state
- Node.js 18+ and npm
- Backend server running locally on port 8080
- MySQL configured for the backend project
- Chrome browser (camera + motion sensors are required for AR flows)
- Clone and run backend:
git clone https://github.com/ThiwankaReiss/AR-Project.gitFollow backend setup in that repository (database, mail configuration, and server startup).
- Install frontend dependencies:
npm install- Start frontend:
npm run dev- Open:
http://localhost:5173
npm run dev- Start development servernpm run build- Create production buildnpm run preview- Preview production build locallynpm run lint- Run ESLint checks
The frontend currently calls backend APIs using hardcoded local URLs such as:
- http://localhost:8080/auth
- http://localhost:8080/model
- http://localhost:8080/order
- http://localhost:8080/user
- http://localhost:8080/images/upload
Ensure the backend is reachable at http://localhost:8080 when running locally.
- User signs in or registers.
- Products are loaded from backend and shown in 3D-capable cards.
- User can view detail/customization/AR depending on role and selected item.
- Cart is converted into an order at checkout.
- Orders can be tracked by customer; staff can manage statuses and records.
- Route access control is mainly handled by UI conditions in the frontend.
- API base URL is hardcoded to localhost and not environment-driven yet.
- Some AR behavior depends on browser/device permission support.
- Add protected route guards for role-based navigation
- Move API base URL to environment configuration
- Improve error handling and loading states across all data views
- Add unit/integration tests for critical flows
- Three.js: https://threejs.org/
- React Three Fiber: https://docs.pmnd.rs/react-three-fiber
- Bootstrap: https://getbootstrap.com/
- React: https://react.dev/