Skip to main content

Environment Variables

EpiNeko requires specific environment variables to function properly. All configuration is stored in .env.local at the root of your project.
Never commit your .env.local file to version control. It should already be included in .gitignore.

Required Variables

1

Get Supabase URL

  1. Go to app.supabase.com
  2. Select your project
  3. Navigate to Settings > API
  4. Copy the “Project URL”
2

Get Anon Key

  1. In the same API settings page
  2. Copy the “anon public” key
  3. This key is safe to use in the browser
3

Create .env.local

Create the file in your project root and paste both values
4

Restart Development Server

Changes to environment variables require a server restart
The NEXT_PUBLIC_ prefix makes these variables available to the browser. This is required for client-side Supabase operations.

Optional Variables

Add these for enhanced functionality:
.env.local

Next.js Configuration

The next.config.ts file controls Next.js behavior and optimization settings.

Current Configuration

Image Optimization

EpiNeko loads anime images from MyAnimeList CDN. The configuration allows Next.js Image component to optimize these external images:
Next.js requires explicit configuration for external image domains to prevent abuse and ensure security. Without this configuration, images from MyAnimeList won’t load.

Adding Additional Image Sources

If you want to allow images from other sources:
next.config.ts

Other Useful Next.js Options

Enable strict TypeScript checking:
Enable React strict mode for development:
Configure URL redirects:
Make server-side env vars available:

Supabase Configuration

Client Configuration

The Supabase clients are configured in the utility files with error handling:

Advanced Supabase Options

Customize the Supabase client with additional options:

Database Configuration

Row Level Security (RLS)

EpiNeko uses RLS to protect user data. The policies are configured in the migration file:
RLS policies are enforced at the database level, providing an additional security layer beyond application logic.

Database Indexes

For better performance, consider adding indexes:

Styling Configuration

Tailwind CSS

EpiNeko uses Tailwind CSS v4 with custom configuration. The configuration is minimal by design:
tailwind.config.ts

DaisyUI Configuration

DaisyUI provides pre-built components. Configure themes in tailwind.config.ts:

TypeScript Configuration

EpiNeko uses TypeScript with strict mode enabled:
tsconfig.json
The @/* path alias allows you to import from src/ using @/ instead of relative paths.

Middleware Configuration

The middleware configuration controls which routes are protected:
src/middleware.ts

Customizing Protected Routes

To add route-specific logic:
src/middleware.ts

Production Configuration

Environment Variables for Production

When deploying, ensure these variables are set:
Production .env

Build Optimization

Optimize your production build:
next.config.ts

Vercel Deployment

EpiNeko is optimized for Vercel deployment:
1

Connect Repository

Import your Git repository in Vercel dashboard
2

Configure Environment Variables

Add your Supabase credentials in the Vercel project settings
3

Deploy

Vercel automatically detects Next.js and deploys
Vercel automatically sets NODE_ENV=production and enables optimizations.

Troubleshooting

Solution:
  1. Ensure .env.local is in the project root
  2. Restart the development server
  3. Check for typos in variable names
  4. Verify the NEXT_PUBLIC_ prefix for client-side variables
Solution:
  1. Verify next.config.ts includes the CDN hostname
  2. Check that the hostname matches exactly (no trailing slash)
  3. Restart the dev server after config changes
Solution:
  1. Verify Supabase project is active
  2. Check API keys are correct
  3. Ensure RLS policies are properly configured
  4. Check Supabase service status
Solution:
  1. Run npm install to ensure all types are installed
  2. Delete .next folder and rebuild
  3. Check tsconfig.json paths configuration