bestofapp-core-services
v1.2.2
Published
Core services and utilities for BestOfApp
Readme
@bestofapp/core-services
Core services and repositories for BestOfApp, providing a clean abstraction layer over Supabase.
Quick Start
import { StoryService } from '@bestofapp/core-services'
import { createClient } from '@supabase/supabase-js'
const supa = createClient(url, anonKey)
const stories = new StoryService({ supabase: supa }) // constructor DIAll services use constructor dependency-injection for SupabaseClient, making them portable between the Next.js app and Supabase edge functions.
Environment Variables
Required environment variables:
SUPABASE_URL- Your Supabase project URLSUPABASE_ANON_KEY- Your Supabase anonymous keySUPABASE_SERVICE_ROLE_KEY- Your Supabase service role key (for server-side operations)
Architecture
This package follows a layered architecture:
- Repositories - Data access layer with interfaces like
IStoryRepository - Services - Business logic layer with interfaces like
IStoryService - Utilities - Helper functions for client creation and common operations
All concrete implementations are prefixed with Supabase (e.g., SupabaseStoryRepository) to indicate the underlying data provider.
Recent Updates
- ✅ Credit pre-authorization system implemented
- ✅ Browser/server module separation for bcrypt compatibility
- ✅ Workspace configuration and CI pipeline fixes
