Module Deep Dives
Understanding Our React Marketplace's Architecture
This section provides comprehensive deep dives into each type of module in our React marketplace.
Remember: This is our marketplace's organizational structure. Your marketplace can organize modules differently (Level 1 Personalization).
π― What You'll Learn
Each deep-dive page explains:
- What the module type is
- Why we need it
- When to use it
- How it works
- Real examples from our marketplace
π Available Deep Dives
Adapters Deep Dive β
Universal SDK Configuration (Framework-Agnostic)
Learn about:
- What adapters are and why they exist
- Framework-agnostic principle
- When to create an adapter
- Real examples: Better Auth, Stripe, Vercel AI SDK
- How connectors import from adapters
Key Concept: Adapters configure SDKs universally, without framework coupling.
Connectors Deep Dive β
SDK + Framework Integration
Learn about:
- What connectors are and why they exist
- The Adapter β Connector pattern
- When to create a connector
- Backend Overwrites Hooks pattern (priority system)
- Real examples: better-auth-nextjs, stripe-nextjs-drizzle
- Category-first organization
Key Concept: "A connector cannot exist without the adapters it tries to connect."
Features Deep Dive β
Complete Business Capabilities
Learn about:
- Backend / Tech-Stack / Frontend structure
- When backend is needed (decision tree!)
- All integration patterns (SDK, API, Custom)
- Tech-Stack as the contract layer
- Real examples: Auth, Payments, Teams
- Backend Overwrites Hooks pattern
Key Concept: Features use 3 layers with tech-stack as single source of truth.
π How They Work Together
The Flow:
1. Adapter (Universal)
adapters/auth/better-auth/
βββ config.ts (Universal Better Auth config)
βββ client.ts (Auth client)
βββ types.ts (Core auth types)
β Deployed to: src/lib/auth/
β Framework-agnostic: Works with Next.js, Remix, etc.2. Connector (Framework-Specific)
connectors/auth/better-auth-nextjs/
βββ config.ts (Imports adapter, adds Next.js plugins)
βββ api/route.ts (Next.js API routes)
βββ middleware.ts (Next.js middleware)
βββ hooks.ts (SDK-native hooks, priority 2)
β Requires: adapters/auth/better-auth
β Provides: Next.js-specific integration3. Feature (Business Logic)
features/auth/
βββ tech-stack/ (Schemas, types, generic hooks, UI stores)
βββ frontend/shadcn/ (UI components)
β No backend/ needed (connector handles it!)π Quick Reference
| Module Type | Purpose | Framework-Specific? | Requires | Example |
|---|---|---|---|---|
| Adapter | Configure SDK universally | β No | - | adapters/auth/better-auth/ |
| Connector | Integrate SDK + Framework | β Yes | Adapters | connectors/auth/better-auth-nextjs/ |
| Feature | Deliver business capability | β οΈ Frontend only | Adapters/Connectors | features/auth/ |
π― Common Questions
Q: When do I create an adapter vs connector?
Adapter:
- β Configuring a new SDK/library
- β Want framework-agnostic setup
- β Can be reused across frameworks
- Example:
adapters/auth/better-auth/
Connector:
- β Integrating SDK with specific framework
- β Need framework-specific code (API routes, middleware)
- β Want to provide SDK-native hooks
- Example:
connectors/auth/better-auth-nextjs/
Q: When do I need a backend in my feature?
Backend NOT needed (β):
- SDK + connector handle everything
- Example: Auth with Better Auth
Backend OPTIONAL (β οΈ):
- External API provides core functionality
- Only need custom business logic
- Example: Payments with Stripe
Backend REQUIRED (β ):
- No SDK available
- Custom business logic needed
- Example: Teams Management
β See Features Deep Dive for decision tree!
Q: What's the Backend Overwrites Hooks pattern?
Tech-stack provides generic hooks (priority 1):
// features/auth/tech-stack/hooks.ts
export function useSession() {
return useQuery({ /* generic fetch */ });
}Connector provides SDK-native hooks (priority 2 - WINS!):
// connectors/auth/better-auth-nextjs/hooks.ts
export { useSession } from '@/lib/auth/client'; // Better Auth nativeβ Frontend imports from @/lib/auth and gets the best version available!
β See Connectors Deep Dive for details!
π Where to Start?
I want to understand adapters
I want to understand connectors
I want to understand features
I want the big picture
π‘ Why Deep Dives Matter
Problem: Main architecture page was getting too long and verbose.
Solution: Dedicated deep-dive pages for each module type.
Benefit:
- β Main architecture page stays concise
- β Users can choose their depth
- β All patterns explained with real examples
- β No redundancy or conflicts
π Learning Path
Quick Overview (15 minutes):
- Read Architecture & Concepts Parts 1-3
- Understand the big picture
- Done!
Deep Understanding (1-2 hours):
- Read Architecture & Concepts
- Deep dive into Adapters
- Deep dive into Connectors
- Deep dive into Features
- Understand all patterns and examples
- Done!
You choose your depth! β
π Next Steps
- Adapters Deep Dive β - Universal SDK configuration
- Connectors Deep Dive β - Framework integration
- Features Deep Dive β - Business capabilities
- Architecture Overview β - High-level concepts
- Contributing β - Build your own modules
Choose a deep dive above to get started! π