How kaikyborges/investment-wallet-api works
Investment Wallet API is a FastAPI service for user accounts, authenticated investment transactions, current prices, asset positions, and portfolio summaries. The main workflow is a client request through the registered routers, with protected routes resolving the user, reading or writing persisted records, and (for asset and portfolio views) applying portfolio calculations. The README documents Alembic migrations and environment-based configuration. Relationships are shown where excerpts or README statements support them; unsampled internals are not inferred.
Main entry points: database.py Database sessions · auth.py JWT authentication · db_models.py ORM records · app.py FastAPI app
Components 15
API surface
- FastAPI app
app/app.py - User routes
app/routers/usuarios.py - Transaction routes
app/routers/transacoes.py - Asset routes
app/routers/ativos.py - Price routes
app/routers/precos.py - Wallet routes
app/routers/carteira.py
Identity and schemas
- JWT authentication
app/auth.py - Request schemas
app/models.py - Environment config
app/config.py
Portfolio domain
- Position calculations
app/calculos.py
Persistence
- ORM records
app/db_models.py - Database sessions
app/database.py - SQLite database
- Schema migrations
alembic/versions
Other components
- API client
Connections 32
- API client → FastAPI app: sends requests
README.md - FastAPI app → User routes: registers routes
app/app.py - FastAPI app → Transaction routes: registers routes
app/app.py - FastAPI app → Asset routes: registers routes
app/app.py - FastAPI app → Price routes: registers routes
app/app.py - FastAPI app → Wallet routes: registers routes
app/app.py - User routes → Request schemas: validates input
app/routers/usuarios.py - Transaction routes → Request schemas: validates input
app/routers/transacoes.py - Price routes → Request schemas: validates input
app/routers/precos.py - User routes → ORM records: queries and creates
app/routers/usuarios.py - Transaction routes → ORM records: creates records
app/routers/transacoes.py - Asset routes → ORM records: queries transactions
app/routers/ativos.py - Price routes → ORM records: reads and writes
app/routers/precos.py - Wallet routes → ORM records: queries records
app/routers/carteira.py - User routes → Database sessions: injects session
app/routers/usuarios.py - Transaction routes → Database sessions: injects session
app/routers/transacoes.py - Asset routes → Database sessions: injects session
app/routers/ativos.py - Price routes → Database sessions: injects session
app/routers/precos.py - Wallet routes → Database sessions: injects session
app/routers/carteira.py - Asset routes → JWT authentication: resolves user
app/routers/ativos.py - Transaction routes → JWT authentication: resolves user
app/routers/transacoes.py - Price routes → JWT authentication: resolves user
app/routers/precos.py - Wallet routes → JWT authentication: resolves user
app/routers/carteira.py - JWT authentication → ORM records: looks up user
app/auth.py - JWT authentication → Database sessions: injects session
app/auth.py - JWT authentication → Environment config: uses JWT settings
app/auth.py - User routes → Environment config: uses JWT settings
app/routers/usuarios.py - Asset routes → Position calculations: calculates positions
app/routers/ativos.py - Wallet routes → Position calculations: calculates summary
app/routers/carteira.py - ORM records → Database sessions: uses declarative base
app/db_models.py - Database sessions → SQLite database: connects to
app/database.py - Schema migrations → SQLite database: updates schema
README.md