This repository contains a multi-industry demonstration application built on Next.js that showcases feature management capabilities using LaunchDarkly. The application demonstrates how feature flags, experimentation, and progressive delivery can be implemented across different industry verticals including banking, airlines, investment, and e-commerce.
The application follows a modern React/Next.js architecture with the following components:
┌─────────────────────────────────────────────────────────────┐
│ Client Browser │
└───────────────────────────┬─────────────────────────────────┘
│
┌───────────────────────────▼─────────────────────────────────┐
│ Next.js │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────┐ │
│ │ Pages/Routes │ │ API Routes │ │ Components │ │
│ └────────┬────────┘ └────────┬────────┘ └──────┬──────┘ │
│ │ │ │ │
│ ┌────────▼────────────────────▼───────────────────▼──────┐ │
│ │ Context Providers │ │
│ │ ┌─────────────┐ ┌──────────────┐ ┌────────────────┐ │ │
│ │ │LD Context │ │Login Context │ │Telemetry │ │ │
│ │ └─────────────┘ └──────────────┘ └────────────────┘ │ │
│ └──────────────────────────┬─────────────────────────────┘ │
└──────────────────────────────┬─────────────────────────────-┘
│
┌──────────────────────────────▼─────────────────────────────-┐
│ External Services │
│ ┌─────────────┐ ┌──────────────┐ ┌────────────────────-┐ │
│ │LaunchDarkly │ │AI Providers │ │Database (PostgreSQL)│ │
│ └─────────────┘ └──────────────┘ └────────────────────-┘ │
└─────────────────────────────────────────────────────────────┘
- ContextProvider: Initializes the LaunchDarkly client and provides flag values to components
- TelemetryProvider: Manages analytics and telemetry data collection
- LoginProvider: Handles authentication state and user context
The application is organized into industry-specific components:
- Banking: Account management, credit cards, mortgage applications
- Airways: Flight booking, check-in, travel management
- Investment: Portfolio management, stock trading, retirement planning
- Marketplace: E-commerce storefront, product catalog, shopping cart
Built on Radix UI and styled with TailwindCSS, the component library includes:
- Navigation components
- Form elements
- Cards and containers
- Modals and dialogs
- Data visualization
- Industry-specific components
LaunchDarkly is integrated throughout the application to control:
- Feature availability
- UI variations
- Backend behavior
- Experimentation
- Progressive delivery
-
User Authentication:
- User logs in through LoginHomePage component
- User context is created and stored in LoginProvider
- LaunchDarkly context is updated with user attributes
-
Feature Evaluation:
- Components request flag values from LaunchDarkly context
- Features are conditionally rendered based on flag state
- User experiences are personalized based on context
-
API Integration:
- Components make requests to Next.js API routes
- API routes communicate with external services
- Responses are processed and rendered in UI
-
AI/Chatbot Integration:
- User interactions are processed through ChatBot component
- Requests are routed to appropriate AI provider (AWS Bedrock, etc.)
- Responses are displayed in the UI
The application uses Drizzle ORM with PostgreSQL for data persistence, with tables for:
- User accounts and profiles
- Banking transactions and accounts
- Flight bookings and itineraries
- Investment portfolios and stock transactions
- Product inventory and orders
The application is designed to be deployed as a Next.js application with:
- Client-side rendering for interactive components
- Server-side rendering for SEO and initial load performance
- API routes functioning as serverless functions
- Infrastructure management with Terraform
The application showcases several feature management patterns:
- Feature Flags: On/off toggles for features
- Multivariate Flags: Multiple variations of features
- Targeting Rules: User-specific experiences
- A/B Testing: Experimentation with metrics
- Progressive Delivery: Controlled rollouts
- Frontend: Next.js, React, TypeScript, TailwindCSS
- Backend: Next.js API routes, PostgreSQL, Drizzle ORM
- Feature Management: LaunchDarkly SDK
- AI Integration: AWS Bedrock, OpenAI
- Testing: Playwright
- Infrastructure: Terraform
- Enhanced mobile responsiveness
- Additional industry verticals
- Expanded AI integrations
- Performance optimizations
- Advanced experimentation scenarios