Bicyblex Store is a Next.js 16 Pages Router application. All route entry points live in the top-levelDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/bicyblex/bicyblexStore/llms.txt
Use this file to discover all available pages before exploring further.
pages/ directory, while UI components, shared context, library clients, and utilities are organised under src/. This separation keeps route files thin — each page file does little more than import and render its corresponding component tree — and puts all reusable logic where it belongs: inside src/.
Directory tree
Key files
pages/index.js — Public storefront
pages/index.js — Public storefront
The storefront entry point. It wraps all section components in a
<GlobalProvider> so that every child has access to site-wide data via the useGlobalData() hook. Components are composed in order: <Topnav>, <Hero>, <NewsLetter>, <Products>, <ElectricMotos>, <ElectricKits>, <Features>, <Footer>. The page also sets the document <title> and meta description via next/head.pages/login.js — Admin login
pages/login.js — Admin login
A minimal page file that renders the
<Login> component from src/components/login/login.jsx. All login logic (form state, Supabase Auth call, redirect on success) lives inside that component.pages/dashboard.js — Protected admin dashboard
pages/dashboard.js — Protected admin dashboard
Renders the
<Dashboard> component from src/components/dashboard/dashboard.jsx. The <Dashboard> component is responsible for checking the active Supabase session and redirecting unauthenticated visitors back to /login. Once authenticated, it exposes the full product, category, and news management interface.src/lib/supabaseClient.js — Supabase singleton
src/lib/supabaseClient.js — Supabase singleton
Creates and exports a single Supabase client instance shared across the entire application. It reads Import this singleton wherever you need to query the database or interact with Storage:
NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY from the environment and logs a console error if either is missing, preventing silent failures.src/context/GlobalContext.js — Site-wide data
src/context/GlobalContext.js — Site-wide data
Defines a
siteData object holding the business phone number, pre-built WhatsApp message URLs for different flows (generic inquiry, newsletter item, product inquiry, electric kits), email, social links (TikTok, Instagram), and the current app version. GlobalProvider wraps the storefront and useGlobalData() is the hook used by any child component to read this data.src/utils/imageUtils.js — WebP conversion
src/utils/imageUtils.js — WebP conversion
Exports a single
convertToWebP(file, quality) function. It accepts a File object and an optional quality value (default 0.8), draws the image onto an off-screen <canvas>, and returns a Promise that resolves to a new .webp File object. This is called before any product image is uploaded to Supabase Storage, reducing file sizes automatically.Path alias
jsconfig.json configures a single path alias: @/* maps to ./* (the project root). This means you can import any file in the project using @/ as the base, regardless of how deeply nested the importing file is. For example, @/src/lib/supabaseClient always resolves to src/lib/supabaseClient.js — no ../../../ traversal needed.jsconfig.json
Page surfaces
The application is split into two clearly separated user-facing surfaces:| Surface | Route | Entry file | Auth required |
|---|---|---|---|
| Public storefront | / | pages/index.js | No |
| Admin dashboard | /dashboard | pages/dashboard.js | Yes (Supabase Auth) |
/login. There is no middleware-level route protection — the guard is implemented inside the <Dashboard> component itself.