backend-service/cmd/server/main.go
ats-tech25 ddfa2de49e feat(app): Implement comprehensive application lifecycle management
- Add new `app` package to manage application initialization and lifecycle
- Refactor `main.go` to use new application management approach
- Implement graceful shutdown with context timeout and signal handling
- Add dependency injection container initialization
- Enhance logging with configurable log levels and structured logging
- Update configuration loading and server initialization process
- Modify Jitsi configuration in `.env` for custom deployment
- Improve error handling and logging throughout application startup
- Centralize application startup and shutdown logic in single package
Introduces a more robust and flexible application management system with improved initialization, logging, and shutdown capabilities.
2025-11-07 19:22:26 +00:00

32 lines
661 B
Go

package main
import (
"attune-heart-therapy/internal/app"
"attune-heart-therapy/internal/logger"
"github.com/joho/godotenv"
)
func main() {
// Initialize logger
log := logger.New("main")
// Load environment variables
if err := godotenv.Load(); err != nil {
log.Warn("No .env file found, using system environment variables")
}
// Create and run application
application, err := app.New()
if err != nil {
log.Fatal("Failed to create application", err)
}
// Run the application with graceful shutdown handling
if err := application.Run(); err != nil {
log.Fatal("Application failed", err)
}
log.Info("Application shutdown completed")
}