Fresh Roots is a modern, full-stack e-commerce application designed for selling fresh produce, including staples, fruits, and vegetables. Built with performance and user experience in mind, it features a responsive design, real-time authentication, a comprehensive admin dashboard, and multi-language support.
- Product Discovery: Browse a wide range of fresh products with advanced filtering by category (Staples, Fruits, Vegetables) and real-time search.
- User Accounts: Secure sign-up and login functionality powered by Supabase Authentication.
- Shopping Cart: Dynamic cart management with real-time price calculation and quantity adjustments.
- Wishlist: Save favorite items for future purchase.
- Product Details: In-depth product views with nutritional information, origin details, and quality scores.
- Responsive Design: Fully optimized for mobile, tablet, and desktop devices.
- Dark Mode: Beautiful, system-aware dark mode with a custom animated theme switcher (Sun/Moon with ambient effects).
- Secure Access: Dedicated admin login portal.
- Dashboard Overview: Visual analytics showing total revenue, active orders, and sales trends using interactive charts.
- Inventory Management: Add, edit, and delete products. Manage stock levels, prices, and images.
- Order Management: View and update customer order statuses (Pending, Shipped, Delivered, etc.).
- User Management: Monitor registered users and manage account access.
- Pagination: Optimized product listings with server-side style pagination for performance.
- Frontend: React 18, TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS, Shadcn UI (Radix Primitives)
- Icons: Lucide React
- Charts: Recharts
- State Management: React Context API
- Routing: React Router DOM v6
- Backend / Auth: Supabase
- Forms: React Hook Form + Zod Validation
- Internationalization: i18next
Follow these instructions to get a copy of the project running on your local machine for development and testing purposes.
- Node.js (v18 or higher)
- npm or yarn
-
Clone the repository
git clone https://github.com/yourusername/fresh-roots.git cd fresh-roots -
Install dependencies
npm install
-
Configure Environment Variables Create a
.envfile in the root directory and add your Supabase credentials:VITE_SUPABASE_URL=your_supabase_url_here VITE_SUPABASE_ANON_KEY=your_supabase_anon_key_here
-
Run the development server
npm run dev
Open http://localhost:8080 with your browser to see the result.
To create a production-ready build:
npm run buildThe artifacts will be generated in the dist directory.
fresh-roots/
├── src/
│ ├── components/ # Reusable UI components
│ │ ├── admin/ # Admin-specific components (Dashboard, Sidebar, etc.)
│ │ ├── ui/ # Shadcn UI primitives
│ │ └── ...
│ ├── context/ # Global state (Auth, Cart, Theme)
│ ├── data/ # Mock data and static content
│ ├── hooks/ # Custom React hooks
│ ├── i18n/ # Internationalization configuration
│ ├── integrations/ # Third-party integrations (Supabase)
│ ├── lib/ # Utility functions
│ ├── pages/ # Main route pages (Home, Login, Admin, etc.)
│ ├── utils/ # Helper functions
│ ├── App.tsx # Main application component
│ └── main.tsx # Entry point
├── public/ # Static assets
└── ...
To access the admin panel, navigate to /admin/login.
- Note: For development, default admin credentials may be configured in the source code or database. Please ensure to update these for production environments.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
- Shadcn UI for the beautiful component library.
- Tailwind CSS for the utility-first CSS framework.
- Supabase for the open source Firebase alternative.
- Lucide for the clean and consistent icons.