How rohit-10-ui/library-management-system works
1. This repository is a two-tier full-stack system: a Spring Boot backend in the root src/ tree and a separate React frontend in frontend/. The two halves are developed and run independently, with the frontend calling backend HTTP APIs.
2. The backend is the authoritative application layer. Its entry point is LibraryManagementSystemApplication.java, built with Gradle and configured through src/main/resources/application.properties. The only visible persistence target is MySQL, accessed through Spring Data JPA.
3. The backend is currently centered on authentication and user registration rather than the broader library features described in the README. The visible REST surface is AuthController, which is the main boundary between the frontend and backend.
4. User registration is split by user type. StudentSignupService and LibrarianSignupService implement the signup logic, and SignupServiceFactory selects the correct service. This suggests a strategy/factory pattern around registration workflows.
5. Domain state in the backend is modeled with User, Role, and ApprovalStatus. These entities imply that accounts have role-based behavior and that at least some registrations may require approval before becoming active.
6. Data access is isolated in UserRepository, which is the persistence boundary for user records. The service layer sits between controllers and the repository, so the flow is: React form input → controller → signup service/factory → repository → MySQL.
7. The frontend is a React single-page application with entry files in frontend/src/index.js and App.jsx/App.js. The visible UI pieces are Landing, Login, and Signup, plus styling files, which indicates the current frontend scope is user-facing onboarding/auth screens.
8. The frontend’s job is presentation and API invocation, not business rules. The README references Axios for HTTP calls, so the frontend likely posts signup/login data to the backend API and renders responses such as success, failure, or approval status.
9. Build and runtime boundaries are cleanly separated. Gradle handles the Java backend build and test lifecycle, while npm handles the React app. This makes the repo deployable as two artifacts: a backend service and a frontend static/client bundle.
10. Testing is also split by tier. There is a Spring Boot test class under src/test/..., and the React app includes App.test.js with standard React testing setup files.
11. The README describes a larger “library management system” with books, borrowing, admin dashboards, and search, but those subsystems are not present in the current file tree. For an architecture diagram, the accurate live system is the auth/registration slice, with the rest appearing to be planned or undocumented.
12. External infrastructure is minimal and important: a local MySQL database on port 3306, a backend API on port 8080, and a React development server on port 3000. Those are the key deployment/runtime nodes to show in a diagram.
Main entry points: App.js Main shell · UserRepository.java User repository · SignupServiceFactory.java Signup factory · User.java User
Components 18
Spring Boot backend
Auth and registration API with JPA persistence
- Backend app · Application bootstrap for the backend service
src/main/java/com/example/library_management_system/LibraryManagementSystemApplication.java - Auth API · Main HTTP boundary for login and signup
src/main/java/com/example/library_management_system/conroller/AuthController.java - Signup factory · Selects the registration workflow by user type
src/main/java/com/example/library_management_system/service/SignupServiceFactory.java - Student signup · Handles student registration logic
src/main/java/com/example/library_management_system/service/StudentSignupService.java - Librarian signup · Handles librarian registration logic
src/main/java/com/example/library_management_system/service/LibrarianSignupService.java - User repository · Persistence boundary for user records
src/main/java/com/example/library_management_system/repository/UserRepository.java - User · Core account record
src/main/java/com/example/library_management_system/entity/User.java - Role · Role-based access state
src/main/java/com/example/library_management_system/entity/Role.java - Approval status · Registration approval state
src/main/java/com/example/library_management_system/entity/ApprovalStatus.java - App config · Backend runtime and datasource configuration
src/main/resources/application.properties
React frontend
Client-side onboarding and API calls
- React app · Client-side application bootstrap
frontend/src/index.js - Main shell · Top-level React component tree
frontend/src/App.js - Landing page · Entry screen for the public site
frontend/src/Landing.jsx - Login screen · Authentication form for existing users
frontend/src/Login.jsx - Signup screen · Registration form for new users
frontend/src/Signup.jsx
Runtime & data
Local development endpoints and database
- Backend API · Spring Boot service exposed to the frontend
- MySQL · Local persistence store on port 3306
- React dev server · Frontend development server on port 3000
Connections 19
- React app → Main shell: mounts · Bootstraps the SPA shell
- Main shell → Landing page: renders · Shows the landing experience
- Main shell → Login screen: renders · Routes to login UI
- Main shell → Signup screen: renders · Routes to signup UI
- Signup screen → Backend API: POST signup · Submits registration data to the backend
- Login screen → Backend API: POST login · Sends authentication requests
- React dev server → React app: serves · Hosts the React client during development
- Backend API → Backend app: runs · Backend service runtime
- Backend app → Auth API: exposes · Starts the REST API surface
- Auth API → Signup factory: delegates · Routes registration by user type
- Signup factory → Student signup: selects · Student signup workflow
- Signup factory → Librarian signup: selects · Librarian signup workflow
- Student signup → User repository: persists · Stores new student accounts
- Librarian signup → User repository: persists · Stores new librarian accounts
- User repository → User: maps · Repository operates on user entities
- User → Role: uses · Associates accounts with roles
- User → Approval status: uses · Tracks approval state
- User repository → MySQL: reads/writes · JPA persistence against MySQL
- App config → MySQL: configures · Datasource settings point to MySQL