auto-claude: subtask-1-5 - Add Environment Variables section with detailed ex
This commit is contained in:
@@ -85,6 +85,56 @@ src/
|
|||||||
└── App.tsx # Root component
|
└── App.tsx # Root component
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Environment Variables
|
||||||
|
|
||||||
|
The application requires several environment variables to function correctly. Create a `.env` file in the root directory based on `.env.example`:
|
||||||
|
|
||||||
|
### Required Variables
|
||||||
|
|
||||||
|
#### `NEXT_PUBLIC_SUPABASE_URL`
|
||||||
|
- **Purpose:** Base URL for your Supabase project
|
||||||
|
- **Format:** `https://your-project-id.supabase.co`
|
||||||
|
- **How to get:** Navigate to your [Supabase project settings](https://app.supabase.com) → Settings → API → Project URL
|
||||||
|
- **Example:** `https://mxadgucxhmstlzsbgmoz.supabase.co`
|
||||||
|
|
||||||
|
#### `NEXT_PUBLIC_SUPABASE_ANON_KEY`
|
||||||
|
- **Purpose:** Anonymous/public key for client-side Supabase authentication
|
||||||
|
- **Format:** Long alphanumeric string (JWT token)
|
||||||
|
- **How to get:** Navigate to your [Supabase project settings](https://app.supabase.com) → Settings → API → Project API keys → `anon` `public`
|
||||||
|
- **Security:** Safe to use in client-side code (public key)
|
||||||
|
|
||||||
|
#### `NEXT_PUBLIC_GA_TRACKING_ID`
|
||||||
|
- **Purpose:** Google Analytics 4 tracking ID for analytics
|
||||||
|
- **Format:** `G-XXXXXXXXXX`
|
||||||
|
- **How to get:** Create a GA4 property in [Google Analytics](https://analytics.google.com) → Admin → Data Streams → Web → Measurement ID
|
||||||
|
- **Optional:** Can be omitted if you don't want analytics tracking
|
||||||
|
|
||||||
|
#### `NEXT_PUBLIC_SITE_URL`
|
||||||
|
- **Purpose:** The public URL where your site is hosted (used for SEO, canonical URLs, and sitemap generation)
|
||||||
|
- **Format:** `https://your-domain.com` (no trailing slash)
|
||||||
|
- **Examples:**
|
||||||
|
- Production: `https://damjan-savic.com`
|
||||||
|
- Development: `http://localhost:3000`
|
||||||
|
- **Note:** Update this when deploying to production
|
||||||
|
|
||||||
|
### Setup Instructions
|
||||||
|
|
||||||
|
1. Copy the example environment file:
|
||||||
|
```bash
|
||||||
|
cp .env.example .env
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Fill in your actual values in the `.env` file
|
||||||
|
|
||||||
|
3. Restart your development server after changing environment variables
|
||||||
|
|
||||||
|
### Important Notes
|
||||||
|
|
||||||
|
- All variables prefixed with `NEXT_PUBLIC_` are exposed to the browser
|
||||||
|
- Never commit your `.env` file to version control (it's in `.gitignore`)
|
||||||
|
- For production deployment, set these variables in your hosting platform's environment settings
|
||||||
|
- The `.env.example` file shows the required format and should be kept updated
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
Reference in New Issue
Block a user