Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Group Book Reading App

Introduction

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.

Table of Contents

Project Setup

Backend Setup (Django)

  1. Clone the repository:
    git clone https://github.com/NishS07/Group_Book_Reading_Platform.git
    cd Group_Book_Reading_platform/Backend
  2. Create a virtual environment and activate it:
    python -m venv env
    source env/bin/activate  # On Windows use `env\Scripts\activate`
  3. Install dependencies:
    pip install -r requirements.txt
  4. Apply migrations:
    python manage.py makemigrations
    python manage.py migrate
  5. Create a superuser:
    python manage.py createsuperuser
  6. Start the backend server:
    python manage.py runserver

Frontend Setup (React)

  1. Navigate to the frontend directory:
    cd ../Group_Book_Reading_Platform/Frontend
  2. Install dependencies:
    npm install
  3. Start the development server:
    npm start

Architecture

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.

Features

User Authentication

  • Register/Login with JWT authentication
  • Secure access control for different user roles (admin, member)

Book & Group Management

  • View available books and their details
  • Join or create a reading group
  • View and manage group details

Reading Progress

  • Track chapter reading progress
  • Set and view reading deadlines
  • Mark chapters as read

Discussion Forum

  • View discussions for each chapter
  • Post and reply to discussion threads

Project Structure

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
│   

Models

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.

Role-Based Authentication

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

Testing

The frontend testing is performed using Jest and React Testing Library.

Running Tests

To run the frontend tests, use the following command:

npm test

API Endpoints

Authentication

  • POST /api/register/ - Register a new user
  • POST /api/login/ - Authenticate and retrieve JWT tokens

Books

  • GET /api/books/ - Retrieve list of books
  • POST /api/books/create/ - Create a new book (admin only)

Groups

  • GET /api/groups/ - Retrieve list of groups
  • POST /api/books/<book_id>/groups/ - Create or join a group

Discussions

  • GET /api/groups/<group_id>/discussions_by_chapter/ - Fetch discussions
  • POST /api/groups/<group_id>/discussions_by_chapter/post/ - Add discussion

Progress Tracking

  • PUT /api/groups/<group_id>/chapter/<chapter_id>/ - Mark a chapter as read
  • GET /api/progress/ - View user’s reading progress

Admin API Endpoints

  • 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.

Login Page

  • User login page with authentication form.
LoginPage

Signup Page

  • Registration form for new users, admin.
SignUp

Admin Pages

AdminHomePage

  • Admin dashboard displaying an overview of books, groups, and chapters.
AdminHomepage

AdminBooksPage

  • Allows admin to manage books (add, read, update, delete).
AdminBooksPage

AdminGroupsPage

  • Enables admin to create, get, edit, or remove reading groups.
AdminGroupsPage

AdminChaptersPage

  • Admin panel for managing chapters, deadlines, and progress.
AdminChapterPage

Member Pages

Home Page

  • Displays available books, reading groups, and platform introduction.
Homepage

Notifications Page

  • Displays notification based on the chapter deadline.
Notifications

Book Selection Page

  • Allows users to browse books and create/join groups.
Book-selection Page
  • In book selection page, we can view groups for a particular book.

    grupsforabook
  • In book selection page, we can create a group for a particular book.

    Create group

MemberGroup Page

  • Lists all groups the logged-in member is part of.
membergrouppage

View Progress Page

  • It displays the progress of whole group, and members that are part of and shows whether the user has read/unread the chapter.
viewprogress

Discussion Page

  • Displays chapter-wise discussions and allows users to post comments.
Discussionpage

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages