How impl0x/impstagram works
Impstagram is presented as an Instagram clone, but this tree exposes a Go backend centered on authentication, account validation, and PostgreSQL-backed user/session/profile data—not the broader social-media features. Its visible user workflow is HTTP auth requests through handlers into auth services, which use repositories and in-memory verification sessions to produce login, OTP, password-reset, and token outcomes. The README also names Resend email and Telegram phone registration. Some wiring and integrations are unsampled, so those links are omitted or marked unverified.
Main entry points: service.go Auth workflows · handlers.go Auth routes · postgres Postgres adapters · repository.go Repository wiring
Components 18
HTTP API
- App bootstrap
backend/app/app.go - Auth routes
backend/internal/transport/http/handler/auth/handlers.go - Validation routes
backend/internal/transport/http/handler/validation/handlers.go - HTTP error mapping
backend/internal/transport/http/error_handler.go - Response schema
backend/internal/transport/http/response/response.go
Authentication
- Auth workflows
backend/internal/service/auth/service.go - Account validation
backend/internal/validation/auth.go - Auth configuration
backend/internal/config/services/auth.go
Persistence
- Repository contracts
backend/internal/repository - Postgres adapters
backend/internal/database/sql/postgres - PostgreSQL
- Repository wiring
backend/app/repository.go
Runtime support
- OTP session caches
backend/internal/service/auth/service.go - Crypto utilities
backend/pkg/cryptoutil - JWT utilities
backend/pkg/jwt - Resend email
backend/pkg/email/resend - Telegram phone
Other components
- API client
Connections 14
- API client → Auth routes: sends requests
backend/internal/transport/http/handler/auth/handlers.go - Auth routes → Auth workflows: calls workflows
backend/internal/transport/http/handler/auth/handlers.go - Auth workflows → Repository contracts: uses repositories
backend/internal/service/auth/service.go - App bootstrap → Repository wiring: initializes app
- Repository wiring → Postgres adapters: binds adapters
backend/app/repository.go - Postgres adapters → PostgreSQL: queries
- Auth workflows → OTP session caches: stores sessions
backend/internal/service/auth/service.go - Auth workflows → Crypto utilities: uses cryptography
backend/internal/service/auth/service.go - Auth workflows → JWT utilities: mints tokens
- Validation routes → Account validation: validates input
backend/internal/transport/http/handler/validation/handlers.go - Auth routes → Response schema: formats results
backend/internal/transport/http/handler/auth/handlers.go - HTTP error mapping → Response schema: formats errors
backend/internal/transport/http/error_handler.go - Auth workflows → Resend email: may send email
README.md - Auth workflows → Telegram phone: may send phone codes
README.md