feat: initialize project structure with configuration, logging, and Telegram integration

- Added configuration loading from environment variables with default session path handling.
- Implemented a logger using Uber's zap library.
- Created a basic HTTP server with Gin and CORS support.
- Established Telegram client and service for message retrieval.
- Introduced initial API routes and handlers.
- Added necessary dependencies in go.sum.
This commit is contained in:
2026-02-24 12:38:23 +03:30
commit 29cbe6a38d
11 changed files with 531 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
package main
import (
"context"
"log"
"tgss/internal/config"
"tgss/internal/infra"
"tgss/internal/server"
"tgss/internal/telegram"
"time"
"go.uber.org/fx"
)
func main() {
app := fx.New(
fx.Provide(
infra.NewLogger,
config.Load,
server.NewGin,
),
telegram.Module,
fx.Logger(infra.NewFXLogger()),
)
startCtx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()
if err := app.Start(startCtx); err != nil {
log.Fatalf("failed to start: %v", err)
}
}