How dheerajll/track-it-now-v1 works
Parcel Tracer is a FastAPI backend for parcel requests, delivery assignment and status, account management, and real-time agent/location updates. The main customer workflow is request → receiver acceptance → parcel creation → agent assignment and tracking; customers and agents interact through REST endpoints and WebSockets. Services mediate API operations and repositories persist domain records in PostgreSQL, while Redis supports agent-location and regional pub/sub behavior. The graph reflects the README and sampled source; unsampled modules are included only where the tree or README establishes their role, so uncertain internal wiring is omitted.
Main entry points: main.py FastAPI application · delivery_services.py Delivery assignment · parcels.py Parcel routes · users.py User services
Components 24
HTTP and WebSocket API
- FastAPI application
app/main.py - Account routes
app/api/users.py - Parcel routes
app/api/parcels.py - Agent routes
app/api/agents.py - Delivery routes
app/api/delivery.py - Tracking routes
app/api/track.py
Domain services
- User services
app/services/users.py - Request services
app/services/parcel_requests.py - Parcel services
app/services/parcels.py - Delivery assignment
app/services/delivery_services.py
Live coordination
- Agent coordination
app/services/agent.py - Live location
app/services/livelocation.py - WebSocket managers
app/services/websockets.py - Redis
Persistence and security
- User repository
app/database/repository/users.py - Request repository
app/database/repository/parcel_requests.py - Parcel repository
app/database/repository/parcels.py - Delivery repository
app/database/repository/delivery_assignment.py - Tracking code repository
app/database/repository/trackingcode.py - PostgreSQL
- Database session
app/database/session.py - Password and tokens
app/core/security.py
Other components
- Customer
- Delivery agent
Connections 32
- Customer → FastAPI application: uses API
- Delivery agent → FastAPI application: uses API
- FastAPI application → Account routes: registers routes
- FastAPI application → Parcel routes: registers routes
- FastAPI application → Agent routes: registers routes
- FastAPI application → Delivery routes: registers routes
- FastAPI application → Tracking routes: registers routes
- Account routes → User services: calls
- User services → User repository: uses
- User services → Password and tokens: uses
- Parcel routes → Request services: calls
- Parcel routes → Parcel services: calls
- Request services → Request repository: uses
- Request services → WebSocket managers: notifies
- Parcel services → Parcel repository: uses
- Delivery routes → Delivery assignment: calls
- Delivery assignment → Delivery repository: creates assignment
- Delivery assignment → Tracking code repository: creates code
- Delivery assignment → Parcel services: updates status
- Delivery assignment → WebSocket managers: sends notifications
- Agent routes → Agent coordination: dispatches
- Agent coordination → Redis: publishes locations
- Agent coordination → WebSocket managers: forwards updates
- Tracking routes → Live location: handles tracking
- Live location → Redis: uses location data
- FastAPI application → Database session: opens and closes
- Database session → PostgreSQL: initializes pool
- User repository → PostgreSQL: reads and writes
- Request repository → PostgreSQL: reads and writes
- Parcel repository → PostgreSQL: reads and writes
- Delivery repository → PostgreSQL: persists assignments
- Tracking code repository → PostgreSQL: persists codes