A full-stack web application that provides personalized book recommendations using collaborative filtering and graph database technology. Built with modern technologies including NestJS, React, Neo4j, and TypeScript.
- π Authentication: Secure JWT + httpOnly cookie-based authentication
- π Book Browsing: Search and filter through extensive book collection
- π Reactions: Like, love, hate books to build your taste profile
- β Favorites: Bookmark your favorite books
- π― Personalized Recommendations: AI-powered collaborative filtering
- π Trending & Popular: Discover what's trending and most-loved
- π Advanced Search: Search by title, author, or category
- π¨ Modern Dark UI: Beautiful, responsive design with animations
- π Book Management: Create, update, delete books
- π·οΈ Category Management: Organize books into categories
- π Analytics Dashboard: View interaction statistics
- Framework: NestJS (Node.js)
- Database: Neo4j (Graph Database)
- Authentication: JWT + httpOnly Cookies
- Validation: class-validator, class-transformer
- API Documentation: Swagger/OpenAPI
- Language: TypeScript
- Framework: React 18
- Build Tool: Vite
- Routing: TanStack Router (Type-safe routing)
- State Management: TanStack Query v5 (Server state)
- Styling: Tailwind CSS v4
- HTTP Client: Axios
- Icons: Lucide React
- Language: TypeScript
- Graph Database: Neo4j for relationship-based recommendations
- RESTful API: 31 documented endpoints
- Cookie-Based Sessions: Secure httpOnly cookies
- Collaborative Filtering: User-based recommendation algorithm
booksNoe/
βββ backend/ # NestJS Backend
β βββ src/
β β βββ auth/ # Authentication module
β β βββ books/ # Books CRUD & search
β β βββ categories/ # Category management
β β βββ interactions/ # Reactions & favorites
β β βββ recommendations/# Recommendation algorithms
β β βββ users/ # User management
β β βββ neo4j/ # Neo4j service
β β βββ common/ # Guards, decorators, types
β βββ package.json
β βββ tsconfig.json
β
βββ frontend/ # React Frontend
β βββ src/
β β βββ components/ # Reusable components
β β βββ pages/ # Page components
β β βββ hooks/ # Custom React hooks
β β βββ context/ # Auth context
β β βββ lib/ # Utilities & config
β β βββ types/ # TypeScript types
β βββ package.json
β βββ vite.config.ts
β
βββ .gitignore
βββ README.md
- Node.js (v18 or higher)
- Neo4j Database (v5 or higher)
- npm or yarn package manager
- Navigate to backend directory:
cd backend- Install dependencies:
npm install- Create
.envfile in backend directory:
# Database
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=your_password
# JWT
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
JWT_EXPIRES_IN=24h
# Server
PORT=3000
NODE_ENV=development-
Start Neo4j database and ensure it's running
-
Run database migrations (constraints will be created automatically on first run)
-
Start development server:
npm run start:devBackend will be available at: http://localhost:3000
Swagger API documentation: http://localhost:3000/api
- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Create
.envfile in frontend directory (optional):
VITE_API_URL=http://localhost:3000- Start development server:
npm run devFrontend will be available at: http://localhost:5173 (or next available port)
POST /auth/register- Register new userPOST /auth/login- Login with username/passwordPOST /auth/logout- Logout and clear session
GET /books- Get all books (with pagination & search)GET /books/search- Search books by queryGET /books/:id- Get single bookPOST /books- Create book (Admin only)PATCH /books/:id- Update book (Admin only)DELETE /books/:id- Delete book (Admin only)
POST /interactions/books/:bookId/react- React to book (LIKES/HATES/LOVES)DELETE /interactions/books/:bookId/react- Remove reactionPOST /interactions/books/:bookId/favorite- Add to favoritesDELETE /interactions/books/:bookId/favorite- Remove from favorites
GET /recommendations/for-me- Personalized recommendations (Auth required)GET /recommendations/similar/:bookId- Similar booksGET /recommendations/trending- Trending books (last 30 days)GET /recommendations/popular- Most popular books
GET /categories- Get all categoriesPOST /categories- Create category (Admin only)PATCH /categories/:id- Update category (Admin only)DELETE /categories/:id- Delete category (Admin only)
The platform uses collaborative filtering based on graph relationships:
- User-based CF: Finds users with similar taste (shared loves/likes)
- Item-based CF: Finds books in same categories
- Interaction Scoring:
- LOVES: 3 points
- LIKES: 2 points
- FAVORITES: 1 point
- HATES: excluded from recommendations
- JWT tokens with httpOnly cookies (prevents XSS)
- Password hashing with bcrypt
- Role-based access control (USER/ADMIN)
- CORS configuration
- Input validation and sanitization
- Protected routes with guards
- Responsive design (mobile-first)
- Dark mode theme
- Smooth animations and transitions
- Loading states and error handling
- Gradient effects and glassmorphism
- Accessible form controls
cd backend
npm run build
npm run start:prodcd frontend
npm run build
# Serve the dist/ folder with your preferred static servercd backend
npm run test # Unit tests
npm run test:e2e # E2E tests
npm run test:cov # Coveragecd frontend
npm run testContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
Built with β€οΈ using modern web technologies
- None at the moment
- Real-time notifications
- User profiles with reading stats
- Book reviews and ratings
- Social features (follow users)
- Reading lists
- Dark/Light mode toggle
- Mobile app (React Native)
- Email notifications
- Advanced filtering options
- Export recommendations
For support, please open an issue in the GitHub repository.
Happy Reading! πβ¨