A mobile-enabled library management application with analytics dashboard, built with Express.js, Prisma, MySQL backend and React Native mobile app.
- Authentication: Login/Register with role-based access (Student/Staff/Admin)
- Book Management: Search, browse, and view book details
- Borrowing System: Borrow books with due dates and renewal options
- Reservation System: Reserve books when unavailable
- User Dashboard: View borrowed books, reservations, and due dates
- Book Management: Add, edit, and delete books
- User Management: Manage user accounts and permissions
- Analytics Dashboard: View borrowing trends, popular books, and user statistics
- Overdue Tracking: Monitor and manage overdue books and fines
- Node.js with Express.js
- Prisma ORM with MySQL database
- JWT Authentication
- ES6 Modules
- Input validation and security middleware
- React Native with Expo
- React Navigation for routing
- Axios for API communication
- AsyncStorage for local data persistence
- Blue and White theme as requested
- Node.js (v16 or higher)
- MySQL Server
- Expo CLI (
npm install -g expo-cli)
-
Navigate to the backend directory:
cd backend_server -
Install dependencies:
npm install
-
Configure environment variables:
- Update
.envfile with your MySQL credentials:
DATABASE_URL="mysql://username:password@localhost:3306/library_management" JWT_SECRET="your-super-secret-jwt-key-change-in-production" PORT=8060 NODE_ENV=development
- Update
-
Set up the database:
# Generate Prisma client npx prisma generate # Run database migrations npx prisma migrate dev --name init # (Optional) Seed the database npx prisma db seed
-
Start the backend server:
npm run dev
The backend will be running on http://localhost:8060
-
Navigate to the mobile app directory:
cd mobile_app -
Install dependencies:
npm install
-
Update API URL:
- In
src/services/api.js, update theBASE_URLto match your backend server - For development:
http://your-ip-address:8060/api(replace with your computer's IP)
- In
-
Start the mobile app:
npm start
-
Use Expo Go app on your phone or run on simulator/emulator
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current user
GET /api/books- Get books with search/filterGET /api/books/:id- Get book detailsPOST /api/books- Add new book (Staff/Admin only)PUT /api/books/:id- Update book (Staff/Admin only)DELETE /api/books/:id- Delete book (Staff/Admin only)
GET /api/borrows- Get user's borrowsPOST /api/borrows- Borrow a bookPUT /api/borrows/:id/return- Return a book (Staff/Admin)PUT /api/borrows/:id/renew- Renew a book
GET /api/reservations- Get user's reservationsPOST /api/reservations- Reserve a bookDELETE /api/reservations/:id- Cancel reservation
GET /api/analytics/dashboard- Dashboard statisticsGET /api/analytics/user-stats- User statisticsGET /api/analytics/book-stats- Book statisticsGET /api/analytics/trends- Borrowing trends
- Authentication and profile information
- Role-based access (STUDENT, STAFF, ADMIN)
- Auto-generated Student ID for students (format: C22-0043)
- Complete book information (title, author, ISBN, etc.)
- Inventory tracking (total copies, available copies)
- Category classification
- Borrowing records with due dates
- Renewal tracking and fine calculations
- Status management (ACTIVE, RETURNED, OVERDUE)
- Book reservation system
- Expiration date management
- Daily statistics tracking
- Dashboard metrics
- Can browse and search books
- Can borrow available books
- Can reserve unavailable books
- Can view their borrowing history
- All student permissions
- Can manage books (add, edit, delete)
- Can process returns and renewals
- Can view basic analytics
- All staff permissions
- Can manage users
- Can access full analytics dashboard
- Can manage system settings
- Clean login/register screens with blue and white theme
- Role selection during registration
- Secure token-based authentication
- Search books by title, author, or ISBN
- Filter by categories
- View book details with availability status
- View borrowed books with due dates
- Track reservations
- Renewal requests
- View personal information
- Update profile details
- Change password
Students are automatically assigned IDs in the format C[YY]-[NNNN] where:
- C = prefix for current system
- YY = last two digits of current year
- NNNN = 4-digit random number
- Password hashing with bcrypt
- JWT token authentication
- Rate limiting
- Input validation and sanitization
- CORS configuration
- Helmet security headers
- Context-based state management
- Axios interceptors for automatic token handling
- Offline-capable with AsyncStorage
- Responsive design for various screen sizes
For issues and feature requests, please refer to the project documentation or contact the development team.