How clarkwalker197-glitch/cpclms_v3-main works
CPCLMS is a library-management web application: patrons and librarians use the Next.js frontend to authenticate, browse the catalog, request or reserve books, and complete librarian-led QR or manual approvals; the Express API enforces roles and business rules and persists library records. Other documented capabilities include e-books, archives, notifications, reports, analytics, activity logs, policies, and offline synchronization. The excerpts show transaction and authentication routing, controller-to-service calls, and media-storage code; other subsystem links reflect README documentation and are marked accordingly. Database schema details and unsampled subsystem internals are not shown.
Main entry points: app Next.js pages · index.ts API route registry · auth.controller.ts Authentication controller · api.ts API client
Components 26
Web application
- Next.js pages
frontend/app - Offline cache and queue
frontend/lib/offline-db.ts - API client
frontend/lib/api.ts - Auth context
frontend/lib/auth-context.tsx - Service worker
frontend/public/sw.js
API and access
- Express application
backend/src/app.ts - API route registry
backend/src/routes/index.ts - Authentication routes
backend/src/routes/auth.routes.ts - Transaction routes
backend/src/routes/transaction.routes.ts - Authentication controller
backend/src/controllers/auth.controller.ts - Transaction controller
backend/src/controllers/transaction.controller.ts
Library services
- Authentication service
backend/src/services/auth.service.ts - Borrowing and reservations
backend/src/services/transaction.service.ts - Book catalog
backend/src/services/book.service.ts - E-book management
backend/src/services/ebook.service.ts - Archive retention
backend/src/services/archive-retention.service.ts - Reports and analytics
backend/src/services/report.service.ts - Notifications
backend/src/services/notification.service.ts - Activity logging
backend/src/services/activity-log.service.ts
Media storage
- Upload middleware
backend/src/middlewares/upload.ts - Cover image storage
backend/src/services/cover-image-storage.service.ts - Profile image storage
backend/src/services/profile-image-storage.service.ts - E-book file storage
backend/src/services/ebook-file-storage.service.ts
Other components
- Patrons and librarians
- PostgreSQL
- Vercel Blob
Connections 26
- Patrons and librarians → Next.js pages: uses
- Next.js pages → API client: requests data
- Next.js pages → Auth context: uses auth
frontend/lib/auth-context.tsx - Offline cache and queue → API client: queues mutations
- Service worker → Next.js pages: caches shell
- API client → Express application: calls API
- Express application → API route registry: mounts routes
backend/src/app.ts - API route registry → Authentication routes: registers
backend/src/routes/index.ts - API route registry → Transaction routes: registers
backend/src/routes/index.ts - Authentication routes → Authentication controller: routes requests
backend/src/routes/auth.routes.ts - Transaction routes → Transaction controller: routes requests
backend/src/routes/transaction.routes.ts - Authentication controller → Authentication service: calls
backend/src/controllers/auth.controller.ts - Transaction controller → Borrowing and reservations: calls
backend/src/controllers/transaction.controller.ts - Authentication service → PostgreSQL: persists records
- Borrowing and reservations → PostgreSQL: persists transactions
- Book catalog → PostgreSQL: stores catalog
- E-book management → PostgreSQL: stores metadata
- Archive retention → PostgreSQL: purges expired records
- Reports and analytics → PostgreSQL: queries metrics
- Notifications → PostgreSQL: stores notifications
- Activity logging → PostgreSQL: stores activity
- Upload middleware → Cover image storage: validates uploads
backend/src/middlewares/upload.ts - Authentication controller → Profile image storage: stores profile image
backend/src/controllers/auth.controller.ts - Cover image storage → Vercel Blob: uploads images
backend/src/services/cover-image-storage.service.ts - Profile image storage → Vercel Blob: uploads images
backend/src/services/profile-image-storage.service.ts - E-book file storage → Vercel Blob: uploads files
backend/src/services/ebook-file-storage.service.ts