Skip to main content

Frequently Asked Questions (FAQ)

Get answers to the most commonly asked questions about ABP React.

๐Ÿš€ Getting Startedโ€‹

What is ABP React?โ€‹

ABP React is a modern, high-performance React frontend template for ABP Framework applications. It provides a complete UI solution with authentication, user management, multi-tenancy, and more, built with Next.js, TypeScript, and Tailwind CSS.

How is ABP React different from the default Angular UI?โ€‹

ABP React offers several advantages over the default Angular UI:

  • Better Performance: Built with Next.js for optimal performance and SEO
  • Modern Stack: Uses the latest React ecosystem tools and practices
  • Better DX: Superior developer experience with TypeScript and modern tooling
  • Smaller Bundle: More efficient code splitting and tree shaking
  • SEO Optimized: Server-side rendering capabilities

Do I need to know ABP Framework to use ABP React?โ€‹

While basic ABP Framework knowledge is helpful, ABP React is designed to be accessible to React developers. The template handles most ABP integrations automatically, and our documentation covers the ABP-specific concepts you need to know.

Is ABP React production-ready?โ€‹

Yes, ABP React is production-ready and is actively used in production applications. It includes comprehensive testing, CI/CD pipelines, and follows industry best practices.

๐Ÿ› ๏ธ Installation & Setupโ€‹

What are the system requirements?โ€‹

  • Node.js: 18.0 or higher
  • pnpm: 8.0 or higher (recommended package manager)
  • .NET 8 SDK: For backend development
  • Modern Browser: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+

Why use pnpm instead of npm or yarn?โ€‹

We recommend pnpm because it's:

  • Faster: More efficient installation and caching
  • Smaller: Reduces disk space usage with symlinks
  • Stricter: Better dependency resolution and security
  • Compatible: Works with all npm packages

Can I use npm or yarn instead of pnpm?โ€‹

Yes, you can use npm or yarn, but you may need to:

  • Delete pnpm-lock.yaml
  • Update scripts in package.json
  • Handle potential dependency resolution differences

How do I update to the latest version?โ€‹

For template updates:

# Check current version
npm list -g Anto.Abp.React.Template

# Update template
dotnet new uninstall Anto.Abp.React.Template
dotnet new install Anto.Abp.React.Template

# Create new project with latest template
dotnet new abp-react -o my-updated-project

For project dependencies:

# Update all dependencies
pnpm update

# Update specific dependency
pnpm update @next/bundle-analyzer

๐Ÿ” Authentication & Securityโ€‹

How does authentication work?โ€‹

ABP React uses NextAuth.js for authentication, integrated with ABP Framework's authentication system:

  1. JWT Tokens: Secure token-based authentication
  2. Session Management: Automatic session handling and refresh
  3. Multiple Providers: Support for credentials, OAuth, and more
  4. Role-Based Access: Integration with ABP's permission system

Can I use social login providers?โ€‹

Yes, ABP React supports multiple authentication providers:

  • Google OAuth
  • GitHub OAuth
  • Microsoft OAuth
  • Facebook OAuth
  • Custom OAuth providers

Configure them in your environment variables and NextAuth configuration.

How do I handle permissions?โ€‹

ABP React includes built-in permission handling:

// Check permissions in components
const { hasPermission } = usePermissions();

if (!hasPermission('Users.Create')) {
return <div>Access denied</div>;
}

// Use permission wrapper
<PermissionWrapper permission="Users.Edit">
<EditUserButton />
</PermissionWrapper>

Is the application secure?โ€‹

Yes, ABP React follows security best practices:

  • JWT Token Security: Secure token storage and transmission
  • CSRF Protection: Built-in CSRF protection
  • Input Validation: Client and server-side validation
  • XSS Prevention: React's built-in XSS protection
  • Permission Checks: Comprehensive authorization system

๐ŸŒ Multi-tenancyโ€‹

What is multi-tenancy?โ€‹

Multi-tenancy allows a single application instance to serve multiple tenants (organizations) with isolated data and configurations. Each tenant has their own data, users, and settings.

How do I enable multi-tenancy?โ€‹

Multi-tenancy is enabled by default in ABP React. You can configure it in your environment:

NEXT_PUBLIC_ENABLE_MULTI_TENANCY=true

How does tenant switching work?โ€‹

ABP React provides automatic tenant switching:

  • Subdomain-based: tenant1.myapp.com
  • Header-based: __tenant header
  • Manual switching: Tenant switcher component

