-
Notifications
You must be signed in to change notification settings - Fork 205
docs: add environment variable documentation and .env.example file #682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| PORT=5000 | ||
|
|
||
| MONGO_URI=your_mongodb_connection_string | ||
|
|
||
| SESSION_SECRET=your_session_secret | ||
|
|
||
| NODE_ENV=development | ||
|
|
||
| LOG_LEVEL=debug | ||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -80,6 +80,27 @@ Install all required dependencies: | |||||||
| npm install | ||||||||
| npm install --save-dev jasmine @types/jasmine supertest express-session passport passport-local bcryptjs | ||||||||
| ``` | ||||||||
| ## Environment Variables | ||||||||
|
|
||||||||
| Create a `.env` file in the project root and add the following variables: | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win Reference the The instruction should mention copying the 📝 Proposed improvement-Create a `.env` file in the project root and add the following variables:
+Create a `.env` file in the project root by copying `.env.example` and configure the following variables:
+
+```bash
+cp .env.example .env
+```📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||
|
|
||||||||
| | Variable | Description | | ||||||||
| |----------|-------------| | ||||||||
| | PORT | Port on which the backend server runs | | ||||||||
| | MONGO_URI | MongoDB connection string | | ||||||||
| | SESSION_SECRET | Secret key used for session management | | ||||||||
| | NODE_ENV | Application environment | | ||||||||
| | LOG_LEVEL | Logging level | | ||||||||
|
Comment on lines
+87
to
+93
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win Enhance variable descriptions with more helpful details. The descriptions are quite brief and lack important details that would help contributors configure the application correctly. Consider adding:
📋 Proposed improvement | Variable | Description |
|----------|-------------|
-| PORT | Port on which the backend server runs |
-| MONGO_URI | MongoDB connection string |
-| SESSION_SECRET | Secret key used for session management |
-| NODE_ENV | Application environment |
-| LOG_LEVEL | Logging level |
+| PORT | Port on which the backend server runs (default: 5000) |
+| MONGO_URI | MongoDB connection string (e.g., `mongodb://localhost:27017/github_tracker`) |
+| SESSION_SECRET | Secret key for session management (min 32 characters, use a randomly generated string) |
+| NODE_ENV | Application environment (`development`, `production`, or `test`) |
+| LOG_LEVEL | Logging verbosity level (`error`, `warn`, `info`, `debug`) |🤖 Prompt for AI Agents |
||||||||
|
|
||||||||
| ### Example | ||||||||
|
|
||||||||
| ```env | ||||||||
| PORT=5000 | ||||||||
| MONGO_URI=your_mongodb_connection_string | ||||||||
| SESSION_SECRET=your_session_secret | ||||||||
| NODE_ENV=development | ||||||||
| LOG_LEVEL=debug | ||||||||
| ``` | ||||||||
|
|
||||||||
| ### Running the Tests | ||||||||
| 1. **Start MongoDB** (if not already running): | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enhance SESSION_SECRET placeholder to emphasize security requirements.
The current placeholder doesn't convey the security importance of using a strong, random value. Consider using a more descriptive placeholder that indicates the required characteristics (e.g., length, randomness).
🔒 Proposed improvement for SESSION_SECRET guidance
Additionally, consider adding a comment above this line:
+# Generate a secure random string (min 32 characters). Example: openssl rand -base64 32 SESSION_SECRET=your_random_session_secret_min_32_characters🤖 Prompt for AI Agents