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

refactor index.js into modules for individual bootstrap tasks #1502

Closed
csmig opened this issue Feb 4, 2025 · 1 comment · May be fixed by #1527
Closed

refactor index.js into modules for individual bootstrap tasks #1502

csmig opened this issue Feb 4, 2025 · 1 comment · May be fixed by #1527
Assignees
Labels

Comments

@csmig
Copy link
Member

csmig commented Feb 4, 2025

To support the addition of new State and Alarm modules, we will refactor index.js into separate modules that handle each bootstrap task. Bootstrap tasks include:

  • setting up middleware
  • preparing dynamic content for web app environment file
  • starting the server
  • checking that db and oidc services are available
  • entering/leaving an operational state

The final bootstrap task (entering/leaving an operational state) is currently primitive and uses a simple top-level object to track state. This will be maintained during the refactor, and that task will be modified when #1503 is developed.

@csmig csmig self-assigned this Feb 4, 2025
@csmig csmig added the API label Feb 4, 2025
@csmig
Copy link
Member Author

csmig commented Feb 11, 2025

I pushed a branch to my private fork which has POC work I did last August on this topic.

I worked with ChatGPT to get ideas for a more modular bootstrap process. It is not fully working code, some of the necessary tasks are not implemented yet. Note that the branch uses app.js as the entry point instead of index.js, which is retained as the benchmark of what needs to be covered.

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

Successfully merging a pull request may close this issue.

2 participants