A minimal e-commerce demo application designed for Playwright visual testing experiments.
visual-testing/
├── frontend/ # React + TypeScript (Vite)
├── backend/ # Node.js + Express + TypeScript
├── infra/ # SQL schemas, env templates, docs
└── docker-compose.yml # Container orchestration
- Frontend: React 18, TypeScript, Vite, React Router
- Backend: Node.js, Express, TypeScript
- Database: Supabase (PostgreSQL)
- Container: Docker, Docker Compose
| Route | Description |
|---|---|
/ |
Product listing page |
/product/:id |
Product detail page |
/cart |
Shopping cart page |
- Light/Dark theme toggle
- Success banner after adding items to cart
- Deterministic UI (no random data)
- ARIA-compliant components
- Responsive design
- Node.js 20+
- npm or yarn
- Supabase account with database configured
- Docker (for containerized deployment)
- Create a new Supabase project
- Run the schema migration in
infra/schema.sql - Seed the database with
infra/seed.sql
Create a .env file in the project root:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
PORT=4000cd backend
npm install
npm run devServer runs at http://localhost:4000
API Documentation: http://localhost:4000/api-docs
cd frontend
npm install
npm run devApp runs at http://localhost:3000
-
Copy environment template:
cp infra/.env.example .env
-
Edit
.envwith your Supabase credentials -
Build and start containers:
docker-compose up --build
-
Access the app:
- Frontend: http://localhost:3000
- Backend API: http://localhost:4000
- API Documentation: http://localhost:4000/api-docs
This project uses Swagger/OpenAPI for interactive API documentation. Once the backend server is running, you can access:
- Swagger UI: http://localhost:4000/api-docs - Interactive API documentation where you can test endpoints
- OpenAPI Spec: http://localhost:4000/api-docs.json - Raw OpenAPI JSON specification
This application is optimized for Playwright visual testing:
- All interactive elements have proper ARIA roles and labels
- No randomized content or dynamic timestamps in UI
- Deterministic placeholder images using seeded URLs
- Theme toggle provides predictable visual states
- Success notifications are dismissible and timed
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run typecheck- Run TypeScript checks
npm run dev- Start with hot reloadnpm run build- Compile TypeScriptnpm run start- Start production server