Skip to main content
Scira offers extensive configuration options to customize the application for your specific requirements. This guide covers application settings, database configuration, search providers, and user preferences.

Application Settings

Next.js Configuration

The main application configuration is in next.config.ts:

Key Configuration Options

object
Removes console statements in production builds (except errors)
boolean
Enables the React compiler for optimized builds
string
Maximum size for server action payloads (set to 20MB for file uploads)
array
Packages to optimize for faster imports and smaller bundle sizes

Security Headers

Scira configures security headers automatically:

Image Configuration

Next.js image optimization is configured for external sources:

Database Configuration

Scira uses Drizzle ORM with PostgreSQL. The configuration is in drizzle.config.ts:

Database Schema

string
Path to the database schema file (./lib/db/schema.ts)
string
Directory for generated migrations (./drizzle/migrations)
string
Database dialect - PostgreSQL
string
Database connection URL from DATABASE_URL environment variable

Connection Pooling

For production, configure connection pooling in your database URL:

Search Provider Preferences

Scira supports multiple search providers. Users can configure their preferred providers through user preferences.

Available Search Providers

Exa

AI-powered search with semantic understanding

Parallel

High-performance parallel web and Reddit search

Tavily

Web search optimized for AI applications

Firecrawl

Web scraping with structured data extraction

Provider Configuration

Set your search provider API keys in environment variables:

Custom Instructions

Users can configure custom instructions to personalize AI responses. Custom instructions are stored per user in the database.

Custom Instructions Schema

From lib/db/schema.ts:

Using Custom Instructions

Custom instructions allow users to:
  • Define preferred response formats
  • Set domain-specific context
  • Configure tone and style preferences
  • Add recurring research requirements

User Preferences Structure

User preferences are stored in the user_preferences table with a flexible JSON structure.

Preferences Schema

From lib/db/schema.ts:

Available Preferences

enum
Preferred search provider: exa, parallel, tavily, or firecrawl
enum
Provider for extreme/deep search: exa or parallel
array
Custom ordering for search mode groups
array
Preferred ordering for AI models
boolean
Whether to blur personal information in the UI
boolean
Enable/disable custom instructions for AI responses
boolean
Enable/disable location metadata in searches

Rate Limiting

Scira uses Upstash Redis for rate limiting:
number
Maximum number of requests (100)
number
Time window in seconds (60)

CORS and Trusted Origins

Configure allowed origins for authentication:
Update trustedOrigins and allowedOrigins to include your production domain when deploying.

Environment-Specific Configuration

Scira uses environment-specific configuration through env/server.ts and env/client.ts:
This ensures:
  • Server-only environment variables remain secure
  • Client variables are properly exposed with NEXT_PUBLIC_ prefix
  • Type-safe environment variable access
  • Validation at build time

Performance Optimization

Turbopack Configuration

Package Transpilation

External Server Packages

Next Steps