Skip to content

feat: add environment variable support for site configuration #675

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

caocuong2404
Copy link

Description

This commit enhances the project's configuration flexibility by:

  • Updating .env.example with comprehensive configuration options
  • Modifying site.config.ts to use environment variables as fallback values
  • Updating readme.md with detailed instructions on environment variable configuration

Notion Test Page ID

900c694f30644928866df54ed04406c0

Preview config

blog-cuong-day-Overview-–-Vercel

This commit enhances the project's configuration flexibility by:
- Updating `.env.example` with comprehensive configuration options
- Modifying `site.config.ts` to use environment variables as fallback values
- Updating `readme.md` with detailed instructions on environment variable configuration
Copy link

vercel bot commented Feb 5, 2025

@caocuong2404 is attempting to deploy a commit to the Saasify Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

charliechecks bot commented Mar 18, 2025

Pull Request Review: Add Environment Variable Support for Site Configuration

Thank you for your contribution to enhance the configuration flexibility of the project through environment variables. This is a valuable improvement for deployment flexibility and security.

Overall Assessment

This PR adds environment variable support as an alternative configuration method, which is a good improvement for flexible deployments. It maintains backward compatibility by using environment variables as fallback values, which is the right approach.

Code Changes

.env.example Updates

  • The comprehensive list of configuration options is valuable for users to understand what can be configured.
  • All the necessary configuration options appear to be included.

site.config.ts Modifications

  • Good implementation of using environment variables as fallbacks.
  • The approach preserves backward compatibility while adding new functionality.

Documentation Updates

  • The README updates provide clear instructions on environment variable usage.

Suggestions

  1. Consider adding validation for environment variable values to prevent unexpected behavior when invalid values are provided.
  2. It might be helpful to add comments in the code explaining the priority (config file vs environment variables) and the rationale.
  3. Consider adding a section in the documentation about which environment variables are required vs optional.

Testing Considerations

Have you tested the following scenarios?

  • Deployment with only environment variables (no config file)
  • Deployment with mixed settings (some from config file, some from environment)
  • Behavior when invalid values are provided in environment variables

Conclusion

This is a solid enhancement that improves deployment flexibility. With the minor suggestions above, this PR is ready to be merged. Great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants