The Challenge
Fabrilamp is a Spanish lighting fixtures distributor whose sales team, retail customers, and internal staff all need different views into a catalog of thousands of products. Their legacy ordering system couldn’t handle offline scenarios, multi-language requirements, or the complex B2B workflows — custom pricing tiers, shipping terms, invoice management — that the business depends on.
The Solution
A full-featured B2B e-commerce platform built on Next.js 15, designed offline-first. The entire product catalog lives in a local SQLite database via Drizzle ORM, so the application works without an internet connection and syncs when connectivity returns. Server-side rendering handles the public-facing catalog for SEO, while role-based access control tailors the experience for each user type.


Key Features
- Offline-first architecture — Full product catalog stored locally in SQLite with background sync, so the platform works without connectivity
- Role-based dashboards — Admins, salesmen, customers, and employees each get a tailored dashboard with relevant KPIs, order history, and management tools
- Multi-language support — Complete i18n covering product descriptions, UI labels, and transactional emails
- Product catalog — Advanced filtering by category, finish, and specifications across thousands of products with dynamic slug-based routing
- B2B order workflow — Draft carts, approval flows, custom pricing tiers, and integration with the distributor’s invoicing system
- Pre-resolved image URIs — Product images resolved at the data layer rather than render time, eliminating redundant queries
Architecture
Frontend — Next.js 15 with React 19, styled using Tailwind CSS and Radix UI primitives for accessible, composable components. TanStack Query manages server state with caching and background updates.
Data layer — SQLite via Drizzle ORM provides the offline-first storage layer. The full product database syncs bidirectionally with the server, reconciling changes on reconnection.
Rendering — Server-side rendering for the public catalog pages (SEO), with client-side navigation for instant transitions once loaded.