Restructured project

- backend moved to backend directory
- added and initialized frontend with vue
- moved infrastructure files to infra directory
This commit is contained in:
2026-04-01 22:27:26 +03:00
parent 48ef7217eb
commit 9d845c8899
96 changed files with 1591 additions and 118 deletions
+46
View File
@@ -0,0 +1,46 @@
package main
import (
"FamilyHub/src/api"
"FamilyHub/src/bot"
"FamilyHub/src/config"
"context"
"log"
)
func main() {
var runnable []Runnable
cfg, err := config.Load()
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
if cfg.RunMode == config.API || cfg.RunMode == config.Standalone {
server := api.NewServer(cfg)
runnable = append(runnable, func(ctx context.Context) error {
log.Println("API started on", cfg.APIPort)
return server.Start()
})
runnable = append(runnable, func(ctx context.Context) error {
<-ctx.Done()
return server.Shutdown(context.Background())
})
}
if cfg.RunMode == config.Bot || cfg.RunMode == config.Standalone {
tgBot, err := bot.NewBot(cfg)
if err != nil {
log.Fatal(err)
}
log.Println("Bot started...")
runnable = append(runnable, func(ctx context.Context) error {
return tgBot.Start(ctx)
})
}
Run(ctx, runnable...)
}