DeployFrame Docs

Frontend Overview

Overview of the frontend architecture of the AI SaaS Boilerplate

Frontend Overview

The AI SaaS Boilerplate frontend is built with Next.js 14+ and Tailwind CSS, providing a modern, responsive user interface for your AI services platform.

Technology Stack

  • Framework: Next.js 14+ with App Router
  • Styling: Tailwind CSS
  • Authentication: AWS Cognito with Google OAuth
  • State Management: React Context API
  • API Integration: Fetch API with custom hooks
  • Forms: React Hook Form
  • Internationalization: Next.js built-in i18n routing

Frontend Architecture

The frontend follows a component-based architecture with a focus on reusability, maintainability, and performance:

  • App Router: Uses Next.js App Router for file-based routing
  • Server Components: Leverages React Server Components for enhanced performance
  • Client Components: Uses Client Components for interactive UI elements
  • API Integration: Connects to backend services through AWS API Gateway
  • Responsive Design: Fully responsive design that works on all device sizes

Core Features

Project Structure

The frontend follows a standard Next.js App Router project structure:

frontend/
├── app/                      # App Router pages and layouts
│   ├── [locale]/             # Internationalization routing
│   │   ├── (billing)/        # Billing route group
│   │   ├── dashboard/        # Dashboard routes
│   │   ├── login/            # Authentication
│   │   ├── settings/         # User settings
│   │   └── ...               # Other root routes
│   ├── api/                  # API routes
│   ├── globals.css           # Global styles
│   └── layout.tsx            # Root layout
├── components/               # Shared React components
│   ├── billing/              # Billing components
│   ├── common/               # Common UI components
│   ├── dashboard/            # Dashboard components
│   ├── home/                 # Home page components
│   ├── layout/               # Layout components
│   └── settings/             # Settings components
├── contexts/                 # React context providers
├── hooks/                    # Custom React hooks
├── lib/                      # Utility functions
├── public/                   # Static assets
├── styles/                   # CSS modules and styles
└── types/                    # TypeScript type definitions

The project uses route groups (folders in parentheses) to organize routes without affecting the URL structure.

Routing System

The frontend uses Next.js App Router with internationalization support. The routing structure is:

  • Root Routes: /, /login, /settings, etc.
  • Billing Routes: Routes related to billing management
  • Dashboard Routes: Routes for accessing various AI services

For details on specific routes, see:

Component Categories

The frontend components are organized into several categories:

Authentication Flow

The authentication flow uses AWS Cognito and supports:

  1. Email/password registration and login
  2. Social login with Google
  3. Password reset
  4. Email verification
  5. Session management

For more details, see the Authentication documentation.

Internationalization

The frontend supports internationalization through Next.js's built-in i18n routing. All text is stored in language-specific JSON files, allowing easy translation to different languages.

For more details, see the Internationalization guide.

Styling System

The UI is styled with Tailwind CSS, providing:

  • Consistent design language
  • Responsive layouts
  • Dark/light mode support
  • Custom component styling

For more details about customizing the UI, see the Theming guide.

Next Steps

To learn more about specific aspects of the frontend:

On this page