How huseyn-ads/question-to-pdf works
Question-To-Pdf is a student-facing question-bank and quiz-question API. The visible workflow is authenticated HTTP requests to create and manage banks and their questions, with validation and PostgreSQL persistence. The repository also documents PDF questions as the product concept, but the sampled README and source provide no evidence of a PDF-ingestion or quiz-generation implementation, so that capability is not mapped as a runtime subsystem. Some route wiring and storage implementations were not excerpted; edges are limited to relationships shown in the excerpts.
Main entry points: main.go API Server · user/service.go User Service · handler.go Bank HTTP Handler · questionbank/service.go Bank Service
Components 17
HTTP API
- API Server
cmd/api/main.go
Question Banks
- Bank HTTP Handler
internal/questionbank/handler.go - Bank Service
internal/questionbank/service.go - Bank Repository
internal/questionbank/repository.go
Quiz Questions
- Question HTTP Handler
internal/question/handler.go - Question Service
internal/question/service.go - Question Repository
internal/question/repository.go
Accounts & Sessions
- User HTTP Handler
internal/user/handler.go - Auth Middleware
internal/user/middleware.go - User Service
internal/user/service.go - User Repository
internal/user/repository.go - Session Repository
internal/session/repository.go - Session Tokens
internal/session/token.go
Runtime Infrastructure
- Configuration
internal/config/config.go - Database Connector
internal/database/database.go - PostgreSQL
Other components
- Student
Connections 18
- Student → API Server: sends requests
cmd/api/main.go - API Server → Configuration: loads settings
cmd/api/main.go - API Server → Database Connector: opens database
cmd/api/main.go - Database Connector → PostgreSQL: connects to
internal/database/database.go - API Server → Bank HTTP Handler: routes requests
cmd/api/main.go - API Server → User HTTP Handler: routes requests
cmd/api/main.go - API Server → Auth Middleware: wraps routes
cmd/api/main.go - Bank HTTP Handler → Bank Service: calls
internal/questionbank/handler.go - Bank Service → Bank Repository: calls
internal/questionbank/service.go - Bank Repository → PostgreSQL: queries
internal/questionbank/repository.go - Question HTTP Handler → Question Service: calls
internal/question/handler.go - Question Service → Question Repository: calls
internal/question/service.go - Question Repository → PostgreSQL: queries
internal/question/repository.go - User HTTP Handler → User Service: calls
internal/user/handler.go - User Service → User Repository: calls
internal/user/service.go - User Service → Session Repository: manages sessions
internal/user/service.go - User Service → Session Tokens: generates and hashes
internal/user/service.go - Session Repository → PostgreSQL: queries
internal/session/repository.go