-
Notifications
You must be signed in to change notification settings - Fork 50
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
Multi environment support #10
base: main
Are you sure you want to change the base?
Multi environment support #10
Conversation
Reviewer's Guide by SourceryThis pull request implements multi-environment support by updating the configuration service, adding development and production scripts, and improving error handling for environment variables. It also includes updates to the README and some minor refactoring. File-Level Changes
Tips
|
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.
Hey @hassancodess - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟡 Documentation: 1 issue found
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
dotenv.config(); | ||
dotenvx.config(); | ||
|
||
const prettyPrintErrors = (errObj: ZodError) => { |
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.
suggestion: Consider making prettyPrintErrors more flexible
Instead of logging directly to the console, consider having the function return a formatted string. This would make it more reusable in different contexts, allowing the caller to decide how to handle the output.
const prettyPrintErrors = (errObj: ZodError): string => {
let output = '';
const formattedError = errObj.format();
Object.entries(formattedError).forEach(([key, value]) => {
if (value && '_errors' in value) {
output += `${key}: ${value._errors.join(', ')}\n`;
}
});
return output.trim();
};
- Create a `.env` file in the root directory. | ||
- Use the provided `.env.sample` as a template to enter all the required environment variables. | ||
- Create `.env.development` and `.env.production` files in the root directory. | ||
- Use the provided `.env.sample` as a template to set up the environment variables in these files. | ||
|
||
## What's Included |
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.
suggestion (documentation): Consider explaining the reason for separate development and production environment files.
While separating environments is a good practice, a brief explanation of why you're using two files now might help users understand the change better.
- Create a `.env` file in the root directory. | |
- Use the provided `.env.sample` as a template to enter all the required environment variables. | |
- Create `.env.development` and `.env.production` files in the root directory. | |
- Use the provided `.env.sample` as a template to set up the environment variables in these files. | |
## What's Included | |
- Create `.env.development` and `.env.production` files in the root directory: | |
- `.env.development` for local development settings | |
- `.env.production` for production environment settings | |
- This separation allows for different configurations based on the environment | |
- Use the provided `.env.sample` as a template to set up the environment variables in these files |
This PR includes the following updates:
Summary by Sourcery
Add support for multiple environments by introducing separate development and production configurations. Enhance environment variable management with improved error handling and update documentation to guide users in setting up environment files. Refactor import paths in the upload controller to reflect the new module structure.
New Features:
Enhancements:
Documentation:
Chores: