ReadCycle - Book Sharing Platform
Project Documentation
Prepared by: Development Team
Date: November 15, 2025
Version: 1.0
Table of Contents
- Introduction
- Project Objectives
- Technology Stack
- System Architecture
- Database Design
- User Flow
- Features
- API Endpoints
- Security Features
- Deployment
- Appendices
1. Introduction
ReadCycle is a web-based book sharing platform designed for students and book lovers in Bangladesh. The main idea is to help people share their books with each other instead of buying new books every time. This helps save money and also helps the environment by reducing waste.
The platform allows users to:
- Add their books to the platform
- Search for books they want to read
- Request to swap books with other users
- Manage their book collection
- Connect with other book lovers
2. Project Objectives
2.1 Main Objectives
- Create a platform where students can share books easily
- Reduce the cost of buying books for students
- Promote reading culture in Bangladesh
- Help the environment by reducing paper waste
2.2 Technical Objectives
- Build a secure and user-friendly web application
- Implement proper user authentication and authorization
- Create a responsive design that works on all devices
- Ensure data security and privacy
3. Technology Stack
3.1 Backend Technologies
- PHP 8.2+ - Programming language
- Laravel 12 - Web framework
- MySQL - Database management system
- Laravel Sanctum - API authentication
3.2 Frontend Technologies
- HTML5 - Markup language
- CSS3 - Styling
- Bootstrap 5 - CSS framework
- JavaScript - Client-side scripting
- Blade Templates - Laravel templating engine
3.3 Additional Tools
- Composer - PHP dependency manager
- Git - Version control
- Laravel Tinker - Command line tool
4. System Architecture
4.1 Overall Architecture
User Interface
(Web Browser)
→
Laravel Application
(PHP Framework)
→
MySQL Database
4.2 MVC Pattern
The application follows the Model-View-Controller (MVC) pattern:
- Model: Handles data and business logic (User, Book, Category, Swap)
- View: Handles user interface (Blade templates)
- Controller: Handles user requests and responses
5. Database Design
5.1 Entity Relationship Diagram
Users
1
1:N
Books
N
N:1
Categories
1
Books
1
1:N
Swaps
N
N:1
Users
1
5.2 Database Tables
5.2.1 Users Table
| Column Name |
Data Type |
Description |
| id |
BIGINT |
Primary key, auto increment |
| name |
VARCHAR(255) |
User's full name |
| email |
VARCHAR(255) |
User's email address (unique) |
| university_name |
VARCHAR(255) |
Name of university |
| department |
VARCHAR(255) |
Department/Subject |
| year |
VARCHAR(50) |
Academic year (1st, 2nd, 3rd, 4th) |
| password |
VARCHAR(255) |
Hashed password |
| profile_picture |
VARCHAR(255) |
Path to profile picture |
| created_at |
TIMESTAMP |
Account creation time |
| updated_at |
TIMESTAMP |
Last update time |
5.2.2 Categories Table
| Column Name |
Data Type |
Description |
| id |
BIGINT |
Primary key, auto increment |
| name |
VARCHAR(255) |
Category name (unique) |
| created_at |
TIMESTAMP |
Creation time |
| updated_at |
TIMESTAMP |
Last update time |
5.2.3 Books Table
| Column Name |
Data Type |
Description |
| id |
BIGINT |
Primary key, auto increment |
| user_id |
BIGINT |
Foreign key to users table |
| category_id |
BIGINT |
Foreign key to categories table |
| title |
VARCHAR(255) |
Book title |
| description |
TEXT |
Book description |
| photo_path |
VARCHAR(255) |
Path to book cover image |
| created_at |
TIMESTAMP |
Creation time |
| updated_at |
TIMESTAMP |
Last update time |
5.2.4 Swaps Table
| Column Name |
Data Type |
Description |
| id |
BIGINT |
Primary key, auto increment |
| book_requested_id |
BIGINT |
Foreign key to books table (book being requested) |
| book_offered_id |
BIGINT |
Foreign key to books table (book being offered) |
| requester_id |
BIGINT |
Foreign key to users table (person making request) |
| status |
ENUM |
pending, accepted, declined |
| created_at |
TIMESTAMP |
Request creation time |
| updated_at |
TIMESTAMP |
Last update time |
6. User Flow
6.1 Registration and Login Flow
User visits website
↓
Choose: Register or Login
↓
Fill registration form
(Name, Email, University, etc.)
↓
Account created successfully
↓
Redirect to Dashboard
6.2 Book Sharing Flow
User logs in
↓
Go to "My Books" section
↓
Click "Add New Book"
↓
Fill book details
(Title, Category, Description, Image)
↓
Book added to platform
6.3 Book Swap Flow
User finds a book they want
↓
Click "Request Swap"
↓
Select a book to offer in exchange
↓
Send swap request
↓
Book owner receives notification
↓
Owner can Accept or Decline
7. Features
7.1 User Management
- User registration with university information
- Secure login and logout
- Profile management with picture upload
- Password change functionality
7.2 Book Management
- Add books with cover images
- Edit book information
- Delete books from collection
- View all books in the platform
- Search books by title or category
7.3 Category Management
- Predefined categories (Novels, Science, History, etc.)
- Admin can add new categories
- Books organized by categories
7.4 Swap System
- Request book swaps with other users
- Accept or decline swap requests
- Track swap status (pending, accepted, declined)
- View swap history
7.5 Dashboard
- Overview of user's books and swaps
- Statistics (total books, swaps sent/received)
- Recent activity feed
- Quick access to all features
8. API Endpoints
8.1 Authentication Endpoints
POST /api/register - Register new user
POST /api/login - User login
POST /api/logout - User logout (requires authentication)
8.2 User Endpoints
GET /api/users - Get all users (requires authentication)
GET /api/users/{id} - Get specific user
PUT /api/users/{id} - Update user profile
DELETE /api/users/{id} - Delete user account
8.3 Book Endpoints
GET /api/books - Get all books (public)
GET /api/books/{id} - Get specific book (public)
POST /api/books - Add new book (requires authentication)
PUT /api/books/{id} - Update book (requires authentication)
DELETE /api/books/{id} - Delete book (requires authentication)
8.4 Category Endpoints
GET /api/categories - Get all categories (public)
GET /api/categories/{id} - Get specific category (public)
POST /api/categories - Add new category (requires authentication)
PUT /api/categories/{id} - Update category (requires authentication)
DELETE /api/categories/{id} - Delete category (requires authentication)
8.5 Swap Endpoints
GET /api/swaps - Get user's swaps (requires authentication)
POST /api/swaps - Create new swap request (requires authentication)
GET /api/swaps/{id} - Get specific swap details
PUT /api/swaps/{id} - Update swap request
DELETE /api/swaps/{id} - Cancel swap request
POST /api/swaps/update-status - Update swap status
9. Security Features
9.1 Authentication
- Laravel Sanctum for API token authentication
- Password hashing using bcrypt
- Session management for web interface
9.2 Authorization
- Users can only edit/delete their own books
- Users can only manage their own profile
- Swap requests can only be managed by involved parties
- API endpoints protected with authentication middleware
9.3 Data Validation
- Input validation on all forms
- File upload validation (type, size)
- SQL injection prevention through Eloquent ORM
- XSS protection through Blade templating
10. Deployment
10.1 System Requirements
- PHP 8.2 or higher
- MySQL 5.7 or higher
- Composer for dependency management
- Web server (Apache/Nginx)
10.2 Installation Steps
- Clone the repository from Git
- Install PHP dependencies using Composer
- Copy .env.example to .env and configure database
- Generate application key
- Run database migrations
- Seed the database with sample data
- Configure web server to point to public directory
11. Appendices
Appendix A: Color Scheme
The application uses a green color scheme representing nature and sustainability:
- Primary Color: #0a6d3a (Forest Green)
- Secondary Color: #35875b (Light Green)
- Light Color: #F0F6FF (Light Blue-White)
- Dark Color: #262B47 (Dark Navy)
Appendix B: File Structure
readcycle-laravel/
├── app/
│ ├── Http/Controllers/
│ │ ├── Api/ (API Controllers)
│ │ ├── Auth/ (Authentication Controllers)
│ │ └── Dashboard/ (Dashboard Controllers)
│ ├── Models/ (Database Models)
│ ├── Policies/ (Authorization Policies)
│ └── Services/ (Business Logic Services)
├── database/
│ ├── migrations/ (Database Schema)
│ └── seeders/ (Sample Data)
├── public/
│ ├── assets/ (CSS, JS, Images)
│ └── storage/ (Uploaded Files)
├── resources/
│ ├── views/ (Blade Templates)
│ └── lang/ (Language Files)
└── routes/
├── api.php (API Routes)
└── web.php (Web Routes)
Appendix C: Database Seeder Data
The application includes sample data for testing:
- Users: 20+ sample users with different universities
- Categories: 14 book categories in Bengali
- Books: 50+ sample books with cover images
- Swaps: 15+ sample swap requests
Appendix D: Bengali Language Support
The application supports Bengali language:
- All user interface text in Bengali
- Bengali font (Bangla.ttf) integrated
- Book titles and categories in Bengali
- Responsive design for Bengali text
Appendix E: Future Enhancements
Planned features for future versions:
- Mobile application (Android/iOS)
- Real-time notifications
- Book rating and review system
- Advanced search with filters
- Book recommendation system
- Integration with university libraries
End of Documentation
This document provides a complete overview of the ReadCycle project, including technical specifications, database design, and implementation details.