A full-stack MERN (MongoDB, Express, React, Node.js) application for tracking your personal book collection and reading progress.
- Frontend: Demo Link
- Backend API: API Documentation
Main dashboard showing reading statistics and recent activity
Complete library view with filtering and sorting options
Form for adding books manually or via Google Books API
Detailed view of a book with reading progress and notes
User profile with reading preferences and statistics
View of all registered users with management options
Authentication screen for user login
Mobile-responsive layout showing adaptability across devices
- Add Books: Manually add books or search using Google Books API
- Book Details: Track title, author, genre, status, description, ISBN, page count
- Cover Images: Upload custom book covers
- Status Tracking: Want to Read, Currently Reading, Read
- Reading Progress: Track current page and reading percentage
- Reviews & Ratings: Add personal ratings and review comments
- Notes: Add personal notes and thoughts about books
- Authentication: Secure user registration and login
- Profile Management: Customize profile with avatar, bio, and preferences
- Reading Goals: Set and track annual reading goals
- Privacy Settings: Control profile visibility and data sharing
- Notifications: Configure reading reminders and goal alerts
- Reading Statistics: Track total books, pages read, average ratings
- Progress Dashboard: Visualize reading goals and monthly progress
- Genre Analytics: See your reading preferences by genre
- Reading History: Track when books were started and finished
- Search & Filter: Find books by title, author, genre, status
- Pagination: Efficient browsing of large book collections
- Google Books Integration: Search and import book data automatically
- Responsive Design: Works seamlessly on desktop and mobile
- Dark/Light Theme: Choose your preferred viewing experience
- Node.js with Express.js framework
- MongoDB with Mongoose ODM
- JWT for authentication
- Multer for file uploads
- Helmet for security
- Express Rate Limit for API protection
- Axios for Google Books API integration
- React with TypeScript
- Material-UI (MUI) for component library
- React Router for navigation
- Axios for API communication
- Context API for state management
personal-library-tracker/
βββ backend/
β βββ models/
β β βββ User.js
β β βββ Book.js
β βββ routes/
β β βββ auth.js
β β βββ books.js
β β βββ user.js
β βββ middleware/
β β βββ auth.js
β β βββ upload.js
β βββ uploads/
β βββ .env
β βββ server.js
β βββ package.json
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ Navbar.tsx
β β βββ pages/
β β β βββ Login.tsx
β β β βββ Register.tsx
β β β βββ Dashboard.tsx
β β β βββ Books.tsx
β β β βββ AddBook.tsx
β β β βββ BookDetail.tsx
β β β βββ EditBook.tsx
β β β βββ Profile.tsx
β β βββ services/
β β β βββ api.ts
β β β βββ authService.ts
β β β βββ bookService.ts
β β βββ contexts/
β β β βββ AuthContext.tsx
β β βββ App.tsx
β β βββ index.tsx
β βββ package.json
βββ package.json
-
Clone the repository:
git clone https://github.com/yourusername/personal-library-tracker.git cd personal-library-tracker -
Install dependencies:
npm install
-
Set up environment variables:
cp backend/.env.example backend/.env # Edit backend/.env with your configuration -
Start the development servers:
npm run dev
-
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
MongoDB Connection Issues
# Make sure MongoDB is running
# For Windows:
net start MongoDB
# For macOS with Homebrew:
brew services start mongodb-community
# For Linux:
sudo systemctl start mongodPort Already in Use
# Kill process using port 5000 (backend)
npx kill-port 5000
# Kill process using port 3000 (frontend)
npx kill-port 3000File Upload Issues
- Ensure the
uploadsdirectory exists in the backend folder - Check file permissions on the uploads directory
- Verify MAX_FILE_SIZE in your .env file
Google Books API Issues
- Ensure you have a valid Google Books API key
- Check your API key quota and usage limits
- Verify the API key is correctly set in your .env file
- Node.js (v14 or higher)
- MongoDB (local installation or MongoDB Atlas)
- npm or yarn package manager
-
Navigate to backend directory:
cd backend -
Install dependencies:
npm install
-
Environment Configuration: Create a
.envfile in the backend directory:PORT=5000 MONGODB_URI=mongodb://localhost:27017/personal-library-tracker JWT_SECRET=your_super_secure_jwt_secret_key_here JWT_EXPIRE=7d JWT_REFRESH_SECRET=your_super_secure_refresh_secret_key_here JWT_REFRESH_EXPIRE=30d GOOGLE_BOOKS_API_KEY=your_google_books_api_key_here UPLOAD_DIR=uploads MAX_FILE_SIZE=5000000 NODE_ENV=development
-
Start the backend server:
npm run dev
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start the development server:
npm start
To run both servers concurrently, from the root directory:
npm install
npm run devPOST /api/auth/register- Register new userPOST /api/auth/login- User loginGET /api/auth/me- Get current userPOST /api/auth/refresh- Refresh JWT token
GET /api/books- Get user's books (with pagination & filters)POST /api/books- Add new bookGET /api/books/:id- Get specific bookPUT /api/books/:id- Update bookDELETE /api/books/:id- Delete bookPOST /api/books/:id/cover- Upload book coverPUT /api/books/:id/progress- Update reading progressPOST /api/books/:id/review- Add/update book reviewGET /api/books/stats- Get reading statisticsGET /api/books/search/google- Search Google Books API
GET /api/user/profile- Get user profilePUT /api/user/profile- Update user profilePOST /api/user/avatar- Upload profile avatarGET /api/user/dashboard- Get dashboard data
- Want to Read: Books you plan to read
- Currently Reading: Books you're actively reading (with progress tracking)
- Read: Completed books (with optional reviews and ratings)
- Track current page for books you're reading
- Automatic percentage calculation
- Visual progress indicators
- Reading statistics and trends
- 5-star rating system
- Written review comments
- Review date tracking
- Personal reading insights
- Search millions of books
- Automatic metadata import
- Cover image retrieval
- ISBN and publication data
- Customizable reading goals
- Favorite genre tracking
- Privacy settings
- Notification preferences
- JWT Authentication: Secure token-based authentication
- Password Hashing: bcrypt for secure password storage
- Rate Limiting: Protection against API abuse
- CORS: Configured for secure cross-origin requests
- Helmet: Security headers for Express
- Input Validation: Server-side validation for all inputs
- File Upload Security: Restricted file types and sizes
Create a .env file in the backend directory with the following variables:
# Production Configuration
NODE_ENV=production
PORT=5000
# Database (use MongoDB Atlas for production)
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/personal-library-tracker
# JWT Secrets (use strong, random strings)
JWT_SECRET=your_production_jwt_secret_minimum_32_characters
JWT_EXPIRE=7d
JWT_REFRESH_SECRET=your_production_refresh_secret_minimum_32_characters
JWT_REFRESH_EXPIRE=30d
# Google Books API
GOOGLE_BOOKS_API_KEY=your_google_books_api_key
# File Upload
UPLOAD_DIR=uploads
MAX_FILE_SIZE=5000000
# CORS
FRONTEND_URL=https://your-frontend-domain.com- Create a Heroku app
- Set environment variables in Heroku dashboard
- Connect your GitHub repository
- Deploy the backend to Heroku
- Deploy the frontend to Netlify/Vercel
- Set up a Ubuntu server
- Install Node.js and MongoDB
- Clone your repository
- Configure environment variables
- Use PM2 for process management
- Set up nginx as reverse proxy
# Use the provided Dockerfile
docker build -t personal-library-tracker .
docker run -p 5000:5000 personal-library-tracker- Set strong JWT secrets
- Use MongoDB Atlas or secure MongoDB instance
- Configure CORS for your domain
- Set up HTTPS
- Configure rate limiting
- Set up error logging
- Configure file upload limits
- Set up database backups
- Pagination: Efficient loading of large book collections
- Lazy Loading: Images loaded on demand
- Caching: API responses cached for better performance
- Database Indexing: Optimized queries for fast searches
- File Compression: Uploaded images are compressed
- Code Splitting: React components loaded as needed
- Use tools like New Relic or DataDog for performance monitoring
- Set up error tracking with Sentry
- Monitor database performance
- Track API response times
- JWT-based authentication with refresh tokens
- Password hashing with bcrypt
- Protected routes and middleware
- Role-based access control ready
- Input validation and sanitization
- SQL injection prevention with Mongoose
- XSS protection with Helmet
- CORS configuration
- Rate limiting to prevent abuse
- File upload restrictions
- Environment variables for sensitive data
- Secure headers with Helmet
- Regular security audits
- Dependency vulnerability scanning
- Reading streak tracking
- Books read per month/year
- Favorite genres analysis
- Reading pace statistics
- Goal achievement tracking
- Progress charts and graphs
- Reading habit heatmaps
- Genre distribution pie charts
- Monthly reading trends
- Frontend: React 18 with TypeScript
- Backend: Node.js with Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (JSON Web Tokens)
- UI Framework: Material-UI (MUI) v5
- API Integration: Google Books API
- Version Control: Git
- Package Manager: npm
- Code Editor: VS Code (recommended)
- API Testing: Postman/Thunder Client
- Database GUI: MongoDB Compass
- Frontend Hosting: Netlify, Vercel, or AWS S3
- Backend Hosting: Heroku, DigitalOcean, or AWS EC2
- Database: MongoDB Atlas (cloud)
- File Storage: Local storage or AWS S3
- CI/CD: GitHub Actions (optional)
- Set up MongoDB Atlas or ensure MongoDB is available
- Configure environment variables for production
- Deploy to platforms like Heroku, AWS, or DigitalOcean
- Ensure file upload directory is configured properly
- Build the React application:
npm run build
- Deploy to platforms like Netlify, Vercel, or AWS S3
- Configure API base URL for production
Consider containerizing the application with Docker for consistent deployments across environments.
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Add tests if applicable
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Submit a pull request
- Follow the existing code style
- Use TypeScript for new frontend components
- Add proper error handling
- Include comments for complex logic
- Update documentation as needed
- Use the GitHub issue tracker
- Include detailed reproduction steps
- Add screenshots if applicable
- Specify your environment (OS, Node.js version, etc.)
# Run backend tests
cd backend
npm test
# Run frontend tests
cd frontend
npm test# Generate test coverage report
npm run test:coverage| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/auth/register |
Register new user | No |
| POST | /api/auth/login |
User login | No |
| GET | /api/auth/me |
Get current user | Yes |
| POST | /api/auth/refresh |
Refresh JWT token | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/books |
Get user's books | Yes |
| POST | /api/books |
Add new book | Yes |
| GET | /api/books/:id |
Get specific book | Yes |
| PUT | /api/books/:id |
Update book | Yes |
| DELETE | /api/books/:id |
Delete book | Yes |
| PUT | /api/books/:id/status |
Update book status | Yes |
| POST | /api/books/:id/cover |
Upload book cover | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/books/stats |
Get reading statistics | Yes |
| GET | /api/books/search/google |
Search Google Books API | Yes |
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Documentation
- Check the Setup Guide for detailed installation instructions
- Review the MongoDB Setup Guide for database configuration
- Read the API Documentation for endpoint details
Community Support
- π Report bugs
- π‘ Request features
- π¬ Join discussions
Contact
- Email: your-email@example.com
- GitHub: @yourusername
- Twitter: @yourusername
Q: How do I reset my password? A: Currently, password reset functionality is not implemented. You'll need to contact support or reset your data.
Q: Can I export my book data? A: Data export functionality is planned for a future release. You can currently access your data through the API.
Q: Is there a mobile app? A: Not yet, but the web application is fully responsive and works well on mobile devices.
Q: How do I get a Google Books API key? A: Visit the Google Cloud Console, create a project, enable the Books API, and generate an API key.
This project is licensed under the MIT License - see the LICENSE file for details.
- Material-UI: MIT License
- React: MIT License
- Express: MIT License
- MongoDB: Server Side Public License (SSPL)
- Thanks to all contributors who have helped improve this project
- Special thanks to the open-source community for the amazing tools and libraries
- Inspired by Goodreads and other book tracking applications
- Built with modern web development best practices
- Designed with user experience in mind
- React Documentation
- Material-UI Documentation
- Express.js Documentation
- MongoDB Documentation
- Google Books API Documentation
For support, email your-email@example.com or create an issue in the GitHub repository.
- Social features (friend connections, book recommendations)
- Book clubs and group reading challenges
- Advanced analytics and reading insights
- Export/import functionality
- Mobile app development
- Goodreads integration
- Public book lists and sharing
- Advanced search with filters
- Reading streak tracking
- Author following and new book notifications
Happy Reading! πβ¨