Back to Archive
Case Study ยท 2024FeaturedLIVE v1.0

Celebricks

Celebricks

A comprehensive full-stack platform for seamless event management, booking, and dynamic content delivery for a themed service business.

Celebricks
Booking Confirmed (0.5s)

Celebricks is an interactive web platform designed for managing event bookings, products, and a full administrative suite. It offers secure user authentication, dynamic content updates via a custom CMS, and streamlined booking processes for a vibrant, brick-themed service business.

Problem Visual
The Problem

Disjointed Operations & Manual Event Management

Modern event and service businesses face significant challenges in efficiently managing bookings, inventory, customer data, and website content, often juggling disparate tools or manual processes. This leads to operational bottlenecks, inconsistent customer experiences, and difficulties in scaling services, especially for dynamic offerings like themed parties or workshops that require intricate scheduling and resource allocation.

Solution Visual
The Solution

Unified Control.
Seamless Event Flow.

Celebricks addresses these issues by providing a unified, full-stack Next.js application with a powerful, role-based admin dashboard. It leverages Supabase for a robust PostgreSQL backend and authentication, ensuring secure user and admin roles. AWS S3 integration handles efficient media storage, while custom API routes manage data for products, bookings, blog posts, and user profiles, creating a cohesive and scalable solution for comprehensive business operations.

Feature Visual
Implementation

Role-Based<br />Admin Access & CMS

Auth
API Routes
Supabase
CMS

System Core // Role-Based Admin API Authorization Middleware

import { NextResponse } from 'next/server';
import supabaseAdmin from '@/lib/supabase-admin';
// Assumes resolveUserFromRequest handles JWT verification and user fetching.

export async function resolveAdminFromRequest(request) {
  const { user, error: authError } = await resolveUserFromRequest(request);
  if (authError) return { error: authError }; // Authentication failure

  const { data: profile, error: profileError } = await supabaseAdmin
    .from('profiles')
    .select('id, role') // Only fetch necessary role info
    .eq('id', user.id)
    .maybeSingle();

  if (profileError) throw profileError;

  if (!profile || !['admin', 'super_admin'].includes(profile.role)) {
    // User authenticated but not authorized as admin
    return { error: NextResponse.json({ error: 'Forbidden' }, { status: 403 }) };
  }

  return { user, profile }; // Authorized admin user and profile
}
javascript
Next Project

Next Case Study

GRID