Skip to content

farum12/LittleBugShop.FE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ› LittleBugShop Frontend

Wake up, samurai β€” we have bugs to catch!

A vibe coded React frontend for a bookstore application, purpose-built as a sandbox for test automation practice.

🎯 Purpose

This project was created as a test automation training ground. It's designed to be:

  • Test-friendly β€” Every interactive element has data-testid attributes
  • Realistic β€” Full e-commerce functionality (products, cart, orders, wishlist, reviews)
  • Predictable β€” Consistent patterns for easy selector targeting

Data-TestID Convention

data-testid="page-name"           β†’ e.g., "cart-page"
data-testid="element-name"        β†’ e.g., "search-input"
data-testid="element-name-{id}"   β†’ e.g., "product-card-123"
data-testid="action-button"       β†’ e.g., "add-to-cart-button"

πŸ› οΈ Tech Stack

Technology Version Purpose
React 18.3.1 UI Framework
TypeScript 5.6.3 Type Safety
Vite 6.0.3 Build Tool & Dev Server
Tailwind CSS 3.4.15 Styling
React Router 6.28.0 Client-side Routing
Axios 1.7.7 HTTP Client

πŸš€ Getting Started

Prerequisites

Installation

# Clone the repository
git clone https://github.com/farum12/LittleBugShop.FE.git
cd LittleBugShop.FE

# Install dependencies
npm install

# Start development server
npm run dev

The app will be available at http://localhost:3000

Available Scripts

Command Description
npm run dev Start development server
npm run build Build for production
npm run preview Preview production build
npm run lint Run ESLint

πŸ“ Project Structure

src/
β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”œβ”€β”€ Header.tsx       # Navigation header
β”‚   β”œβ”€β”€ Footer.tsx       # Page footer
β”‚   β”œβ”€β”€ Layout.tsx       # Main layout wrapper
β”‚   β”œβ”€β”€ ProductCard.tsx  # Product display card
β”‚   β”œβ”€β”€ LoadingSpinner.tsx
β”‚   └── ErrorMessage.tsx
β”œβ”€β”€ pages/               # Route pages
β”‚   β”œβ”€β”€ HomePage.tsx
β”‚   β”œβ”€β”€ ProductsPage.tsx
β”‚   β”œβ”€β”€ ProductDetailPage.tsx
β”‚   β”œβ”€β”€ CartPage.tsx
β”‚   β”œβ”€β”€ CheckoutPage.tsx
β”‚   β”œβ”€β”€ OrdersPage.tsx
β”‚   β”œβ”€β”€ WishlistPage.tsx
β”‚   β”œβ”€β”€ LoginPage.tsx
β”‚   β”œβ”€β”€ RegisterPage.tsx
β”‚   β”œβ”€β”€ ProfilePage.tsx
β”‚   └── NotFoundPage.tsx
β”œβ”€β”€ services/            # API service layer
β”‚   β”œβ”€β”€ api.ts           # Axios instance + interceptors
β”‚   β”œβ”€β”€ authService.ts
β”‚   β”œβ”€β”€ productService.ts
β”‚   β”œβ”€β”€ cartService.ts
β”‚   β”œβ”€β”€ orderService.ts
β”‚   β”œβ”€β”€ reviewService.ts
β”‚   └── wishlistService.ts
β”œβ”€β”€ types/               # TypeScript interfaces
β”‚   └── index.ts
β”œβ”€β”€ App.tsx              # Router configuration
β”œβ”€β”€ main.tsx             # Entry point
└── index.css            # Tailwind imports

🎨 Theme

Custom bug-themed color palette:

Color Hex Usage
Bug Primary #2d5a27 Main green
Bug Secondary #8b4513 Brown accents
Bug Accent #ffd700 Gold highlights

πŸ“– Pages & Features

Page Route Features
Home / Hero, featured products
Products /products Search, filter, pagination
Product Detail /products/:id Details, reviews, add to cart
Cart /cart View/edit cart, apply coupons
Checkout /checkout Shipping address, payment
Orders /orders Order history
Wishlist /wishlist Saved products
Login /login Authentication
Register /register New account
Profile /profile User settings

πŸ”Œ API Integration

The frontend proxies API requests to the backend:

  • Dev proxy: localhost:3000/api/* β†’ localhost:5052/api/*
  • Auth: JWT tokens stored in localStorage
  • Interceptors: Auto-attach auth headers, handle 401 redirects

πŸ§ͺ For Test Automation Engineers

This app is your playground! Here's what you can practice:

  • E2E Testing β€” Full user flows (browse β†’ cart β†’ checkout)
  • Component Testing β€” Isolated component behavior
  • API Testing β€” Mock or intercept service calls
  • Visual Regression β€” Consistent UI with Tailwind
  • Accessibility Testing β€” Semantic HTML structure

Selector Strategy

Recommended priority:

  1. data-testid attributes (most stable)
  2. Semantic roles (button, link, textbox)
  3. Text content (for assertions)
  4. CSS classes (Tailwind utilities are stable)

⚠️ Disclaimer

This is a vibe coded project β€” built with AI assistance (GitHub Copilot) in a single session. It's meant for learning and testing, not production use.

πŸ“„ License

MIT


Built with πŸ› and β˜• for the QA community

About

πŸ› Test automation sandbox frontend built with React, TypeScript & Tailwind CSS. Features comprehensive data-testid coverage for QA practice.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages