How w1ldmaster/backend_part_spa works
This is a FastAPI/PostgreSQL social-network API. Its main workflow serves post, follow-feed, profile, group, and comment requests through routers, services, and repositories to persistent data, with schemas shaping API responses. Authentication is a separate JWT/user-management branch. The README documents additional account and social features; unsampled wiring is included only where documentation or indexed references support it. Edges reflect shown calls or documented layers; the excerpt does not expose the database driver’s runtime connections.
Main entry points: posts_django.py Post and social routes · auth_users.py Auth and user routes · post.py Post service · user.py User service
Components 18
HTTP API
- Post and social routes
FastApiProject/app/routers/posts_django.py - Auth and user routes
FastApiProject/app/routers/auth_users.py - API schemas
FastApiProject/app/schemas.py - API application
FastApiProject/app/main.py
Social features
- Post service
FastApiProject/app/services/post.py - User service
FastApiProject/app/services/user.py - Group service
FastApiProject/app/services/group.py
Identity and auth
- JWT authentication
FastApiProject/app/core/auth.py - Service wiring
FastApiProject/app/dependencies.py - Domain errors
FastApiProject/app/exceptions.py - Error translation
FastApiProject/app/core/utility.py
Persistence
- Post repository
FastApiProject/app/repositories/post.py - User repository
FastApiProject/app/repositories/user.py - Group repository
FastApiProject/app/repositories/group.py - ORM models
FastApiProject/app/models.py - Async sessions
FastApiProject/app/database.py
Other components
- API client
- PostgreSQL
Connections 31
- API client → Post and social routes: sends requests
README.md - API client → Auth and user routes: authenticates
README.md - API application → Post and social routes: registers routes
FastApiProject/app/main.py - API application → Auth and user routes: registers routes
FastApiProject/app/main.py - Post and social routes → Post service: calls
FastApiProject/app/routers/posts_django.py - Post and social routes → User service: calls
FastApiProject/app/routers/posts_django.py - Post and social routes → Group service: calls
FastApiProject/app/routers/posts_django.py - Auth and user routes → User service: calls
FastApiProject/app/routers/auth_users.py - Post and social routes → API schemas: validates and formats
FastApiProject/app/routers/posts_django.py - Auth and user routes → API schemas: uses schemas
FastApiProject/app/routers/auth_users.py - Post and social routes → JWT authentication: requires active user
FastApiProject/app/routers/posts_django.py - Auth and user routes → JWT authentication: registers auth flows
FastApiProject/app/routers/auth_users.py - Post service → Post repository: calls
FastApiProject/app/services/post.py - Post service → Group repository: looks up group
FastApiProject/app/services/post.py - User service → User repository: calls
FastApiProject/app/services/user.py - Group service → Group repository: calls
FastApiProject/app/services/group.py - Post service → Domain errors: raises
FastApiProject/app/services/post.py - User service → Domain errors: raises
FastApiProject/app/services/user.py - Post and social routes → Error translation: translates errors
FastApiProject/app/routers/posts_django.py - Auth and user routes → Error translation: translates errors
FastApiProject/app/routers/auth_users.py - Service wiring → Async sessions: gets session
FastApiProject/app/dependencies.py - Service wiring → Post service: constructs
FastApiProject/app/dependencies.py - Service wiring → User service: constructs
FastApiProject/app/dependencies.py - Service wiring → Group service: constructs
FastApiProject/app/dependencies.py - Post repository → ORM models: queries
FastApiProject/app/repositories/post.py - User repository → ORM models: queries
FastApiProject/app/repositories/user.py - Group repository → ORM models: queries
FastApiProject/app/repositories/group.py - ORM models → Async sessions: uses declarative base
FastApiProject/app/models.py - JWT authentication → Async sessions: gets sessions
FastApiProject/app/core/auth.py - JWT authentication → ORM models: authenticates users
FastApiProject/app/core/auth.py - Async sessions → PostgreSQL: connects via async SQLAlchemy
README.md