How tgaall/docflow works
DocFlow is a FastAPI backend for managing student practical placements and producing DOCX documents. The main workflow is to import student and organization data, manage groups, practices, supervisors and assignments, then export directions, an order or a group report. The graph includes the database/model and repository layers as well as the documented router capabilities. Source excerpts support the sampled call paths; several unsampled routers and repositories are connected only where the SOURCE INDEX lists their imports.
Main entry points: main.py FastAPI app · routers Management routes · documents.py Document routes · session.py Async sessions
Components 21
API and contracts
- FastAPI app
src/main.py - Assignment routes
src/routers/assignments.py - Assignment schemas
src/schemas/assignments.py - Management routes
src/routers - Import routes
src/routers/imports.py - Document routes
src/routers/documents.py - Import schemas
src/schemas/imports.py - Document schemas
src/schemas/documents.py
Placement management
- Assignments
src/repositories/assignments.py - Students and groups
src/repositories/students.py - Practices and supervisors
src/repositories/practices.py - Organizations
src/repositories/organizations.py - Report data
src/repositories/reports.py - Placement records
src/models/domain.py
Data imports
- File import
src/services/imports.py
Document exports
- DOCX rendering
src/services/documents.py
Persistence
- Database bootstrap
src/db/bootstrap.py - Async sessions
src/db/session.py - ORM base and URL
src/db/base.py - Practice database
practice.db
Other components
- API client
Connections 34
- API client → FastAPI app: sends requests
src/main.py - FastAPI app → Assignment routes: registers
src/main.py - FastAPI app → Management routes: registers
src/main.py - FastAPI app → Import routes: registers
src/main.py - FastAPI app → Document routes: registers
src/main.py - FastAPI app → Database bootstrap: initializes
src/main.py - Assignment routes → Async sessions: gets session
src/routers/assignments.py - Assignment routes → Assignments: calls
src/routers/assignments.py - Assignment routes → Assignment schemas: validates and returns
src/routers/assignments.py - Management routes → Async sessions: gets session
src/routers/groups.py - Management routes → Students and groups: calls
src/routers/groups.py - Management routes → Practices and supervisors: calls
src/routers/supervisors.py - Management routes → Organizations: calls
src/routers/orgs.py - Management routes → Import schemas: uses contracts
src/routers/practices.py - Import routes → Async sessions: gets session
src/routers/imports.py - Import routes → File import: calls
src/routers/imports.py - Import routes → Import schemas: uses contracts
src/routers/imports.py - File import → Students and groups: imports students
src/services/imports.py - File import → Organizations: imports organizations
src/services/imports.py - Document routes → Async sessions: gets session
src/routers/documents.py - Document routes → Assignments: reads assignment data
src/routers/documents.py - Document routes → Report data: reads report data
src/routers/documents.py - Document routes → DOCX rendering: renders documents
src/routers/documents.py - Document routes → Document schemas: uses context
src/routers/documents.py - Assignments → Placement records: queries and updates
src/repositories/assignments.py - Students and groups → Placement records: queries and creates
src/repositories/students.py - Practices and supervisors → Placement records: queries and creates
src/repositories/practices.py - Organizations → Placement records: uses models
src/repositories/organizations.py - Report data → Placement records: uses models
src/repositories/reports.py - Database bootstrap → Async sessions: uses session
src/db/bootstrap.py - Database bootstrap → ORM base and URL: uses ORM base
src/db/bootstrap.py - Database bootstrap → Placement records: loads models
src/db/bootstrap.py - Async sessions → ORM base and URL: uses database URL
src/db/session.py - ORM base and URL → Practice database: configures URL
src/db/base.py