.env.example84 lines, 3.6 KB
| 1 | # Auth Service Environment Configuration |
| 2 | |
| 3 | # ============================================================================= |
| 4 | # DATABASE CONFIGURATION |
| 5 | # ============================================================================= |
| 6 | # PostgreSQL connection string for auth service |
| 7 | DATABASE_URL=postgresql://notesverb:your_secure_password_here@localhost:5432/notesverb_auth |
| 8 | |
| 9 | # ============================================================================= |
| 10 | # SERVER CONFIGURATION |
| 11 | # ============================================================================= |
| 12 | PORT=3001 |
| 13 | NODE_ENV=development |
| 14 | |
| 15 | # ============================================================================= |
| 16 | # JWT CONFIGURATION |
| 17 | # ============================================================================= |
| 18 | # IMPORTANT: Change these secrets in production! |
| 19 | # Generate strong, random secrets (minimum 256 bits) |
| 20 | # You can use: openssl rand -base64 32 |
| 21 | JWT_SECRET=your-super-secret-jwt-key-change-this-in-production |
| 22 | JWT_REFRESH_SECRET=your-super-secret-refresh-key-change-this-in-production |
| 23 | |
| 24 | # Token expiration times |
| 25 | JWT_EXPIRES_IN=15m |
| 26 | JWT_REFRESH_EXPIRES_IN=7d |
| 27 | |
| 28 | # ============================================================================= |
| 29 | # CORS CONFIGURATION |
| 30 | # ============================================================================= |
| 31 | # Frontend application URL |
| 32 | CORS_ORIGIN=http://localhost:3000 |
| 33 | CORS_CREDENTIALS=true |
| 34 | |
| 35 | # ============================================================================= |
| 36 | # SECURITY CONFIGURATION |
| 37 | # ============================================================================= |
| 38 | # Bcrypt rounds for password hashing (10-12 recommended for production) |
| 39 | BCRYPT_ROUNDS=10 |
| 40 | |
| 41 | # ============================================================================= |
| 42 | # PRODUCTION EXAMPLES (uncomment and modify for production) |
| 43 | # ============================================================================= |
| 44 | |
| 45 | # Production database URL |
| 46 | # DATABASE_URL=postgresql://username:password@host:port/database_name |
| 47 | |
| 48 | # Production JWT secrets (generate strong secrets) |
| 49 | # JWT_SECRET=your-production-jwt-secret-256-bits-minimum |
| 50 | # JWT_REFRESH_SECRET=your-production-refresh-secret-256-bits-minimum |
| 51 | |
| 52 | # Production CORS (restrict to your frontend domain) |
| 53 | # CORS_ORIGIN=https://your-frontend-domain.com |
| 54 | |
| 55 | # Production security settings |
| 56 | # BCRYPT_ROUNDS=12 |
| 57 | # JWT_EXPIRES_IN=5m |
| 58 | # JWT_REFRESH_EXPIRES_IN=1d |
| 59 | |
| 60 | # ============================================================================= |
| 61 | # DEVELOPMENT CONFIGURATION |
| 62 | # ============================================================================= |
| 63 | # Development database (for local development with Docker) |
| 64 | # DATABASE_URL=postgresql://notesverb:notesverb123@localhost:5432/notesverb_auth |
| 65 | |
| 66 | # ============================================================================= |
| 67 | # TESTING CONFIGURATION |
| 68 | # ============================================================================= |
| 69 | # Test database URL (for running tests) |
| 70 | # TEST_DATABASE_URL=postgresql://notesverb:notesverb123@localhost:5432/notesverb_auth_test |
| 71 | |
| 72 | # Test JWT secrets (use different secrets for testing) |
| 73 | # TEST_JWT_SECRET=test-jwt-secret-key-for-testing-only |
| 74 | # TEST_JWT_REFRESH_SECRET=test-jwt-refresh-secret-key-for-testing-only |
| 75 | |
| 76 | # ============================================================================= |
| 77 | # DEVELOPMENT NOTES |
| 78 | # ============================================================================= |
| 79 | # 1. Copy this file to .env and update the values |
| 80 | # 2. Never commit .env files to version control |
| 81 | # 3. Use strong, unique secrets in production |
| 82 | # 4. Ensure JWT_SECRET matches across all services that validate tokens |
| 83 | # 5. Use environment-specific database URLs |
| 84 | # 6. Consider using a secrets management service in production |