Founderflow Logo

Component Architecture

Understanding the component organization and architecture of the Founderflow Boilerplate. Learn about the component structure, patterns, and best practices.

Component Organization

1. UI Components (`components/ui/`)

Base components built on Radix UI primitives with consistent styling and behavior:

B

button.tsx

Button variants with multiple styles

C

card.tsx

Card layouts and containers

D

dialog.tsx

Modal dialogs and overlays

I

input.tsx

Form inputs and controls

T

table.tsx

Data tables and grids

N

toast.tsx

Notifications and alerts

2. Landing Components (`components/landing/`)

Marketing page components for your landing page:

Hero Sections

Multiple hero layouts for different styles

Features

Feature showcase grids and cards

Pricing

Pricing table components

Testimonials

Customer testimonials and reviews

FAQ

Accordion-style FAQs

Footer

Site footer with links and branding

3. Platform Components (`components/platform/`)

Dashboard components for your application:

S

Sidebar

Navigation sidebar component

B

Billing

Subscription management

P

Profile

User profile forms

N

Breadcrumbs

Navigation breadcrumbs

Component Patterns

Composition

Components built for reusability and flexibility

Props Interface

Strong TypeScript typing for all component props

Variants

Multiple visual variants for different use cases

Accessibility

ARIA compliance and keyboard navigation

Responsive

Mobile-first design approach

Animation

Framer Motion integration for smooth transitions

File Structure

Project Structure
NextshipBoilerplate/
β”œβ”€β”€ app/
β”œβ”€β”€ [locale]/
β”œβ”€β”€ (auth)/
β”œβ”€β”€ (guest)/
β”œβ”€β”€ (legal)/
└── (platform)/
β”œβ”€β”€ api/
β”œβ”€β”€ (platform)/
β”œβ”€β”€ payments/
β”œβ”€β”€ public/
β”œβ”€β”€ resend/
β”œβ”€β”€ stripe/
└── webhook/
└── globals.css
β”œβ”€β”€ components/
β”œβ”€β”€ admin/
β”œβ”€β”€ auth/
β”œβ”€β”€ blog/
β”œβ”€β”€ buttons/
β”œβ”€β”€ comparison/
β”œβ”€β”€ landing/
β”œβ”€β”€ hero/
β”œβ”€β”€ features/
β”œβ”€β”€ pricing/
β”œβ”€β”€ testimonial/
└── footer/
β”œβ”€β”€ payments/
β”œβ”€β”€ platform/
└── ui/
β”œβ”€β”€ lib/
β”œβ”€β”€ config/
β”œβ”€β”€ email-templates/
β”œβ”€β”€ utils/
β”œβ”€β”€ db.ts
β”œβ”€β”€ stripe.ts
β”œβ”€β”€ lemonsqueezy.ts
└── utils.ts
β”œβ”€β”€ models/
β”œβ”€β”€ hooks/
β”œβ”€β”€ types/
β”œβ”€β”€ locales/
β”œβ”€β”€ public/
β”œβ”€β”€ docs/
└── examples/

Best Practices

Component Naming

Use descriptive, PascalCase names that clearly indicate the component's purpose.

βœ“ Good: UserProfileCard, PaymentForm, NavigationMenu
βœ— Bad: Card, Form, Menu

Props Interface

Always define TypeScript interfaces for component props.

interface ButtonProps {
variant?: 'primary' | 'secondary';
size?: 'sm' | 'md' | 'lg';
onClick?: () => void;
}

File Organization

Group related components in logical directories and use index files for clean imports.

components/
ui/
index.ts
button.tsx
card.tsx