Can I disable multi-tenancy?โ€‹

Yes, you can disable multi-tenancy:

NEXT_PUBLIC_ENABLE_MULTI_TENANCY=false

This will hide tenant-related UI and functionality.

๐Ÿ“ฑ UI & Componentsโ€‹

What UI library does ABP React use?โ€‹

ABP React uses shadcn/ui components built on top of:

  • Radix UI: For accessible, unstyled components
  • Tailwind CSS: For utility-first styling
  • Lucide React: For icons

Can I customize the theme?โ€‹

Yes, ABP React supports comprehensive theming:

// Configure theme in tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
primary: {
50: '#f0f9ff',
500: '#3b82f6',
900: '#1e3a8a',
},
},
},
},
};

Are the components responsive?โ€‹

Yes, all components are built with responsive design:

  • Mobile-first: Designed for mobile devices first
  • Breakpoint System: Tailwind's responsive breakpoints
  • Touch-friendly: Optimized for touch interactions

Can I use other UI libraries?โ€‹

Yes, you can integrate other UI libraries:

  • Material-UI: For Material Design components
  • Ant Design: For enterprise-class UI
  • Chakra UI: For modular component library
  • Custom Components: Build your own component library

๐Ÿ”ง Developmentโ€‹

How do I add new pages?โ€‹

With Next.js App Router, creating pages is simple:

// app/users/page.tsx
export default function UsersPage() {
return <div>Users Page</div>;
}

// app/users/[id]/page.tsx
export default function UserDetailPage({ params }: { params: { id: string } }) {
return <div>User ID: {params.id}</div>;
}

How do I add new API endpoints?โ€‹

Create API routes in the app/api directory:

// app/api/users/route.ts
import { NextRequest, NextResponse } from 'next/server';

export async function GET(request: NextRequest) {
// Handle GET request
return NextResponse.json({ users: [] });
}

export async function POST(request: NextRequest) {
// Handle POST request
const body = await request.json();
return NextResponse.json({ success: true });
}

How do I customize the build process?โ€‹

Customize the build in next.config.mjs:

/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
appDir: true,
},
images: {
domains: ['example.com'],
},
env: {
CUSTOM_KEY: process.env.CUSTOM_KEY,
},
};

export default nextConfig;

How do I add custom middleware?โ€‹

Add middleware in middleware.ts:

import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';

export function middleware(request: NextRequest) {
// Add custom logic
return NextResponse.next();
}

export const config = {
matcher: '/admin/:path*',
};

๐Ÿ“Š Performanceโ€‹

How do I optimize performance?โ€‹

ABP React includes several performance optimizations:

  1. Code Splitting: Automatic code splitting with Next.js
  2. Image Optimization: Next.js Image component
  3. Bundle Analysis: Built-in bundle analyzer
  4. Caching: React Query for data caching
  5. Lazy Loading: Component lazy loading

How do I analyze bundle size?โ€‹

Use the built-in bundle analyzer:

# Analyze bundle size
pnpm analyze

# This will open a visual representation of your bundle

Why is my application slow?โ€‹

Common performance issues and solutions:

  1. Large Bundle: Use code splitting and lazy loading
  2. Unnecessary Re-renders: Use React.memo and useMemo
  3. Heavy API Calls: Implement proper caching
  4. Large Images: Use Next.js Image optimization
  5. Memory Leaks: Check for uncleaned event listeners

๐Ÿ”„ API Integrationโ€‹

How do I generate the API client?โ€‹

The API client is automatically generated from your ABP backend:

# Generate client
pnpm generate-client

# Specify custom API URL
pnpm generate-client --input https://your-api.com/swagger/v1/swagger.json

What if my API changes?โ€‹

Regenerate the client whenever your API changes:

# Regenerate client
pnpm generate-client

# This will update types and service methods

How do I handle API errors?โ€‹

ABP React includes comprehensive error handling:

// Global error handler
export const handleApiError = (error: unknown) => {
if (error instanceof ApiError) {
// Handle ABP-specific errors
if (error.body?.error?.message) {
toast.error(error.body.error.message);
}
}
};

// Component-level error handling
const { data, error, isLoading } = useUsers();

if (error) {
return <div>Error: {error.message}</div>;
}

Can I use REST APIs from other frameworks?โ€‹

Yes, ABP React can work with any REST API:

// Custom API client
const customApi = axios.create({
baseURL: 'https://api.external.com',
timeout: 5000,
});

