Skip to content

hesrun/ReactShop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

18 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›๏ธ ReactShop

Modern e-commerce platform built with React, TypeScript, and Supabase. A fully-featured online store with product catalog, shopping cart, favorites, user authentication, and order management.

๐ŸŒ Live Demo


โœจ Features

๐Ÿ” Authentication & User Management

  • User registration and login
  • Protected routes with role-based access
  • Secure session management with Supabase Auth
  • User account management

๐Ÿ›’ Shopping Experience

  • Dynamic Product Catalog with advanced filtering by category
  • Product Search with real-time results
  • Wishlist/Favorites system with persistent storage
  • Shopping Cart with quantity management
  • Price calculations with discount percentages
  • Responsive product cards with hover effects

๐Ÿ“ฆ Order Management

  • Complete checkout flow with address validation
  • Multiple delivery methods selection
  • Order history and order tracking
  • Order status monitoring
  • Email notifications for order confirmations

๐Ÿ’ณ Addresses Management

  • Add and manage multiple delivery addresses
  • Address validation
  • Quick address selection during checkout
  • Edit/delete addresses

๐ŸŽจ UI/UX

  • Responsive design (mobile, tablet, desktop)
  • Loading skeletons for better UX
  • Toast notifications
  • Modal dialogs for actions
  • Dark mode ready with Tailwind CSS

โšก Performance

  • Lazy loading components
  • Optimized state management with MobX
  • Efficient data fetching
  • Image optimization

๐Ÿš€ Tech Stack

Frontend

  • React 19 - UI framework
  • TypeScript - Type safety
  • Vite - Lightning-fast build tool
  • Tailwind CSS - Utility-first styling
  • React Router - Client-side routing

State Management & Data

  • MobX - Reactive state management
  • Supabase - Backend as a Service (Auth, Database, Storage)
  • React Query patterns - Data fetching with custom hooks

Features & Libraries

  • React Toastify - Toast notifications
  • Lucide React - Beautiful icons

Email Service

  • Resend - Transactional email delivery for order confirmations

Infrastructure & Deployment

  • Vercel - Hosting and CI/CD
  • Supabase - PostgreSQL database and authentication
  • Deno - Serverless functions for order emails via Resend

๐Ÿ“‹ Project Structure

src/
โ”œโ”€โ”€ api/               # Supabase configuration
โ”œโ”€โ”€ assets/            # Static assets
โ”œโ”€โ”€ components/        # Reusable UI components
โ”‚   โ”œโ”€โ”€ common/        # Feature-specific components
โ”‚   โ”‚   โ”œโ”€โ”€ addresses/
โ”‚   โ”‚   โ”œโ”€โ”€ cart/
โ”‚   โ”‚   โ”œโ”€โ”€ categories/
โ”‚   โ”‚   โ”œโ”€โ”€ category/
โ”‚   โ”‚   โ”œโ”€โ”€ header/
โ”‚   โ”‚   โ”œโ”€โ”€ order/
โ”‚   โ”‚   โ””โ”€โ”€ orders/
โ”‚   โ”œโ”€โ”€ layout/        # Layout components
โ”‚   โ”œโ”€โ”€ protectedRoutes/  # Authentication guards
โ”‚   โ”œโ”€โ”€ skeletons/     # Loading skeletons
โ”‚   โ””โ”€โ”€ ui/            # Basic UI components
โ”œโ”€โ”€ constants/         # Application constants
โ”œโ”€โ”€ hooks/             # Custom React hooks
โ”œโ”€โ”€ pages/             # Page components
โ”œโ”€โ”€ routes/            # Route definitions
โ”œโ”€โ”€ store/             # MobX stores
โ”‚   โ”œโ”€โ”€ addressStore
โ”‚   โ”œโ”€โ”€ cartStore
โ”‚   โ”œโ”€โ”€ favoriteStore
โ”‚   โ”œโ”€โ”€ loadingStore
โ”‚   โ”œโ”€โ”€ modalStore
โ”‚   โ”œโ”€โ”€ ordersStore
โ”‚   โ””โ”€โ”€ userStore
โ”œโ”€โ”€ types/             # TypeScript types
โ””โ”€โ”€ utils/             # Helper functions

๐ŸŽฏ Key Functionalities

State Management with MobX

  • User Store - Authentication state, user data
  • Cart Store - Shopping cart management with persistence
  • Favorite Store - Wishlist functionality
  • Address Store - User addresses management
  • Orders Store - Order history and details
  • Modal Store - Modal dialogs state
  • Loading Store - Global loading state

Custom Hooks

  • useFetch() - Data fetching with loading/error states
  • useSendOrderEmail() - Order confirmation email sending

Serverless Functions (Deno)

  • send-order - Email notifications for new orders via Supabase Functions + Resend integration

๐ŸŽฏ Roadmap & Future Features

Coming Soon

  • ๐Ÿ” Admin Dashboard - Order management, product management, analytics
  • ๐Ÿ“Š Admin Role - User role-based access control (Customer, Admin)
  • ๐Ÿ“ˆ Analytics Dashboard - Sales reports, user metrics
  • ๐Ÿ›๏ธ Wishlist Sharing - Share favorites with friends
  • ๐Ÿ’ณ Payment Integration - Stripe/PayPal integration
  • ๐Ÿ“ฆ Inventory Management - Stock tracking for admin
  • ๐ŸŒ Multi-language Support - i18n implementation

Current Limitations

  • โš ๏ธ Admin dashboard is not yet implemented (user-facing features only)
  • โš ๏ธ Role-based access control (RBAC) pending implementation

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Supabase account

Installation

  1. Clone the repository
git clone https://github.com/yourusername/ReactShop.git
cd ReactShop
  1. Install dependencies
npm install
  1. Set up environment variables Create .env.local file:
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
  1. Run development server
npm run dev
  1. Build for production
npm run build

๐Ÿ“ฑ Core Pages

  • Main - Homepage with featured products
  • Category - Products filtered by category
  • Product - Detailed product information
  • Cart - Shopping cart with checkout flow
  • Favorites - Wishlist management
  • Addresses - User address management
  • Orders - Order history and tracking
  • Order - Individual order details
  • Account - User profile management
  • Auth - Login/Registration pages

๐Ÿ”— API Integration

  • DummyJSON API - Product data source
  • Supabase Database - User data, orders, addresses, favorites
  • Supabase Auth - User authentication
  • Supabase Functions - Email notifications

๐ŸŽจ Design Features

  • Clean, modern UI with Tailwind CSS
  • Consistent component library
  • Responsive grid layouts
  • Smooth transitions and animations
  • Professional color scheme with sky/blue accents
  • Loading states with skeleton screens

๐Ÿ”’ Security

  • Protected authentication routes
  • Secure session management
  • SQL injection prevention via Supabase
  • Type-safe API calls with TypeScript
  • Environment variable protection

๐Ÿ“Š Performance Optimizations

  • Code splitting with React Router
  • Lazy loading components
  • Optimized bundle size with Vite
  • Efficient state updates with MobX
  • Image lazy loading
  • CSS minification with Tailwind

๐Ÿค Contributing

Contributions are welcome! Feel free to submit issues or pull requests.


๐Ÿ“„ License

This project is open source and available under the MIT License.


๐Ÿ‘จโ€๐Ÿ’ป Author

Vlad - Full Stack Developer


๐Ÿ“ž Support

For support, please open an issue on GitHub or contact via email.


Made with โค๏ธ using React & TypeScript

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages