A fully functional, responsive, and modern e-commerce web application built with Next.js 15 (App Router), Tailwind CSS, Zustand, and Supabase. This project demonstrates a complete full-stack shopping experience, from product browsing to secure checkout.
- Modern UI/UX: Premium aesthetic with a responsive design, smooth animations, and glassmorphism effects.
- Product Catalog: Fetches real-time data from FakeStoreAPI.
- Search & Filter: Real-time product filtering by category and keyword search.
- Product Details: comprehensive product pages with ratings and descriptions.
- Persistent Cart: Shopping cart state is preserved across page reloads (using Zustand persistence).
- Cart Sidebar: Slick slide-out drawer for managing cart items.
- Dynamic Checkout: Real-time calculation of Subtotal, Tax, and Grand Total.
- Authentication: Secure User Login and Registration using Supabase Auth.
- Protected Routes: Checkout flow requires user authentication.
- Order Persistence: Completed orders are saved to a PostgreSQL database (Supabase).
- Framework: Next.js 15 (App Router)
- Styling: Tailwind CSS v4, Lucide React Icons
- State Management: Zustand
- Validation: React Hook Form + Zod
- Backend/Auth: Supabase (PostgreSQL + Auth)
- Language: TypeScript
git clone https://github.com/yourusername/stylestore.git
cd stylestorenpm installCreate a .env.local file in the root directory and add your Supabase credentials:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_keyRun the following SQL in your Supabase SQL Editor to create the necessary table:
create table orders (
id uuid default gen_random_uuid() primary key,
created_at timestamp with time zone default timezone('utc'::text, now()) not null,
user_id uuid references auth.users(id) not null,
total_amount numeric not null,
status text not null,
shipping_address jsonb,
items jsonb
);
alter table orders enable row level security;
create policy "Users can create their own orders"
on orders for insert with check (auth.uid() = user_id);
create policy "Users can view their own orders"
on orders for select using (auth.uid() = user_id);npm run devOpen http://localhost:3000 to view the app.
src/
├── app/ # Next.js App Router Pages
│ ├── checkout/ # Protected Checkout Page
│ ├── login/ # Auth Pages
│ ├── product/[id]/ # Dynamic Product Details
│ └── page.tsx # Homepage + Hero
├── components/
│ ├── cart/ # Cart Sidebar & Logic
│ ├── checkout/ # Payment Forms
│ ├── products/ # Product Grid & Cards
│ ├── shared/ # Navbar & Footer
│ └── ui/ # Reusable UI Atoms (Buttons, Inputs)
├── lib/
│ ├── store.ts # Zustand Global Store
│ ├── supabase/ # Auth Clients
│ └── api.ts # FakeStoreAPI Fetchers
This project is optimized for deployment on Vercel.
- Push your code to GitHub.
- Import the project into Vercel.
- Add the
NEXT_PUBLIC_SUPABASE_URLandNEXT_PUBLIC_SUPABASE_ANON_KEYto Vercel's Environment Variables. - Deploy!
Developed for Future Interns Task 2