// Custom hook
export const useCustomData = () => {
return useQuery({
queryKey: ['custom-data'],
queryFn: () => customApi.get('/data').then(res => res.data),
});
};

๐Ÿš€ Deploymentโ€‹

How do I deploy to production?โ€‹

ABP React supports multiple deployment options:

  1. Vercel: Recommended for Next.js apps
  2. Netlify: Static site deployment
  3. AWS: S3 + CloudFront or EC2
  4. Docker: Containerized deployment
  5. Traditional Hosting: Any Node.js hosting

How do I configure environment variables?โ€‹

Set environment variables for different environments:

# .env.production
NEXTAUTH_URL=https://your-domain.com
NEXTAUTH_SECRET=your-production-secret
NEXT_PUBLIC_API_URL=https://your-api.com

How do I enable HTTPS?โ€‹

For production deployments:

  1. Vercel/Netlify: HTTPS is automatic
  2. Custom Server: Configure SSL certificates
  3. Load Balancer: Handle SSL termination at load balancer
  4. CDN: Use CloudFront or similar CDN

How do I optimize for SEO?โ€‹

ABP React includes SEO optimizations:

// app/layout.tsx
export const metadata = {
title: 'Your App Title',
description: 'Your app description',
openGraph: {
title: 'Your App Title',
description: 'Your app description',
url: 'https://your-domain.com',
siteName: 'Your App',
},
};

// Page-specific metadata
export const metadata = {
title: 'Page Title',
description: 'Page description',
};

๐Ÿงช Testingโ€‹

How do I run tests?โ€‹

ABP React includes comprehensive testing setup:

# Run all tests
pnpm test

# Run tests in watch mode
pnpm test:watch

# Run tests with coverage
pnpm test:coverage

# Run specific test file
pnpm test UserProfile.test.tsx

How do I test components?โ€‹

Use React Testing Library:

import { render, screen } from '@testing-library/react';
import { UserProfile } from './UserProfile';

test('renders user profile', () => {
render(<UserProfile user={mockUser} />);
expect(screen.getByText('John Doe')).toBeInTheDocument();
});

How do I test API calls?โ€‹

Use Mock Service Worker (MSW):

// Setup MSW handlers
export const handlers = [
rest.get('/api/users', (req, res, ctx) => {
return res(ctx.json({ users: mockUsers }));
}),
];

// Test hook
test('fetches users', async () => {
const { result } = renderHook(() => useUsers(), {
wrapper: QueryWrapper,
});

await waitFor(() => {
expect(result.current.data).toEqual(mockUsers);
});
});

๐Ÿ”ง Troubleshootingโ€‹

Common Issuesโ€‹

"Module not found" errorsโ€‹

# Clear Next.js cache
rm -rf .next

# Reinstall dependencies
rm -rf node_modules
pnpm install

TypeScript errors after API changesโ€‹

# Regenerate API client
pnpm generate-client

# Check TypeScript
npx tsc --noEmit

Authentication not workingโ€‹

  1. Check environment variables
  2. Verify API URL accessibility
  3. Check browser network tab for errors
  4. Verify ABP backend configuration

Styles not applyingโ€‹

  1. Check Tailwind CSS configuration
  2. Verify CSS imports
  3. Check for CSS conflicts
  4. Ensure PostCSS configuration is correct

Getting Helpโ€‹

If you can't find the answer to your question:

  1. Search Documentation: Use the search function
  2. GitHub Issues: Check existing issues
  3. GitHub Discussions: Ask the community
  4. Discord: Join our Discord server
  5. Email: Contact the maintainers

๐Ÿ“š Learning Resourcesโ€‹

React Resourcesโ€‹

ABP Framework Resourcesโ€‹

UI/UX Resourcesโ€‹

๐Ÿค Contributingโ€‹

How can I contribute?โ€‹

There are many ways to contribute:

  • Report bugs: Help us identify and fix issues
  • Request features: Suggest new functionality
  • Submit PRs: Fix bugs or add features
  • Improve docs: Help make documentation better
  • Help others: Answer questions in discussions

What skills do I need?โ€‹

  • React/TypeScript: For frontend development
  • Next.js: For framework-specific features
  • ABP Framework: For backend integration
  • Testing: For writing tests
  • Documentation: For improving docs

See our Contributing Guide for detailed information.


๐Ÿ’ก Still have questions?โ€‹

If you don't find the answer you're looking for:

We're here to help you succeed with ABP React! ๐Ÿš€