Configuration Reference
To run Blogify locally or deploy it to production, you must configure environment variables for both the frontend (Next.js) and the backend (FastAPI). This ensures that the application can communicate with Supabase for authentication and storage, and that the frontend can correctly route requests to your API.
Frontend Configuration
The frontend requires environment variables to initialize the Supabase client and point to the backend API. Create a .env.local file in the frontend/ directory.
Environment Variables (frontend/.env.local)
| Variable | Description | Example Value |
| :--- | :--- | :--- |
| NEXT_PUBLIC_SUPABASE_URL | Your Supabase project URL. | https://xyz.supabase.co |
| NEXT_PUBLIC_SUPABASE_ANON_KEY | The "anon" public key found in your Supabase project settings. | eyJhbGciOiJIUzI1... |
| NEXT_PUBLIC_API_URL | The base URL where your FastAPI backend is running. | http://127.0.0.1:8000 |
[!IMPORTANT] Variables prefixed with
NEXT_PUBLIC_are exposed to the browser. Do not place sensitive secrets or service-role keys in these variables.
Backend Configuration
The backend requires secrets to verify authentication tokens and interact with the PostgreSQL database. Create a .env file in the backend/ directory.
Environment Variables (backend/.env)
| Variable | Description | Example Value |
| :--- | :--- | :--- |
| SUPABASE_URL | Your Supabase project URL. | https://xyz.supabase.co |
| SUPABASE_KEY | The Service Role key used for administrative database access. | eyJhbGciOiJIUzI1... |
| JWT_SECRET | The JWT Secret found in your Supabase Auth settings (used by PyJWT to verify sessions). | your-super-secret-jwt-string |
| ALLOW_ORIGINS | A comma-separated list of allowed frontend origins for CORS. | http://localhost:3000,https://blogify.vercel.app |
Supabase Setup Requirements
Beyond environment variables, Blogify relies on specific Supabase configurations to function correctly:
1. Authentication
- Provider: Email/Password must be enabled in the Supabase Dashboard.
- Site URL: Ensure the Site URL in Supabase Auth settings matches your frontend URL (e.g.,
http://localhost:3000).
2. Storage Buckets
The application expects two public buckets to be created in Supabase Storage:
images: Used for blog post header images and inline content images.avatars: Used for user profile pictures.
3. Database Schema
The FastAPI backend interacts with the following tables in the public schema:
users: Stores user profiles (linked toauth.users).posts: Stores blog content, includingtitle,content(Markdown),tags(Array), andimage_url.
Local Development Example
For a standard local setup, your configurations would typically look like this:
frontend/.env.local
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
NEXT_PUBLIC_API_URL=http://127.0.0.1:8000
backend/.env
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-service-role-key
JWT_SECRET=your-supabase-jwt-secret
ALLOW_ORIGINS=http://localhost:3000