Vkusnoru
An e-commerce store on Next.js and NestJS with a product catalog, checkout, a custom admin panel, logging, and attack protection.
Next.jsReactTypeScriptNestJSPostgreSQLPrismaDockerNginx
Task
Build an e-commerce store with a public storefront (catalog, product cards with weight-based options, checkout) and a full-featured admin panel for managing the catalog, content (articles, SEO, seasonal settings, delivery), and orders — without relying on off-the-shelf CMS solutions, with a transparent architecture and full control over security and data.
Result
- A complete e-commerce store with a self-service management platform: the owner runs the catalog, content, and orders through a custom admin panel with no dependency on third-party CMS tools.
- Transparent security oversight: a login log with suspicious-attempt detection and error logs that are safe to store and review thanks to automatic sanitization of sensitive data.
Solution
- Backend on NestJS with a clear layered architecture (controller → service → Prisma) and a modular structure: public modules (catalog, categories, orders, SEO) kept separate from admin modules (products, categories, orders, media, articles, delivery, seasonal settings, security). Shared Zod schemas live in a dedicated package (@sladkoru/contracts) used on both the frontend and backend, eliminating type drift between client and server.
- Checkout with order cost calculated server-side from the product's weight-based options (never trusting client-supplied prices), plus new-order notifications via email and Telegram.
- Admin authentication via JWT in httpOnly cookies (signed with jose, passwords hashed with argon2) with session versioning for instant access revocation. A dedicated security module logs every login attempt (IP, user agent, status, failure reason) and flags suspicious activity.
- A custom error-logging system with a sanitizer: before hitting the database, entries pass through filters that redact passwords, tokens, cookies, and other sensitive fields, mask emails and phone numbers, and build an error fingerprint (from the method, path, and normalized message) to group recurring incidents.
- Frontend on Next.js (App Router), split into a public storefront (RSC-first, tag-based caching and ISR) and a protected admin area with product management forms and image upload/conversion (Sharp → WebP). Storefront cache invalidation runs through a bearer-secured webhook whenever admin data changes.
- Infrastructure via Docker and Nginx, allowing a production-like environment to be run identically both locally and in production.