feat: daily vani
This commit is contained in:
@@ -49,6 +49,7 @@ type Server struct {
|
||||
otherDocH *handler.OtherDocumentHandler
|
||||
transcriptionH *handler.TranscriptionHandler
|
||||
searchH *handler.SearchHandler
|
||||
vaniH *handler.VaniHandler
|
||||
sitemapH *handler.SitemapHandler
|
||||
shortURLH *handler.ShortURLHandler
|
||||
authH *handler.AuthHandler
|
||||
@@ -200,6 +201,12 @@ func (s *Server) initAuth(cfg *config.Config, logger *zap.Logger) {
|
||||
audioProgressRepo := repository.NewAudioProgressRepo(s.pg)
|
||||
s.audioH = handler.NewAudioProgressHandler(service.NewAudioProgressService(audioProgressRepo))
|
||||
|
||||
// Vāṇī of the Day — one daily pick (prose/verse/transcript) for the home
|
||||
// page, chosen from Mongo content and recorded in Postgres so it doesn't
|
||||
// repeat within 90 days.
|
||||
vaniRepo := repository.NewVaniRepo(s.pg, s.mongo)
|
||||
s.vaniH = handler.NewVaniHandler(service.NewVaniService(vaniRepo, logger))
|
||||
|
||||
// OAuth — wired only when at least one provider is configured. The
|
||||
// registry skips providers with missing creds, so partial configs (e.g.
|
||||
// Google only, no Facebook) work out of the box.
|
||||
@@ -647,6 +654,9 @@ func (s *Server) setupRouter() {
|
||||
// Search (Typesense)
|
||||
r.Get("/search", s.searchH.Search)
|
||||
|
||||
// Vāṇī of the Day — public daily content pick for the home page.
|
||||
r.Get("/vani/today", s.vaniH.Today)
|
||||
|
||||
// --- Auth ---
|
||||
// Public endpoints (no JWT required) for sign-up, log-in, password reset,
|
||||
// and email verification. The /auth/me + /auth/resend-verification routes
|
||||
|
||||
Reference in New Issue
Block a user