.env.example138 lines, 5.1 KB
| 1 | # NotesVerb Environment Configuration Example |
| 2 | # Copy this file to .env and update the values for your environment |
| 3 | |
| 4 | # ============================================================================= |
| 5 | # GLOBAL CONFIGURATION |
| 6 | # ============================================================================= |
| 7 | |
| 8 | # Environment |
| 9 | NODE_ENV=development |
| 10 | |
| 11 | # Database Configuration (PostgreSQL) |
| 12 | POSTGRES_USER=notesverb |
| 13 | POSTGRES_PASSWORD=your_secure_password_here |
| 14 | POSTGRES_DB=notesverb |
| 15 | POSTGRES_HOST=localhost |
| 16 | POSTGRES_PORT=5432 |
| 17 | |
| 18 | # ============================================================================= |
| 19 | # API GATEWAY CONFIGURATION |
| 20 | # ============================================================================= |
| 21 | |
| 22 | # API Gateway Server |
| 23 | API_GATEWAY_PORT=8080 |
| 24 | |
| 25 | # JWT Configuration (for token validation) |
| 26 | JWT_SECRET=your-super-secret-jwt-key-change-this-in-production |
| 27 | JWT_REFRESH_SECRET=your-super-secret-refresh-key-change-this-in-production |
| 28 | JWT_EXPIRES_IN=15m |
| 29 | JWT_REFRESH_EXPIRES_IN=7d |
| 30 | |
| 31 | # Service URLs |
| 32 | AUTH_SERVICE_URL=http://localhost:3001 |
| 33 | USER_SERVICE_URL=http://localhost:3002 |
| 34 | NOTES_SERVICE_URL=http://localhost:3003 |
| 35 | TAGS_SERVICE_URL=http://localhost:3004 |
| 36 | |
| 37 | # CORS Configuration |
| 38 | CORS_ORIGIN=http://localhost:3000 |
| 39 | CORS_CREDENTIALS=true |
| 40 | |
| 41 | # Logging |
| 42 | LOG_LEVEL=info |
| 43 | |
| 44 | # Health Check |
| 45 | HEALTH_CHECK_INTERVAL=30000 |
| 46 | HEALTH_CHECK_TIMEOUT=5000 |
| 47 | |
| 48 | # ============================================================================= |
| 49 | # MICROSERVICES CONFIGURATION |
| 50 | # ============================================================================= |
| 51 | |
| 52 | # Auth Service |
| 53 | AUTH_SERVICE_PORT=3001 |
| 54 | AUTH_DATABASE_URL=postgresql://notesverb:your_secure_password_here@localhost:5432/notesverb_auth |
| 55 | |
| 56 | # User Service |
| 57 | USER_SERVICE_PORT=3002 |
| 58 | USER_DATABASE_URL=postgresql://notesverb:your_secure_password_here@localhost:5432/notesverb_users |
| 59 | |
| 60 | # Notes Service |
| 61 | NOTES_SERVICE_PORT=3003 |
| 62 | NOTES_DATABASE_URL=postgresql://notesverb:your_secure_password_here@localhost:5432/notesverb_notes |
| 63 | |
| 64 | # Tags Service |
| 65 | TAGS_SERVICE_PORT=3004 |
| 66 | TAGS_DATABASE_URL=postgresql://notesverb:your_secure_password_here@localhost:5432/notesverb_tags |
| 67 | |
| 68 | # ============================================================================= |
| 69 | # SECURITY CONFIGURATION |
| 70 | # ============================================================================= |
| 71 | |
| 72 | # Bcrypt rounds for password hashing |
| 73 | BCRYPT_ROUNDS=12 |
| 74 | |
| 75 | # Rate limiting |
| 76 | RATE_LIMIT_WINDOW_MS=900000 |
| 77 | RATE_LIMIT_MAX_REQUESTS=100 |
| 78 | |
| 79 | # ============================================================================= |
| 80 | # DEVELOPMENT CONFIGURATION |
| 81 | # ============================================================================= |
| 82 | |
| 83 | # Development database URLs (for local development) |
| 84 | DEV_AUTH_DATABASE_URL=postgresql://notesverb:notesverb123@localhost:5432/notesverb_auth |
| 85 | DEV_USER_DATABASE_URL=postgresql://notesverb:notesverb123@localhost:5432/notesverb_users |
| 86 | DEV_NOTES_DATABASE_URL=postgresql://notesverb:notesverb123@localhost:5432/notesverb_notes |
| 87 | DEV_TAGS_DATABASE_URL=postgresql://notesverb:notesverb123@localhost:5432/notesverb_tags |
| 88 | |
| 89 | # ============================================================================= |
| 90 | # PRODUCTION CONFIGURATION (Examples) |
| 91 | # ============================================================================= |
| 92 | |
| 93 | # Production JWT secrets (generate strong secrets for production) |
| 94 | # PROD_JWT_SECRET=your-production-jwt-secret-256-bits-minimum |
| 95 | # PROD_JWT_REFRESH_SECRET=your-production-refresh-secret-256-bits-minimum |
| 96 | |
| 97 | # Production database URLs (use environment-specific values) |
| 98 | # PROD_AUTH_DATABASE_URL=postgresql://username:password@host:port/database |
| 99 | # PROD_USER_DATABASE_URL=postgresql://username:password@host:port/database |
| 100 | # PROD_NOTES_DATABASE_URL=postgresql://username:password@host:port/database |
| 101 | # PROD_TAGS_DATABASE_URL=postgresql://username:password@host:port/database |
| 102 | |
| 103 | # Production CORS (restrict to your frontend domain) |
| 104 | # PROD_CORS_ORIGIN=https://your-frontend-domain.com |
| 105 | |
| 106 | # ============================================================================= |
| 107 | # DOCKER CONFIGURATION |
| 108 | # ============================================================================= |
| 109 | |
| 110 | # Docker Compose overrides |
| 111 | COMPOSE_PROJECT_NAME=notesverb |
| 112 | COMPOSE_FILE=docker-compose.yml |
| 113 | |
| 114 | # ============================================================================= |
| 115 | # MONITORING & LOGGING (Optional) |
| 116 | # ============================================================================= |
| 117 | |
| 118 | # Application monitoring |
| 119 | # SENTRY_DSN=your-sentry-dsn-here |
| 120 | # NEW_RELIC_LICENSE_KEY=your-new-relic-key-here |
| 121 | |
| 122 | # Log aggregation |
| 123 | # LOGSTASH_HOST=localhost |
| 124 | # LOGSTASH_PORT=5044 |
| 125 | |
| 126 | # ============================================================================= |
| 127 | # TESTING CONFIGURATION |
| 128 | # ============================================================================= |
| 129 | |
| 130 | # Test database URLs |
| 131 | TEST_AUTH_DATABASE_URL=postgresql://notesverb:notesverb123@localhost:5432/notesverb_auth_test |
| 132 | TEST_USER_DATABASE_URL=postgresql://notesverb:notesverb123@localhost:5432/notesverb_users_test |
| 133 | TEST_NOTES_DATABASE_URL=postgresql://notesverb:notesverb123@localhost:5432/notesverb_notes_test |
| 134 | TEST_TAGS_DATABASE_URL=postgresql://notesverb:notesverb123@localhost:5432/notesverb_tags_test |
| 135 | |
| 136 | # Test JWT secrets (use different secrets for testing) |
| 137 | TEST_JWT_SECRET=test-jwt-secret-key-for-testing-only |
| 138 | TEST_JWT_REFRESH_SECRET=test-jwt-refresh-secret-key-for-testing-only |