Configuration

Environment Variables

All configuration is done through environment variables. Copy .env.local.example to .env.local and customize as needed.

Quick Setup

cp .env.local.example .env.local

The example file includes sensible defaults for local development. You only need to update a few values for production.

All Variables

MONGODB_URIRequired

MongoDB connection string for your database.

Default: mongodb://localhost:27017/scanlation
NEXT_PUBLIC_SITE_URLRequired

The public URL of your site. Used for generating links and SEO.

Default: http://localhost:3000
NEXT_PUBLIC_SITE_NAMEOptional

The name of your scanlation group/site. Shown in the header and titles.

Default: Scanlation
S3_ENDPOINTOptional

S3-compatible storage endpoint. Use MinIO for local development.

Default: http://localhost:9000
S3_BUCKETOptional

The S3 bucket name for storing manga images.

Default: scanlation
S3_ACCESS_KEYOptional

Access key for S3 authentication.

Default: minioadmin
S3_SECRET_KEYOptional

Secret key for S3 authentication.

Default: minioadmin
NEXTAUTH_SECRETRequired

Secret for NextAuth.js session encryption. Generate with `openssl rand -base64 32`.

Default: (generate a random string)
NEXTAUTH_URLOptional

The canonical URL for authentication. Usually same as SITE_URL.

Default: http://localhost:3000
DISCORD_CLIENT_IDOptional

Discord OAuth client ID for social login.

Default:
DISCORD_CLIENT_SECRETOptional

Discord OAuth client secret.

Default:

Production Checklist

Important: Before deploying to production, make sure to update these critical settings.

  • Generate a strong NEXTAUTH_SECRET
  • Set NEXT_PUBLIC_SITE_URL to your domain
  • Use a production MongoDB instance
  • Configure real S3 or cloud storage
  • Set up SSL/HTTPS

Generate NEXTAUTH_SECRET

Use this command to generate a secure random secret:

openssl rand -base64 32

On Windows, you can use node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"