How sgtp3pp3r/api-de-recuperacion-de-cuentas works
This is a FastAPI account-authentication and password-recovery API. Clients register or log in, use JWTs for protected profile and password-change operations, and can request an emailed reset token and submit it with a new password. The documented reset token is six digits and expires after 15 minutes. The graph reflects the endpoint-to-service-to-repository flow visible in excerpts; the README documents the API capabilities and Gmail SMTP integration. The separate core configuration and security modules are present, but their runtime use is not established by the excerpts.
Main entry points: user_service.py User workflows · auth_service.py JWT and password auth · auth.py Auth endpoints · database.py SQL database and sessions
Components 14
HTTP API
- FastAPI application
app/main.py - Auth endpoints
app/endpoints/auth.py - Request and response schemas
app/schemas/user.py
Account workflows
- User workflows
app/services/user_service.py - JWT and password auth
app/services/auth_service.py - Recovery email
app/services/email_service.py
Persistence
- User repository
app/repositories/user_repository.py - User ORM model
app/models/user.py - SQL database and sessions
app/database.py
Configuration and security
- Application settings
app/config.py - Core settings
app/core/config.py - Core security module
app/core/security.py
Other components
- API client
- Gmail SMTP
Connections 19
- API client → FastAPI application: sends HTTP requests
README.md - FastAPI application → Auth endpoints: registers router
app/main.py - FastAPI application → SQL database and sessions: creates tables
app/main.py - Auth endpoints → User workflows: dispatches workflows
app/endpoints/auth.py - Auth endpoints → JWT and password auth: resolves current user
app/endpoints/auth.py - Auth endpoints → Request and response schemas: validates and responds
app/endpoints/auth.py - User workflows → User repository: reads and writes users
app/services/user_service.py - User workflows → JWT and password auth: hashes and verifies passwords
app/services/user_service.py - User workflows → Recovery email: sends recovery notices
app/services/user_service.py - Recovery email → Gmail SMTP: sends email
app/services/email_service.py - JWT and password auth → User repository: looks up current user
app/services/auth_service.py - JWT and password auth → SQL database and sessions: injects session
app/services/auth_service.py - User repository → User ORM model: queries and updates
app/repositories/user_repository.py - User ORM model → SQL database and sessions: uses declarative base
app/models/user.py - SQL database and sessions → Application settings: loads database URL
app/database.py - JWT and password auth → Application settings: loads JWT settings
app/services/auth_service.py - User workflows → Application settings: loads reset expiry
app/services/user_service.py - Recovery email → Application settings: loads mail settings
app/services/email_service.py - Core security module → Core settings: imports settings
app/core/security.py