How eleshaday/e-learn works
This is a Go REST backend for an e-learning platform. The implemented user workflow is authentication: clients submit OTP, signup, login, or password-reset requests through Gin routes; handlers invoke auth logic, which uses Mongo-backed user/OTP storage and returns an API response or JWT. The server also exposes liveness/readiness checks, with readiness pinging MongoDB. Course and other learning-domain models, plus Stripe and Cloudinary interfaces, indicate broader product scope, but the router says profile, course, and payment handlers remain unported. Edges reflect shown calls and wiring; unsampled domain behavior is not inferred.
Main entry points: router.go Route Wiring · container.go Dependency Container · service.go Auth Logic · server.go HTTP Server
Components 22
HTTP Runtime
- Process Entry
cmd/server/main.go - Configuration
internal/config/config.go - Mongo Connection
internal/database/mongo.go - HTTP Server
internal/server/server.go - Route Wiring
internal/server/router.go - Health Checks
internal/http/handlers/health/health.go - Dependency Container
internal/di/container.go - MongoDB
Authentication
- Auth Handlers
internal/http/handlers/auth/handlers.go - JWT Middleware
internal/http/middleware/auth.go - Auth Logic
internal/service/auth/service.go - User Repository
internal/repository/mongo/user_repository.go - OTP Service
internal/domain/otp/service.go - Password Utilities
internal/utils/password/password.go - OTP Generator
internal/utils/random/otp.go
Learning Domain
- User Model
internal/domain/user/entity.go - Course Model
internal/domain/course/entity.go - Course Repository
internal/repository/mongo/course_repository.go - Learning Models
internal/domain
Integrations
- Stripe Interface
internal/integrations/stripe/client.go - Cloudinary Interface
internal/integrations/cloudinary/client.go
Other components
- API Client
Connections 28
- API Client → Route Wiring: sends requests
README.md - Process Entry → Configuration: loads
cmd/server/main.go - Process Entry → Mongo Connection: connects
cmd/server/main.go - Process Entry → HTTP Server: constructs
cmd/server/main.go - Mongo Connection → MongoDB: connects
- HTTP Server → Dependency Container: builds
internal/server/server.go - HTTP Server → Route Wiring: creates
internal/server/server.go - HTTP Server → Configuration: uses
internal/server/server.go - Route Wiring → Dependency Container: passes
internal/server/router.go - Route Wiring → Auth Handlers: registers
internal/server/router.go - Route Wiring → Health Checks: registers
internal/server/router.go - Route Wiring → MongoDB: pings
internal/server/router.go - Dependency Container → User Repository: constructs
internal/di/container.go - Dependency Container → OTP Service: constructs
internal/di/container.go - Dependency Container → Auth Logic: constructs
internal/di/container.go - Auth Handlers → Auth Logic: invokes
internal/http/handlers/auth/handlers.go - Auth Handlers → JWT Middleware: registers
internal/http/handlers/auth/handlers.go - Auth Logic → User Repository: reads and writes
- User Repository → MongoDB: persists users
internal/repository/mongo/user_repository.go - Auth Logic → OTP Service: creates OTP
internal/service/auth/service.go - Auth Logic → Password Utilities: hashes passwords
internal/service/auth/service.go - OTP Service → OTP Generator: generates codes
internal/domain/otp/service.go - OTP Service → MongoDB: stores OTPs
internal/domain/otp/service.go - User Repository → User Model: stores
internal/repository/mongo/user_repository.go - Course Repository → Course Model: loads
internal/repository/mongo/course_repository.go - Course Repository → MongoDB: queries
internal/repository/mongo/course_repository.go - Stripe Interface → MongoDB: payment flow unwired
- Cloudinary Interface → MongoDB: media flow unwired