Skip to content

mayank-pillai-99/BookConnect-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š BookConnect

A social networking platform for book lovers to connect, share, and discuss their literary passions

Live Demo


🎯 Problem Statement

Book readers often struggle to find like-minded individuals to discuss their favorite books, share recommendations, and engage in meaningful literary conversations. Traditional social media platforms lack the focused environment needed for book discussions, and local book clubs may not always be accessible or match personal preferences.

BookConnect bridges this gap by connecting book enthusiasts based on their reading interests, allowing them to discover fellow readers and engage in real-time discussions about their literary journeys.


✨ Key Features

πŸ” Authentication & Authorization

  • Secure user registration and login
  • JWT-based session management
  • Protected routes with authentication guards

πŸ‘€ Profile Management

  • Create and customize user profiles
  • Add reading preferences and favorite books
  • Update bio and personal information
  • Manage book lists (add/remove favorites)

πŸ” User Discovery & Pagination

  • Browse book readers through a paginated feed
  • Efficient loading with 10 users per page
  • Smooth navigation between pages

🀝 Connection System

  • Send interest/ignore requests to other readers
  • Accept or reject incoming connection requests
  • View all established connections
  • Manage pending requests

πŸ’¬ Real-time Chat

  • Instant messaging with connected users
  • Socket.io powered real-time communication
  • Chat history persistence

πŸ”Ž Search & Filter System

  • Search users by name
  • Filter by favorite books and genres
  • Sort results by relevance or alphabetically

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend  β”‚ ───► β”‚   Backend   β”‚ ───► β”‚  Database   β”‚
β”‚  (React.js) β”‚ ◄─── β”‚ (Express.js)β”‚ ◄─── β”‚  (MongoDB)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                     β”‚
       β”‚                     β”‚
       └──────Socket.ioβ”€β”€β”€β”€β”€β”€β”˜
         (Real-time Chat)

Components

  • Frontend: React.js with React Router for navigation
  • Backend: Node.js + Express.js REST API
  • Database: MongoDB (NoSQL)
  • Real-time: Socket.io for instant messaging
  • Authentication: JWT-based secure authentication

πŸ› οΈ Tech Stack

Layer Technologies
Frontend React.js, React Router, Redux Toolkit, Axios
Styling Tailwind CSS, DaisyUI
Backend Node.js, Express.js, Socket.io
Database MongoDB with Mongoose ODM
Authentication JWT (JSON Web Tokens)
Real-time Socket.io for instant messaging
Deployment Vercel (Frontend), Render (Backend), MongoDB Atlas

πŸš€ Deployment

Service Platform URL
Frontend Vercel book-connect-frontend.vercel.app
Backend Render bookconnect-backend.onrender.com
Database MongoDB Atlas Cloud-hosted

πŸ“‘ API Overview

Public Endpoints

Endpoint Method Description
/signup POST Register new book reader
/login POST Authenticate user

Protected Endpoints (Require Authentication)

Profile Management

Endpoint Method Description
/profile/view GET Get current user profile
/profile/edit PATCH Update user profile
/profile/genres PATCH Update favorite genres
/profile/books/add POST Add a book to favorites
/profile/books/remove DELETE Remove a book from favorites
/profile/delete DELETE Permanently delete user account

Connection System

Endpoint Method Description
/request/send/:status/:toUserId POST Send connection request (interested/ignored)
/request/review/:status/:requestId POST Accept/reject connection request
/user/requests/received GET Get pending connection requests
/user/connections GET Get all accepted connections

Feed & Discovery

Endpoint Method Description
/feed GET Get paginated feed with search, sort & filter

Chat

Endpoint Method Description
/chat/:targetUserId GET Get chat history with specific user
/logout POST End user session

🎨 Features Showcase

  • βœ… Secure Authentication - JWT-based with httpOnly cookies
  • βœ… Real-time Messaging - Instant chat with Socket.io
  • βœ… Responsive Design - Works seamlessly on all devices
  • βœ… State Management - Redux Toolkit for efficient state handling
  • βœ… Protected Routes - Authentication guards for secure pages
  • βœ… Persistent Sessions - User data persists across page refreshes
  • βœ… Search & Filter - Find readers by name, books, and genres
  • βœ… Connection Management - Send, accept, reject requests
  • βœ… Profile Customization - Personalize your reading profile
  • βœ… Modern UI/UX - Glassmorphism design with smooth animations

🚦 Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB
  • npm or yarn

Installation

  1. Clone the repository
git clone https://github.com/yourusername/bookconnect-frontend.git
cd bookconnect-frontend
  1. Install dependencies
npm install
  1. Configure environment
  • Update src/utils/constants.js with your backend URL
  1. Run development server
npm run dev
  1. Build for production
npm run build

πŸ“‚ Project Structure

bookconnect-frontend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ Components/
β”‚   β”‚   β”œβ”€β”€ Body.jsx
β”‚   β”‚   β”œβ”€β”€ Chat.jsx
β”‚   β”‚   β”œβ”€β”€ Connections.jsx
β”‚   β”‚   β”œβ”€β”€ EditProfile.jsx
β”‚   β”‚   β”œβ”€β”€ Feed.jsx
β”‚   β”‚   β”œβ”€β”€ Footer.jsx
β”‚   β”‚   β”œβ”€β”€ Login.jsx
β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   β”œβ”€β”€ Profile.jsx
β”‚   β”‚   β”œβ”€β”€ ProtectedRoute.jsx
β”‚   β”‚   β”œβ”€β”€ Requests.jsx
β”‚   β”‚   └── UserCard.jsx
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ appStore.js
β”‚   β”‚   β”œβ”€β”€ axiosConfig.js
β”‚   β”‚   β”œβ”€β”€ conectionSlice.js
β”‚   β”‚   β”œβ”€β”€ constants.js
β”‚   β”‚   β”œβ”€β”€ feedSlice.js
β”‚   β”‚   β”œβ”€β”€ requestSlice.js
β”‚   β”‚   β”œβ”€β”€ socket.js
β”‚   β”‚   └── userSlice.js
β”‚   β”œβ”€β”€ App.jsx
β”‚   └── main.jsx
β”œβ”€β”€ public/
β”œβ”€β”€ index.html
β”œβ”€β”€ vercel.json
└── package.json

🀝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.


πŸ“ License

This project is open source and available under the MIT License.


πŸ‘¨β€πŸ’» Author

Built with ❀️ by book lovers, for book lovers


πŸ”— Links


⭐ Star this repo if you find it helpful!

Made with React, Redux, and lots of β˜•

About

BookConnect bridges the gap between book enthusiasts by connecting book enthusiasts based on their reading interests, allowing them to discover fellow readers and engage in real-time discussions about their literary journeys.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors