Full-featured frontend application for a laser & optoelectronic components catalog built with Next.js.
- Browse catalog with category tree navigation
- Product search and filtering
- Shopping cart with persistent storage (Zustand + localStorage)
- Order submission with API fallback to mailto
- Responsive design (desktop-first)
- SEO optimized with metadata generation
- Docker + Nginx setup for local development with API proxy
- Next.js 16+
- TypeScript
- TailwindCSS
- Zustand (state management)
- React Query (data fetching)
- Install dependencies:
npm install- Set environment variable (optional, defaults to production API):
# Create .env.local
NEXT_PUBLIC_API_BASE=https://tamasaya.ru/api/laserio- Run development server:
npm run devnpm run build
npm startThe project includes Docker and Nginx configuration for local development with API proxying.
- Build and start containers:
docker compose up --build- Access the application:
- Frontend: http://localhost:8100
- API requests are proxied through Nginx to https://tamasaya.ru/api/laserio
- Images/media are proxied from https://tamasaya.ru
- web: Next.js application (port 3000 internally)
- nginx: Reverse proxy (exposes port 80)
Nginx configuration:
- Proxies
/api/laserio/*to production API - Proxies
/media/*and/uploads/*to production server - Serves frontend from Next.js container
app/
├── page.tsx # Homepage
├── categories/ # Catalog map page
├── catalog/[slug]/ # Category pages
├── products/[slug]/ # Product detail pages
├── cart/ # Shopping cart
└── checkout/ # Checkout form
components/
├── Header.tsx
├── Footer.tsx
├── CategoryTree.tsx
├── ProductCard.tsx
├── CartDrawer.tsx
└── ...
lib/
├── api.ts # API client functions
├── hooks.ts # React Query hooks
└── types.ts # TypeScript types
store/
└── cart.ts # Zustand cart store
Base API URL: https://tamasaya.ru/api/laserio
Endpoints:
GET /categories/tree- Get category treeGET /categories/:slug- Get category with children/productsGET /products/:slug- Get product detailsPOST /orders- Submit order (with mailto fallback)
Private project