How priyasaini7604/libraryhive works
LibraryHive is an early implementation of a multi-tenant platform for study-library discovery and operations. The intended user journey spans finding a library, viewing seats, booking and paying, then using memberships and attendance; owners also manage admissions, complaints, visit requests, and dashboards. In the available source, the clearest implemented workflow is frontend session restoration and login through a shared API client, alongside backend account rules and shared API error handling. Feature-stage links are documented product scope, not verified implementation: the supplied tree contains no corresponding feature modules.
Main entry points: services.py Account rules · auth-context.tsx Session state · auth.ts Auth endpoints · api-client.ts API client
Components 23
Frontend session
- Session state
frontend/lib/auth-context.tsx - Auth endpoints
frontend/lib/api/auth.ts - API client
frontend/lib/api-client.ts - Access token
frontend/lib/auth.ts
Backend accounts
- Account rules
backend/apps/accounts/services.py - User records
backend/apps/accounts/models.py - Phone identity
backend/apps/accounts/phone.py - Identity lookup
backend/apps/accounts/selectors.py - JWT tokens
backend/apps/accounts/tokens.py
API foundation
- Change audit
backend/apps/core/audit.py - API errors
backend/apps/core/handlers.py - Error types
backend/apps/core/exceptions.py - Error envelope
backend/apps/core/responses.py
Student services
- Library discovery
- Seat map and booking
- Online payment
- Memberships
- Attendance
- Complaints
Owner services
- Admission and visits
- Owner dashboard
Other components
- Student
- Library owner
Connections 24
- Student → Session state: uses
- Library owner → Session state: uses
- Session state → Auth endpoints: calls
frontend/lib/auth-context.tsx - Session state → Access token: clears
frontend/lib/auth-context.tsx - Auth endpoints → API client: requests
frontend/lib/api/auth.ts - Auth endpoints → Access token: sets
frontend/lib/api/auth.ts - API client → Access token: reads and refreshes
frontend/lib/api-client.ts - API client → Account rules: calls auth API
- Account rules → User records: creates and updates
backend/apps/accounts/services.py - Account rules → Phone identity: normalizes
backend/apps/accounts/services.py - Account rules → Identity lookup: checks identity
backend/apps/accounts/services.py - Account rules → JWT tokens: issues tokens
backend/apps/accounts/services.py - Account rules → Change audit: records changes
backend/apps/accounts/services.py - Account rules → Error types: raises
backend/apps/accounts/services.py - API errors → Error types: handles
backend/apps/core/handlers.py - API errors → Error envelope: formats
backend/apps/core/handlers.py - Student → Library discovery: discovers
README.md - Student → Seat map and booking: views and books
README.md - Seat map and booking → Online payment: pays online
README.md - Student → Memberships: uses
README.md - Student → Attendance: tracks visits
README.md - Student → Complaints: submits
README.md - Library owner → Admission and visits: manages
README.md - Library owner → Owner dashboard: reviews
README.md