How kokinf/tourgor works
Tourgor is a web application for browsing and booking tours, with client accounts, passenger/document management, and administrative and manager dashboards. The main flow is a visitor searching active tours, viewing a tour, and—after authentication—creating a booking; staff manage bookings, users, and tours. The sampled code shows the server wiring, handler-to-service calls, and service-to-repository delegation. The README is empty, and several handler, service, and repository implementations were not excerpted, so uncertain links are omitted.
Main entry points: service.go Service layer · app.go Server setup and routes · repository.go Repository assembly · user.go User storage
Components 21
Web experience
- Browser pages
web/templates - Search and profile UI
web/static/js
HTTP application
- Server setup and routes
internal/app/app.go - Client handlers
internal/handler/client/handler.go - Authentication handlers
internal/handler/auth/handler.go - Admin handlers
internal/handler/admin/handler.go - Manager handlers
internal/handler/manager/handler.go
Business services
- Service layer
internal/service/service.go - Authentication services
internal/service/auth.go - Tour services
internal/service/tour.go - Passenger services
internal/service/passenger.go - Manager operations
internal/service/manager.go - Domain models
internal/model
Persistence
- Repository assembly
internal/repository/repository.go - User storage
internal/repository/user.go - Tour storage
internal/repository/tour.go - Booking storage
internal/repository/booking.go - Passenger storage
internal/repository/passenger.go - Document storage
internal/repository/document.go
Other components
- Visitor / user
- PostgreSQL
Connections 33
- Visitor / user → Browser pages: uses
- Search and profile UI → Server setup and routes: requests tours
- Server setup and routes → Client handlers: routes requests
internal/app/app.go - Server setup and routes → Authentication handlers: routes auth
internal/app/app.go - Server setup and routes → Admin handlers: routes admin
internal/app/app.go - Server setup and routes → Manager handlers: routes management
internal/app/app.go - Server setup and routes → Repository assembly: initializes
internal/app/app.go - Server setup and routes → Service layer: initializes
internal/app/app.go - Server setup and routes → PostgreSQL: opens connection
internal/app/app.go - Client handlers → Service layer: calls
internal/handler/client/handler.go - Authentication handlers → Service layer: authenticates
internal/handler/auth/handler.go - Admin handlers → Service layer: calls
internal/handler/admin/handler.go - Manager handlers → Service layer: calls
internal/handler/manager/handler.go - Client handlers → Browser pages: renders pages
internal/handler/client/handler.go - Admin handlers → Browser pages: renders dashboard
internal/handler/admin/handler.go - Manager handlers → Browser pages: renders dashboard
internal/handler/manager/handler.go - Service layer → User storage: delegates user work
internal/service/service.go - Service layer → Authentication services: delegates auth
- Service layer → Tour services: delegates tours
- Service layer → Passenger services: delegates passengers
- Manager operations → Booking storage: updates bookings
internal/service/manager.go - Manager operations → User storage: creates managers
internal/service/manager.go - Manager operations → Tour storage: updates tour price
internal/service/manager.go - Repository assembly → User storage: constructs
internal/repository/repository.go - Repository assembly → Tour storage: constructs
internal/repository/repository.go - Repository assembly → Booking storage: constructs
internal/repository/repository.go - Repository assembly → Passenger storage: constructs
internal/repository/repository.go - Repository assembly → Document storage: constructs
internal/repository/repository.go - User storage → PostgreSQL: queries
- Tour storage → PostgreSQL: queries
- Booking storage → PostgreSQL: queries
- Passenger storage → PostgreSQL: queries
- Document storage → PostgreSQL: queries