Skip to content

Commit 80c4091

Browse files
committed
Setup environment configuration
1 parent f1f0c38 commit 80c4091

6 files changed

Lines changed: 172 additions & 23 deletions

File tree

.gitignore

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
11

22
# Ignore node_modules directory
3-
node_modules/
4-
architecture.md
5-
tasks.md
3+
node_modules/
4+
5+
# Environment files
6+
.env
7+
.env.local
8+
.env.production
9+
.env.development
10+
backend/.env
11+
frontend/.env.local
12+
13+
# Logs
14+
*.log
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*
18+
19+
# Runtime data
20+
pids
21+
*.pid
22+
*.seed
23+
*.pid.lock
24+
25+
# Python
26+
__pycache__/
27+
*.py[cod]
28+
*$py.class
29+
*.so
30+
.Python
31+
env/
32+
venv/
33+
ENV/
34+
env.bak/
35+
venv.bak/
36+
37+
# IDE
38+
.vscode/
39+
.idea/
40+
*.swp
41+
*.swo
42+
*~
43+
44+
# OS
45+
.DS_Store
46+
Thumbs.db
47+
48+
# Turbo
49+
.turbo/

.turbo/daemon/2a80c2cbd4c87b99-turbo.log.2025-07-08

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/ENVIRONMENT_SETUP.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Environment Setup Guide
2+
3+
This document describes the environment variables needed for both frontend and backend components.
4+
5+
## Frontend Environment Variables
6+
7+
Create a file `frontend/.env.local` with the following contents:
8+
9+
```bash
10+
# Backend API URL - where the FastAPI server is running
11+
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
12+
13+
# Authentication (will be added in auth tasks)
14+
# NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
15+
# NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
16+
```
17+
18+
## Backend Environment Variables
19+
20+
Create a file `backend/.env` with the following contents:
21+
22+
```bash
23+
# Server Configuration
24+
PORT=8000
25+
FRONTEND_URL=http://localhost:3000
26+
27+
# Database Configuration (will be added in Task B2)
28+
# DATABASE_URL=postgresql://user:password@localhost:5432/smartquery
29+
# REDIS_URL=redis://localhost:6379
30+
31+
# Storage Configuration (will be added in Task B2)
32+
# MINIO_ENDPOINT=localhost:9000
33+
# MINIO_ACCESS_KEY=your_access_key
34+
# MINIO_SECRET_KEY=your_secret_key
35+
# MINIO_BUCKET_NAME=smartquery-files
36+
37+
# AI/LLM Configuration (will be added later)
38+
# OPENAI_API_KEY=your_openai_api_key
39+
# LANGCHAIN_API_KEY=your_langchain_api_key
40+
41+
# Celery Configuration (will be added in Task B2)
42+
# CELERY_BROKER_URL=redis://localhost:6379
43+
# CELERY_RESULT_BACKEND=redis://localhost:6379
44+
```
45+
46+
## Setup Instructions
47+
48+
1. **Frontend Setup:**
49+
```bash
50+
cd frontend
51+
cp .env.example .env.local # or create .env.local manually
52+
# Edit .env.local with your values
53+
```
54+
55+
2. **Backend Setup:**
56+
```bash
57+
cd backend
58+
cp .env.example .env # or create .env manually
59+
# Edit .env with your values
60+
```
61+
62+
## Testing Environment Variables
63+
64+
To test that environment variables are loading correctly:
65+
66+
### Frontend
67+
- Start the development server: `npm run dev`
68+
- The app should be able to make requests to `http://localhost:8000`
69+
70+
### Backend
71+
- Start the FastAPI server: `python main.py`
72+
- The server should start on port 8000 and accept requests from `http://localhost:3000`
73+
74+
## Environment Variable Validation
75+
76+
The applications will validate that required environment variables are set on startup and provide clear error messages if any are missing.

frontend/.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ yarn-error.log*
3131
.pnpm-debug.log*
3232

3333
# env files (can opt-in for committing if needed)
34-
.env*
34+
.env
35+
.env.local
36+
.env.production
37+
.env.development
38+
# Allow .env.example files to be committed
39+
!.env.example
3540

3641
# vercel
3742
.vercel

frontend/postcss.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
const config = {
2-
plugins: ["@tailwindcss/postcss"],
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
36
};
47

58
export default config;

shared/env.example

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Shared Environment Configuration Template
2+
# Copy this to frontend/.env.local and backend/.env and fill in your values
3+
4+
# ===========================================
5+
# FRONTEND ENVIRONMENT VARIABLES
6+
# ===========================================
7+
8+
# Backend API URL
9+
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
10+
11+
# Authentication (will be added in auth tasks)
12+
# NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
13+
# NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
14+
15+
# ===========================================
16+
# BACKEND ENVIRONMENT VARIABLES
17+
# ===========================================
18+
19+
# Server Configuration
20+
PORT=8000
21+
FRONTEND_URL=http://localhost:3000
22+
23+
# Database Configuration (will be added in Task B2)
24+
# DATABASE_URL=postgresql://user:password@localhost:5432/smartquery
25+
# REDIS_URL=redis://localhost:6379
26+
27+
# Storage Configuration (will be added in Task B2)
28+
# MINIO_ENDPOINT=localhost:9000
29+
# MINIO_ACCESS_KEY=your_access_key
30+
# MINIO_SECRET_KEY=your_secret_key
31+
# MINIO_BUCKET_NAME=smartquery-files
32+
33+
# AI/LLM Configuration (will be added later)
34+
# OPENAI_API_KEY=your_openai_api_key
35+
# LANGCHAIN_API_KEY=your_langchain_api_key
36+
37+
# Celery Configuration (will be added in Task B2)
38+
# CELERY_BROKER_URL=redis://localhost:6379
39+
# CELERY_RESULT_BACKEND=redis://localhost:6379

0 commit comments

Comments
 (0)