Skip to content
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

Add a guide to setup .env files for templates that need them. #74

Open
2 tasks
Ashrockzzz2003 opened this issue Jan 6, 2025 · 5 comments
Open
2 tasks
Labels
AMWOC BOUNTY-30 enhancement New feature or request feature Planned feature of software.

Comments

@Ashrockzzz2003
Copy link
Member

Right now templates such as Microsoft OAuth one needs env. After initializing template with qse init, it doesn't work out of the box and needs env vars to be setup. So to templates that have a necessity for env vars, need some guide that gets printed to the console after initializing the template indicating it.

  • Propose a way to do this. Console is just one among many. A generic approach is appreciated.
  • After the proposal is approved, implement it.

You can reply to this issue with the proposal. If >1 people respond, the best will be chosen!

@Ashrockzzz2003 Ashrockzzz2003 added enhancement New feature or request AMWOC feature Planned feature of software. BOUNTY-30 labels Jan 6, 2025
@PavanCodes05
Copy link
Contributor

Hey @Ashrockzzz2003, I can work on this issue if it is not assingned to anyone yet

My Approach:

  1. I Can check if the chosen template has the env file using 'fs'
  2. If the template has the ".env" file, we can log the instruction, if not ignore it

If this approach sounds good, kindly give the preferred style for logging the instructions :)
Thank You!

@Ashrockzzz2003
Copy link
Member Author

@PavanCodes05
I get your approach. Do we actually need to read thru file.

We know the templates, we know beforehand whether it needs env or not, how about we just store it in a boolean along with template metadata in configs.js and based on that we log.

About the logging style, try coming up with one. We're open for ideas.

@PavanCodes05
Copy link
Contributor

@Ashrockzzz2003 That's a clever approach, you can assign me I can do that!

@GMHarish285
Copy link
Contributor

GMHarish285 commented Jan 7, 2025

@Ashrockzzz2003
Here's my proposal:
Like you said, we will just have a boolean in the const templates in bin/configs.js.
Then, if a template is created which needs .env we will print in CL that this template needs env vars. And maybe provide a short description or just list them in the CL itself. And ask them to refer README.md for detailed info.

And we will also create a README.md which can provide an explanation of the env variables, and how to set them up.
But I guess, this requires the README.md to be created in the template itself.

@PavanCodes05
Copy link
Contributor

Hey @Ashrockzzz2003 ! Good evening,

Enhanced Approach:

  1. We can have a boolean flag indicating if a template requiresEnv
  2. through that we can indicate the users with "The chosen templated requires env variables to run"
  3. the extra thing that we do is, we give them 2-3 seconds to read the terminal, ignoring any I/O to avoid them starting up the application without setting up .env
  4. Finally with the indication, we redirect them directly to env file on their default code editor! which makes sure the setup is done before starting up the server!

if this SGTY, I can work on it, Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AMWOC BOUNTY-30 enhancement New feature or request feature Planned feature of software.
Projects
None yet
Development

No branches or pull requests

3 participants