Application Settings
Next.js Configuration
The main application configuration is innext.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 indrizzle.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 variableConnection 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
Fromlib/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 theuser_preferences table with a flexible JSON structure.
Preferences Schema
Fromlib/db/schema.ts:
Available Preferences
enum
Preferred search provider:
exa, parallel, tavily, or firecrawlenum
Provider for extreme/deep search:
exa or parallelarray
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:Environment-Specific Configuration
Scira uses environment-specific configuration throughenv/server.ts and env/client.ts:
- Server-only environment variables remain secure
- Client variables are properly exposed with
NEXT_PUBLIC_prefix - Type-safe environment variable access
- Validation at build time
