mirror of
https://github.com/R0m1k3/FlowReader.git
synced 2026-10-11 17:28:05 +02:00
feat(epic-3): implémentation du Dashboard, mode lecture et notifications temps réel
This commit is contained in:
1 parent
1d31de95ec
commit
dc26f22f51
20 files changed
+1237
-107
No files matched your search
+12
-1
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/michael/flowreader/internal/repository"
|
||||
"github.com/michael/flowreader/internal/service"
|
||||
"github.com/michael/flowreader/internal/worker"
|
||||
"github.com/michael/flowreader/internal/ws"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -45,12 +46,18 @@ func main() {
|
||||
// Initialize services
|
||||
authService := service.NewAuthService(userRepo, sessionRepo)
|
||||
feedService := service.NewFeedService(feedRepo)
|
||||
fetchService := service.NewFetchService(feedRepo, articleRepo)
|
||||
|
||||
// Initialize WS Hub
|
||||
hub := ws.NewHub()
|
||||
go hub.Run()
|
||||
|
||||
fetchService := service.NewFetchService(feedRepo, articleRepo, hub)
|
||||
|
||||
// Initialize handlers
|
||||
authHandler := handler.NewAuthHandler(authService)
|
||||
feedHandler := handler.NewFeedHandler(feedService, authService)
|
||||
articleHandler := handler.NewArticleHandler(articleRepo, feedService, authService)
|
||||
wsHandler := handler.NewWSHandler(hub, authService)
|
||||
|
||||
// Start background feed fetcher
|
||||
fetcher := worker.NewFeedFetcher(fetchService, 15*time.Minute, 5)
|
||||
@@ -112,12 +119,16 @@ func main() {
|
||||
// Article routes
|
||||
r.Route("/articles", func(r chi.Router) {
|
||||
r.Get("/", articleHandler.List)
|
||||
r.Post("/read-all", articleHandler.MarkAllReadGlobal)
|
||||
r.Get("/favorites", articleHandler.GetFavorites)
|
||||
r.Get("/{id}", articleHandler.Get)
|
||||
r.Post("/{id}/read", articleHandler.MarkRead)
|
||||
r.Delete("/{id}/read", articleHandler.MarkUnread)
|
||||
r.Post("/{id}/favorite", articleHandler.ToggleFavorite)
|
||||
})
|
||||
|
||||
// WebSocket route
|
||||
r.Get("/ws", wsHandler.Connect)
|
||||
})
|
||||
|
||||
// Create server
|
||||
|
||||
Reference in new issue
Block a user