The Group Book Reading Platform is a web-based platform that allows users to form reading groups, set reading deadlines, engage in discussions, and track reading progress. It is built using Django for the backend and React for the frontend.
- Project Setup
- Architecture
- Features
- Project Structure
- Role-Based Authentication
- Testing
- API Endpoints
- Clone the repository:
git clone https://github.com/NishS07/Group_Book_Reading_Platform.git cd Group_Book_Reading_platform/Backend - Create a virtual environment and activate it:
python -m venv env source env/bin/activate # On Windows use `env\Scripts\activate`
- Install dependencies:
pip install -r requirements.txt
- Apply migrations:
python manage.py makemigrations python manage.py migrate
- Create a superuser:
python manage.py createsuperuser
- Start the backend server:
python manage.py runserver
- Navigate to the frontend directory:
cd ../Group_Book_Reading_Platform/Frontend - Install dependencies:
npm install
- Start the development server:
npm start
The project follows a client-server architecture with the following tech stack:
- Frontend: React (with React Router for navigation and state management)
- Backend: Django REST Framework (DRF) for API development
- Database: SQLite for development
- Authentication: JWT-based authentication using Django Simple JWT
- Role-Based Authentication: Users are assigned roles (admin, member) with permissions to access specific features.
- Register/Login with JWT authentication
- Secure access control for different user roles (admin, member)
- View available books and their details
- Join or create a reading group
- View and manage group details
- Track chapter reading progress
- Set and view reading deadlines
- Mark chapters as read
- View discussions for each chapter
- Post and reply to discussion threads
Group_Book_Reading_Platform/
│
├── Backend/ # Django backend
│ ├── manage.py # Django management script
│ ├── admin.py # Admin configuration
│ ├── models.py # Database models
│ ├── permissions.py # Role-based access control
│ ├── serializers.py # Data serialization
│ ├── urls.py # API routes
│ ├── views.py # API views
│ ├── tests.py # Backend tests
│ └── db.sqlite3 # SQLite database (use PostgreSQL in production)
│
├── Frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # UI components
│ │ │ ├── AdminHomePage.jsx - Admin dashboard homepage
│ │ │ ├── AdminBookPage.jsx - Admin interface for managing books
│ │ │ ├── AdminChapterPage.jsx - Admin panel for chapter management
│ │ │ ├── AdminGroupsPage.jsx - Admin view for managing groups
│ │ │ ├── HomePage.jsx - Landing page for all users
│ │ │ ├── LoginPage.jsx - User login interface
│ │ │ ├── SignUpPage.jsx - User registration page
│ │ │ ├── ProtectedRoute.jsx - Route protection component
│ │ │ ├── UnauthorizedPage.jsx - Page for unauthorized access attempts
│ │ │ ├── BookSelectionPage.jsx - Page for selecting books
│ │ │ ├── DiscussionPage.jsx - Forum page for book discussions
│ │ │ ├── GroupPage.jsx - Group details and member interactions
│ │ │ ├── MemberGroupPage.jsx - Member-specific group interactions
│ | ├── tests/ # Frontend tests
│ ├── public/ # Static assets
│ ├── package.json # Frontend dependencies
│
The backend includes the following models:
- User: Stores user information (username, email, password, role).
- Book: Stores information about books, including title, author, genre and description.
- Group: Stores reading group details (name, members, reading goals).
- Chapter: Stores chapter-wise information, deadlines, and read/unread status.
- Discussion: Stores discussion threads for each chapter.
The system implements role-based authentication with the following roles:
-
Admin:
- Manages books
- Manages groups
- Manages chapters
-
Member:
- Joins reading groups
- Reads books and marks progress
- Participates in discussions
The frontend testing is performed using Jest and React Testing Library.
To run the frontend tests, use the following command:
npm testPOST /api/register/- Register a new userPOST /api/login/- Authenticate and retrieve JWT tokens
GET /api/books/- Retrieve list of booksPOST /api/books/create/- Create a new book (admin only)
GET /api/groups/- Retrieve list of groupsPOST /api/books/<book_id>/groups/- Create or join a group
GET /api/groups/<group_id>/discussions_by_chapter/- Fetch discussionsPOST /api/groups/<group_id>/discussions_by_chapter/post/- Add discussion
PUT /api/groups/<group_id>/chapter/<chapter_id>/- Mark a chapter as readGET /api/progress/- View user’s reading progress
-
Books Management:
GET /api/books-admin/- Retrieve all books.POST /api/books/create/- Add a new book.PUT /api/books/{book_id}/update/- Update a book.DELETE /api/books/{book_id}/delete/- Remove a book.
-
Groups Management:
GET /api/groups-admin/- Retrieve all groups.POST /api/groups/create/- Create a new group.PUT /api/groups/{group_id}/update/- Update a group.DELETE /api/groups/{group_id}/delete/- Remove a group.
-
Chapters Management:
POST /api/chapter/create/- Create a new chapter.GET /api/chapter/- Retrieve all chapters.PUT /api/chapter/{chapter_id}/update/- Update a chapter.DELETE /api/chapter/{chapter_id}/delete/- Remove a chapter.
- User login page with authentication form.
- Registration form for new users, admin.
- Admin dashboard displaying an overview of books, groups, and chapters.
- Allows admin to manage books (add, read, update, delete).
- Enables admin to create, get, edit, or remove reading groups.
- Admin panel for managing chapters, deadlines, and progress.
- Displays available books, reading groups, and platform introduction.
- Displays notification based on the chapter deadline.
- Allows users to browse books and create/join groups.
-
In book selection page, we can view groups for a particular book.
-
In book selection page, we can create a group for a particular book.
- Lists all groups the logged-in member is part of.
- It displays the progress of whole group, and members that are part of and shows whether the user has read/unread the chapter.
- Displays chapter-wise discussions and allows users to post comments.