How dmaq32/notes-api works
Notes API serves registration and JWT login, then uses bearer authentication to scope note CRUD, filtering, and pagination to the current user. Creating or deleting a note publishes an event to RabbitMQ; a separate consumer records created/deleted events in the history table. The graph shows the API, persistence, and event-processing layers. Source excerpts support the shown calls; other README-described behavior is represented without inferring unsampled internal calls.
Main entry points: note.py Note operations · user.py Registration and login · config.py Async DB sessions · consumer.py Event consumer
Components 12
API and identity
- FastAPI app
app/main.py - Registration and login
app/routers/user.py - Note operations
app/routers/note.py - JWT authentication
app/utils.py - Request and response schemas
app/db/schemas.py
Persistence
- Async DB sessions
app/db/config.py - User, note, history models
app/db/models.py - PostgreSQL
Event history
- Broker configuration
app/rabbitmq/config.py - RabbitMQ
- Event consumer
app/rabbitmq/consumer.py
Other components
- API client
Connections 21
- API client → FastAPI app: sends requests
README.md - FastAPI app → Registration and login: registers router
app/main.py - FastAPI app → Note operations: registers router
app/main.py - FastAPI app → Broker configuration: opens connection
app/main.py - Registration and login → Request and response schemas: validates payloads
app/routers/user.py - Registration and login → Async DB sessions: queries via sessions
app/routers/user.py - Registration and login → User, note, history models: reads and creates users
app/routers/user.py - Registration and login → JWT authentication: creates token
app/routers/user.py - Note operations → Request and response schemas: validates and shapes
app/routers/note.py - Note operations → JWT authentication: resolves current user
app/routers/note.py - Note operations → Async DB sessions: queries via sessions
app/routers/note.py - Note operations → User, note, history models: reads and changes notes
app/routers/note.py - JWT authentication → Async DB sessions: loads user
app/utils.py - JWT authentication → User, note, history models: loads user model
app/utils.py - Async DB sessions → PostgreSQL: connects
- Note operations → RabbitMQ: publishes note events
app/routers/note.py - Broker configuration → RabbitMQ: connects and configures
app/rabbitmq/config.py - Event consumer → Broker configuration: opens connection
app/rabbitmq/consumer.py - Event consumer → RabbitMQ: binds and consumes
app/rabbitmq/consumer.py - Event consumer → Async DB sessions: opens session
app/rabbitmq/consumer.py - Event consumer → User, note, history models: inserts history records
app/rabbitmq/consumer.py