How chandrahaas11/elibrary works
Elibrary is a browser-based library catalog backed by an Express API and MongoDB. The main workflow is browsing or filtering books, opening a record, and submitting a rating; users can also authenticate, manage profiles, and choose a role. Admins upload catalog files and view dashboard and user data. The graph includes the documented Firebase and Cloudinary integrations. Some UI-to-API and storage relationships are based on endpoint paths or documented technology rather than inspected runtime wiring, so those links are dashed where unverified.
Main entry points: apiSlice.js API client · server.js Express API server · admin.controller.js Admin operations · auth.middleware.js Access control
Components 27
Web experience
- App routing
frontend/src/App.jsx - Home and browse
frontend/src/pages/HomePage.jsx - Book list
frontend/src/components/books/BookList.jsx - Book details
frontend/src/pages/BookDetailPage.jsx - Rating form
frontend/src/components/books/RatingForm.jsx - API client
frontend/src/store/slices/apiSlice.js
Identity and profiles
- Session state
frontend/src/store/slices/authSlice.js - User login
frontend/src/pages/LoginPage.jsx - Registration
frontend/src/pages/RegisterPage.jsx - Firebase client
frontend/src/utils/firebase.js - User profile
frontend/src/pages/ProfilePage.jsx - User operations
backend/controllers/user.controller.js - Authentication
backend/controllers/auth.controller.js - Access control
backend/middlewares/auth.middleware.js - Firebase Admin
backend/config/firebaseAdmin.js
Catalog and ratings
- Book operations
backend/controllers/book.controller.js - Book records
backend/models/book.model.js - Rating records
backend/models/rating.model.js - Express API server
backend/server.js
Administration
- Admin dashboard
frontend/src/pages/AdminDashboardPage.jsx - Book upload form
frontend/src/pages/AdminUploadPage.jsx - Admin operations
backend/controllers/admin.controller.js - File upload handler
backend/middlewares/upload.middleware.js - File storage service
backend/services/cloudinary.service.js
Other components
- Library visitor
- MongoDB
- Firebase service
Connections 35
- Library visitor → App routing: opens
frontend/src/App.jsx - App routing → Home and browse: routes to
frontend/src/App.jsx - App routing → Book details: routes to
frontend/src/App.jsx - Home and browse → Book list: renders
frontend/src/pages/HomePage.jsx - Book details → Rating form: renders
frontend/src/pages/BookDetailPage.jsx - Home and browse → API client: requests books
- Book details → API client: requests details
frontend/src/pages/BookDetailPage.jsx - Rating form → API client: submits rating
- User login → Firebase client: authenticates with
frontend/src/pages/LoginPage.jsx - Registration → Firebase client: authenticates with
frontend/src/pages/RegisterPage.jsx - User login → API client: logs in through
frontend/src/pages/LoginPage.jsx - Registration → API client: registers through
frontend/src/pages/RegisterPage.jsx - API client → Session state: reads token
- User profile → API client: loads profile
frontend/src/pages/ProfilePage.jsx - API client → Express API server: sends API requests
- Express API server → Authentication: mounts auth routes
backend/server.js - Express API server → Book operations: mounts book routes
backend/server.js - Express API server → User operations: mounts user routes
backend/server.js - Express API server → Admin operations: mounts admin routes
backend/server.js - Authentication → Firebase Admin: verifies Firebase tokens
backend/controllers/auth.controller.js - Firebase Admin → Firebase service: initializes SDK
backend/config/firebaseAdmin.js - Authentication → Access control: issues session tokens
- Access control → User operations: protects routes
backend/routes/user.routes.js - Access control → Book operations: protects rating route
backend/routes/book.routes.js - Access control → Admin operations: guards admin routes
backend/routes/admin.routes.js - Book operations → Book records: reads and updates
backend/controllers/book.controller.js - Book operations → Rating records: reads and creates
backend/controllers/book.controller.js - User operations → MongoDB: persists profile data
- Book records → MongoDB: stores records
- Rating records → MongoDB: stores ratings
- Admin dashboard → API client: loads dashboard
frontend/src/pages/AdminDashboardPage.jsx - Book upload form → API client: uploads book
frontend/src/pages/AdminUploadPage.jsx - Admin operations → Book records: creates book
backend/controllers/admin.controller.js - Admin operations → File upload handler: receives uploaded file
backend/routes/admin.routes.js - Admin operations → File storage service: uploads file
backend/controllers/admin.controller.js