How temkinnn/rust-notes-api works
This is a Rust/Actix web API for managing users and their todos, including user–todo queries and standard CRUD operations. Requests enter through the /api routes, are handled by user or todo handlers, and use services and SQL repositories to access PostgreSQL; handlers serialize results and errors as HTTP responses. The excerpts show the user service delegating to its repository, but do not show the todo service implementation, so that delegation is left unverified. The README is empty, and no migration behavior is inferred.
Main entry points: main.rs Server entry · todo.rs Todo routes · handlers/user.rs User routes · repositories/user.rs User repository
Components 14
Server runtime
- Server entry
src/main.rs - API configuration
src/config.rs
HTTP API
- Todo routes
src/handlers/todo.rs - User routes
src/handlers/user.rs - Todo service
src/services/todo.rs - User service
src/services/user.rs
Domain models
- Todo models
src/models/todo.rs - User models
src/models/user.rs - Error response
src/models/res.rs
Persistence
- Database pool
src/db/mod.rs - Todo repository
src/repositories/todo.rs - User repository
src/repositories/user.rs - PostgreSQL
Other components
- API client
Connections 22
- API client → Server entry: sends requests
src/main.rs - Server entry → Database pool: initializes pool
src/main.rs - Server entry → API configuration: configures errors
src/main.rs - Server entry → Todo routes: registers routes
src/main.rs - Server entry → User routes: registers routes
src/main.rs - Database pool → PostgreSQL: connects to
src/db/mod.rs - Todo routes → Todo service: calls
src/handlers/todo.rs - User routes → User service: calls
src/handlers/user.rs - Todo routes → Todo repository: constructs
src/handlers/todo.rs - User routes → User repository: constructs
src/handlers/user.rs - User service → User repository: delegates to
src/services/user.rs - Todo service → Todo repository: delegates to
- Todo repository → PostgreSQL: queries
src/repositories/todo.rs - User repository → PostgreSQL: queries
src/repositories/user.rs - Todo routes → Todo models: accepts DTOs
src/handlers/todo.rs - User routes → User models: accepts DTOs
src/handlers/user.rs - Todo repository → Todo models: maps rows
src/repositories/todo.rs - User repository → User models: maps rows
src/repositories/user.rs - User repository → Todo models: returns todos
src/repositories/user.rs - Todo routes → Error response: serializes errors
src/handlers/todo.rs - User routes → Error response: serializes errors
src/handlers/user.rs - API configuration → Error response: formats errors
src/config.rs