{"id":38529701,"url":"https://github.com/killflex/booktrack-react-native","last_synced_at":"2026-01-17T06:53:29.416Z","repository":{"id":330597041,"uuid":"1123306331","full_name":"killflex/booktrack-react-native","owner":"killflex","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-26T16:10:53.000Z","size":2141,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-28T04:48:45.146Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/killflex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-26T15:45:59.000Z","updated_at":"2025-12-26T16:03:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/killflex/booktrack-react-native","commit_stats":null,"previous_names":["killflex/booktrack-react-native"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/killflex/booktrack-react-native","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killflex%2Fbooktrack-react-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killflex%2Fbooktrack-react-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killflex%2Fbooktrack-react-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killflex%2Fbooktrack-react-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/killflex","download_url":"https://codeload.github.com/killflex/booktrack-react-native/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killflex%2Fbooktrack-react-native/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28502972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-17T06:53:28.873Z","updated_at":"2026-01-17T06:53:29.399Z","avatar_url":"https://github.com/killflex.png","language":"JavaScript","readme":"# 📚 BookTrack - Personal Book Management App\n\nA full-stack mobile application for tracking your personal reading journey. Built with React Native (Expo) for the frontend and Node.js/PostgreSQL for the backend.\n\n![BookTrack App Mockup](booktrack_mockup.png)\n\n---\n\n## 📖 Table of Contents\n\n- [Features](#features)\n- [Tech Stack](#tech-stack)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n  - [Backend Setup](#backend-setup)\n  - [Mobile App Setup](#mobile-app-setup)\n- [Environment Variables](#environment-variables)\n- [API Documentation](#api-documentation)\n- [Database Schema](#database-schema)\n- [Project Structure](#project-structure)\n- [Testing](#testing)\n- [Troubleshooting](#troubleshooting)\n- [Contributing](#contributing)\n- [License](#license)\n\n---\n\n## ✨ Features\n\n### User Features\n\n- 🔐 **Secure Authentication** - Register and login with email/password\n- 📚 **Book Management** - Add, edit, view, and delete books\n- 🔍 **Search \u0026 Filter** - Search by title/author/genre, filter by reading status\n- 📊 **Reading Statistics** - Track total books, average rating, and reading progress\n- 🏷️ **Reading Status** - Organize books as \"Want to Read\", \"Currently Reading\", or \"Finished\"\n- ⭐ **Book Ratings** - Rate books from 1 to 5 stars\n- 📝 **Personal Notes** - Add notes to any book (up to 2000 characters)\n- 🎨 **Beautiful UI** - Modern design with smooth animations and toast notifications\n- ♻️ **Pull to Refresh** - Easily refresh your book list\n- 👤 **User Profile** - View your reading statistics and manage your account\n- ℹ️ **About Page** - Comprehensive app and developer information\n\n### Technical Features\n\n- 🔒 **JWT Authentication** - Secure token-based authentication\n- 🗄️ **PostgreSQL Database** - Reliable and scalable data storage\n- 🐳 **Docker Support** - Easy deployment with Docker Compose\n- ✅ **Input Validation** - Comprehensive validation on both frontend and backend\n- 🚀 **Performance Optimized** - React.memo and useCallback for optimal performance\n- 📱 **Cross-Platform** - Works on both iOS and Android (Expo)\n- 🌐 **RESTful API** - Clean and well-documented API endpoints\n\n---\n\n## 🛠️ Tech Stack\n\n### Frontend\n\n- **Framework:** React Native 0.81.5\n- **Platform:** Expo SDK 54.0.29\n- **Navigation:** React Navigation 7.x\n- **State Management:** React Context API\n- **Storage:** AsyncStorage\n- **HTTP Client:** Axios 1.13.2\n- **UI Components:** React Native built-in components\n- **Notifications:** react-native-toast-message\n\n### Backend\n\n- **Runtime:** Node.js 18.x\n- **Framework:** Express.js 4.21.2\n- **Database:** PostgreSQL 15\n- **Authentication:** JSON Web Tokens (JWT)\n- **Password Hashing:** bcrypt\n- **Validation:** express-validator\n- **CORS:** cors middleware\n- **Container:** Docker \u0026 Docker Compose\n\n---\n\n## 📋 Prerequisites\n\nBefore you begin, ensure you have the following installed:\n\n- **Node.js** 18.x or higher ([Download](https://nodejs.org/))\n- **npm** or **yarn** package manager\n- **Docker Desktop** ([Download](https://www.docker.com/products/docker-desktop))\n- **Expo Go** app on your mobile device (iOS/Android)\n  - [iOS App Store](https://apps.apple.com/app/expo-go/id982107779)\n  - [Google Play Store](https://play.google.com/store/apps/details?id=host.exp.exponent)\n- **Android Studio** (for Android Emulator) or **Xcode** (for iOS Simulator) - Optional\n\n---\n\n## 🚀 Installation\n\n### Clone the Repository\n\n```bash\ngit clone https://github.com/yourusername/booktrack.git\ncd booktrack\n```\n\n---\n\n### Backend Setup\n\n#### 1. Navigate to Backend Directory\n\n```bash\ncd backend\n```\n\n#### 2. Install Dependencies\n\n```bash\nnpm install\n```\n\n#### 3. Configure Environment Variables\n\nCreate a `.env` file in the `backend` directory:\n\n```bash\n# Copy the example file\ncp .env.example .env\n```\n\nEdit `.env` with your configuration:\n\n```env\nPORT=3000\nDATABASE_URL=postgresql://booktrack_user:securepassword123@db:5432/booktrack\nJWT_SECRET=your-super-secret-jwt-key-change-this-in-production\nNODE_ENV=development\n```\n\n\u003e ⚠️ **Important:** Change `JWT_SECRET` to a strong random string in production!\n\n#### 4. Start Backend with Docker\n\nMake sure Docker Desktop is running, then:\n\n```bash\n# From the backend directory\ndocker-compose up -d\n```\n\nThis will:\n\n- Start PostgreSQL database on port 5432\n- Run database initialization script\n- Start Express server on port 3000\n\n#### 5. Verify Backend is Running\n\n```bash\n# Check container status\ndocker-compose ps\n\n# View logs\ndocker-compose logs -f backend\n\n# Test the API\ncurl http://localhost:3000/api/auth/verify\n```\n\nExpected response (without token):\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"NO_TOKEN\",\n    \"message\": \"Authorization token is required\"\n  }\n}\n```\n\n---\n\n### Mobile App Setup\n\n#### 1. Navigate to Mobile Directory\n\n```bash\ncd mobile\n```\n\n#### 2. Install Dependencies\n\n```bash\nnpm install\n```\n\n#### 3. Configure API Base URL\n\nThe API URL is configured in [mobile/src/constants/config.js](mobile/src/constants/config.js):\n\n- **Android Emulator:** Uses `10.0.2.2` (special IP for localhost)\n- **iOS Simulator:** Uses `localhost`\n- **Physical Device:** Update to your computer's local IP address\n\n```javascript\n// For physical device, find your IP:\n// Windows: ipconfig (look for IPv4 Address)\n// Mac/Linux: ifconfig (look for inet)\nexport const API_BASE_URL = __DEV__\n  ? Platform.OS === \"android\"\n    ? \"http://10.0.2.2:3000/api\" // Android Emulator\n    : \"http://192.168.1.100:3000/api\" // Replace with your IP for physical device\n  : \"https://your-production-api.com/api\";\n```\n\n#### 4. Start Expo Development Server\n\n```bash\nnpx expo start\n```\n\n#### 5. Run on Device/Emulator\n\nChoose one of the following options:\n\n**Option A: Physical Device**\n\n1. Open Expo Go app on your phone\n2. Scan the QR code from the terminal\n3. App will load on your device\n\n**Option B: Android Emulator**\n\n1. Start Android emulator from Android Studio\n2. Press `a` in the Expo terminal\n3. App will launch in emulator\n\n**Option C: iOS Simulator (Mac only)**\n\n1. Press `i` in the Expo terminal\n2. iOS simulator will open with the app\n\n---\n\n## 🔐 Environment Variables\n\n### Backend (.env)\n\n| Variable       | Description                          | Default     | Required |\n| -------------- | ------------------------------------ | ----------- | -------- |\n| `PORT`         | Express server port                  | 3000        | Yes      |\n| `DATABASE_URL` | PostgreSQL connection string         | -           | Yes      |\n| `JWT_SECRET`   | Secret key for JWT signing           | -           | Yes      |\n| `NODE_ENV`     | Environment (development/production) | development | No       |\n\n### Frontend (config.js)\n\n| Variable       | Description     | Required |\n| -------------- | --------------- | -------- |\n| `API_BASE_URL` | Backend API URL | Yes      |\n\n---\n\n## 📡 API Documentation\n\n### Base URL\n\n```\nhttp://localhost:3000/api\n```\n\n### Authentication Endpoints\n\n#### Register New User\n\n```http\nPOST /auth/register\nContent-Type: application/json\n\n{\n  \"email\": \"user@example.com\",\n  \"password\": \"SecurePass123!\",\n  \"fullName\": \"John Doe\"\n}\n```\n\n**Response (201 Created):**\n\n```json\n{\n  \"success\": true,\n  \"message\": \"User registered successfully\",\n  \"data\": {\n    \"userId\": 1,\n    \"email\": \"user@example.com\",\n    \"fullName\": \"John Doe\",\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\"\n  }\n}\n```\n\n#### Login\n\n```http\nPOST /auth/login\nContent-Type: application/json\n\n{\n  \"email\": \"user@example.com\",\n  \"password\": \"SecurePass123!\"\n}\n```\n\n**Response (200 OK):**\n\n```json\n{\n  \"success\": true,\n  \"message\": \"Login successful\",\n  \"data\": {\n    \"userId\": 1,\n    \"email\": \"user@example.com\",\n    \"fullName\": \"John Doe\",\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\"\n  }\n}\n```\n\n#### Verify Token\n\n```http\nGET /auth/verify\nAuthorization: Bearer \u003ctoken\u003e\n```\n\n**Response (200 OK):**\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"userId\": 1,\n    \"email\": \"user@example.com\",\n    \"fullName\": \"John Doe\"\n  }\n}\n```\n\n---\n\n### Book Endpoints\n\n\u003e 🔒 All book endpoints require authentication. Include `Authorization: Bearer \u003ctoken\u003e` header.\n\n#### Get All Books\n\n```http\nGET /books?status=finished\u0026search=gatsby\u0026page=1\u0026limit=10\nAuthorization: Bearer \u003ctoken\u003e\n```\n\n**Query Parameters:**\n\n- `status` (optional): Filter by reading status (want_to_read, currently_reading, finished)\n- `search` (optional): Search by title, author, or genre\n- `page` (optional): Page number (default: 1)\n- `limit` (optional): Items per page (default: 10)\n- `sortBy` (optional): Sort field (title, author, created_at, etc.)\n- `sortOrder` (optional): Sort direction (asc, desc)\n\n**Response (200 OK):**\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"books\": [\n      {\n        \"book_id\": 1,\n        \"title\": \"The Great Gatsby\",\n        \"author\": \"F. Scott Fitzgerald\",\n        \"genre\": \"Classic\",\n        \"publication_year\": 1925,\n        \"reading_status\": \"finished\",\n        \"rating\": 5,\n        \"notes\": \"A masterpiece!\",\n        \"created_at\": \"2024-12-18T10:00:00Z\",\n        \"updated_at\": \"2024-12-18T10:00:00Z\"\n      }\n    ],\n    \"pagination\": {\n      \"currentPage\": 1,\n      \"totalPages\": 1,\n      \"totalBooks\": 1,\n      \"booksPerPage\": 10\n    }\n  }\n}\n```\n\n#### Get Book Statistics\n\n```http\nGET /books/statistics\nAuthorization: Bearer \u003ctoken\u003e\n```\n\n**Response (200 OK):**\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"totalBooks\": 10,\n    \"byStatus\": {\n      \"wantToRead\": 3,\n      \"currentlyReading\": 2,\n      \"finished\": 5\n    },\n    \"byGenre\": {\n      \"Fiction\": 4,\n      \"Fantasy\": 3,\n      \"Classic\": 3\n    },\n    \"averageRating\": 4.2,\n    \"ratedBooks\": 8,\n    \"recentlyAdded\": [...]\n  }\n}\n```\n\n#### Get Single Book\n\n```http\nGET /books/:bookId\nAuthorization: Bearer \u003ctoken\u003e\n```\n\n**Response (200 OK):**\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"book_id\": 1,\n    \"user_id\": 1,\n    \"title\": \"The Great Gatsby\",\n    \"author\": \"F. Scott Fitzgerald\",\n    \"genre\": \"Classic\",\n    \"publication_year\": 1925,\n    \"reading_status\": \"finished\",\n    \"rating\": 5,\n    \"notes\": \"A masterpiece!\",\n    \"created_at\": \"2024-12-18T10:00:00Z\",\n    \"updated_at\": \"2024-12-18T10:00:00Z\"\n  }\n}\n```\n\n#### Create Book\n\n```http\nPOST /books\nAuthorization: Bearer \u003ctoken\u003e\nContent-Type: application/json\n\n{\n  \"title\": \"The Great Gatsby\",\n  \"author\": \"F. Scott Fitzgerald\",\n  \"genre\": \"Classic\",\n  \"publicationYear\": 1925,\n  \"readingStatus\": \"finished\",\n  \"rating\": 5,\n  \"notes\": \"A masterpiece!\"\n}\n```\n\n**Response (201 Created):**\n\n```json\n{\n  \"success\": true,\n  \"message\": \"Book added successfully\",\n  \"data\": { ... }\n}\n```\n\n#### Update Book\n\n```http\nPUT /books/:bookId\nAuthorization: Bearer \u003ctoken\u003e\nContent-Type: application/json\n\n{\n  \"title\": \"Updated Title\",\n  \"author\": \"Updated Author\",\n  \"readingStatus\": \"currently_reading\",\n  \"rating\": 4\n}\n```\n\n**Response (200 OK):**\n\n```json\n{\n  \"success\": true,\n  \"message\": \"Book updated successfully\",\n  \"data\": { ... }\n}\n```\n\n#### Delete Book\n\n```http\nDELETE /books/:bookId\nAuthorization: Bearer \u003ctoken\u003e\n```\n\n**Response (200 OK):**\n\n```json\n{\n  \"success\": true,\n  \"message\": \"Book deleted successfully\"\n}\n```\n\n---\n\n## 🗄️ Database Schema\n\n### Users Table\n\n```sql\nCREATE TABLE users (\n    user_id SERIAL PRIMARY KEY,\n    email VARCHAR(255) UNIQUE NOT NULL,\n    password_hash VARCHAR(255) NOT NULL,\n    full_name VARCHAR(100) NOT NULL,\n    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n);\n```\n\n### Books Table\n\n```sql\nCREATE TABLE books (\n    book_id SERIAL PRIMARY KEY,\n    user_id INTEGER NOT NULL REFERENCES users(user_id) ON DELETE CASCADE,\n    title VARCHAR(255) NOT NULL,\n    author VARCHAR(255) NOT NULL,\n    genre VARCHAR(100),\n    publication_year INTEGER,\n    reading_status VARCHAR(20) NOT NULL CHECK (reading_status IN ('want_to_read', 'currently_reading', 'finished')),\n    rating INTEGER CHECK (rating \u003e= 1 AND rating \u003c= 5),\n    notes TEXT,\n    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n);\n\nCREATE INDEX idx_books_user_id ON books(user_id);\nCREATE INDEX idx_books_reading_status ON books(reading_status);\n```\n\n---\n\n## 📁 Project Structure\n\n```\nbooktrack/\n├── backend/                    # Backend API (Node.js + Express)\n│   ├── config/\n│   │   └── db.js              # PostgreSQL connection\n│   ├── controllers/\n│   │   ├── auth.controller.js # Authentication logic\n│   │   └── books.controller.js # Book CRUD logic\n│   ├── database/\n│   │   └── init.sql           # Database initialization\n│   ├── middleware/\n│   │   ├── auth.js            # JWT verification\n│   │   └── errorHandler.js    # Global error handler\n│   ├── models/\n│   │   ├── user.model.js      # User database operations\n│   │   └── book.model.js      # Book database operations\n│   ├── routes/\n│   │   ├── auth.routes.js     # Auth endpoints\n│   │   └── books.routes.js    # Book endpoints\n│   ├── utils/\n│   │   ├── jwt.js             # JWT utilities\n│   │   └── validation.js      # Validation rules\n│   ├── Dockerfile             # Backend container\n│   ├── docker-compose.yml     # Docker services\n│   ├── server.js              # Express app entry\n│   ├── package.json           # Backend dependencies\n│   └── .env                   # Environment variables\n│\n├── mobile/                     # Mobile app (React Native + Expo)\n│   ├── src/\n│   │   ├── components/        # Reusable components\n│   │   │   ├── BookCard.js\n│   │   │   ├── Button.js\n│   │   │   ├── InputField.js\n│   │   │   ├── LoadingSpinner.js\n│   │   │   └── StatisticsCard.js\n│   │   ├── constants/         # App constants\n│   │   │   ├── colors.js\n│   │   │   └── config.js      # API URL configuration\n│   │   ├── context/           # React Context\n│   │   │   └── AuthContext.js # Auth state management\n│   │   ├── navigation/        # Navigation setup\n│   │   │   ├── AppNavigator.js    # Authenticated routes\n│   │   │   └── AuthNavigator.js   # Authentication routes\n│   │   ├── screens/           # App screens\n│   │   │   ├── AboutScreen.js\n│   │   │   ├── AddBookScreen.js\n│   │   │   ├── BookDetailsScreen.js\n│   │   │   ├── EditBookScreen.js\n│   │   │   ├── HomeScreen.js\n│   │   │   ├── ProfileScreen.js\n│   │   │   ├── SignInScreen.js\n│   │   │   ├── SignUpScreen.js\n│   │   │   └── SplashScreen.js\n│   │   ├── services/          # API services\n│   │   │   ├── api.js         # Axios instance\n│   │   │   ├── authService.js # Auth API calls\n│   │   │   └── bookService.js # Book API calls\n│   │   └── utils/             # Utilities\n│   │       ├── storage.js     # AsyncStorage helpers\n│   │       └── validation.js  # Form validation\n│   ├── App.js                 # App entry point\n│   ├── app.json               # Expo configuration\n│   ├── package.json           # Frontend dependencies\n│   └── README.md              # Mobile app docs\n│\n├── README.md                   # This file\n└── .gitignore                 # Git ignore rules\n```\n\n---\n\n## 🧪 Testing\n\n### Backend Testing\n\nComprehensive backend tests have been performed. See [backend/PHASE8_BACKEND_TESTING_RESULTS.md](backend/PHASE8_BACKEND_TESTING_RESULTS.md) for detailed results.\n\n**Test Summary:**\n\n- ✅ 18/18 tests passing\n- ✅ 100% success rate\n- ✅ All CRUD operations verified\n- ✅ Authentication \u0026 authorization working\n- ✅ Input validation tested\n- ✅ Error handling verified\n\n**Run Backend Tests Manually:**\n\n```powershell\n# Test registration\n$body = @{email='test@test.com'; password='Test1234!'; fullName='Test User'} | ConvertTo-Json\nInvoke-RestMethod -Uri 'http://localhost:3000/api/auth/register' -Method POST -Body $body -ContentType 'application/json'\n\n# Test login\n$body = @{email='test@test.com'; password='Test1234!'} | ConvertTo-Json\n$response = Invoke-RestMethod -Uri 'http://localhost:3000/api/auth/login' -Method POST -Body $body -ContentType 'application/json'\n$token = $response.data.token\n\n# Test get books\n$headers = @{Authorization=\"Bearer $token\"}\nInvoke-RestMethod -Uri 'http://localhost:3000/api/books' -Method GET -Headers $headers\n```\n\n### Frontend Testing\n\nSee [mobile/PHASE5_TESTING.md](mobile/PHASE5_TESTING.md), [mobile/PHASE7_TESTING.md](mobile/PHASE7_TESTING.md), and [mobile/PHASE8_TESTING.md](mobile/PHASE8_TESTING.md) for comprehensive testing guides.\n\n**Manual Testing Checklist:**\n\n- [ ] User can register new account\n- [ ] User can login with existing account\n- [ ] Token persists across app restarts\n- [ ] User can add new books\n- [ ] User can edit existing books\n- [ ] User can delete books\n- [ ] Search and filter functionality works\n- [ ] Statistics display correctly\n- [ ] Toast notifications appear\n- [ ] Pull-to-refresh updates data\n- [ ] Logout clears session\n\n---\n\n## 🔧 Troubleshooting\n\n### Backend Issues\n\n#### Problem: Docker containers won't start\n\n**Solution:**\n\n```bash\n# Check if ports are already in use\ndocker ps -a\n\n# Stop all containers\ndocker-compose down\n\n# Remove volumes and rebuild\ndocker-compose down -v\ndocker-compose up --build -d\n```\n\n#### Problem: Database connection failed\n\n**Solution:**\n\n1. Verify PostgreSQL container is running: `docker-compose ps`\n2. Check DATABASE_URL in `.env` matches docker-compose.yml\n3. View logs: `docker-compose logs db`\n4. Restart containers: `docker-compose restart`\n\n#### Problem: JWT token errors\n\n**Solution:**\n\n1. Ensure JWT_SECRET is set in `.env`\n2. Check token format in Authorization header: `Bearer \u003ctoken\u003e`\n3. Verify token hasn't expired (tokens expire after 7 days)\n\n---\n\n### Frontend Issues\n\n#### Problem: Cannot connect to backend from Android Emulator\n\n**Solution:**\n\n- Android Emulator requires `10.0.2.2` instead of `localhost`\n- Update [mobile/src/constants/config.js](mobile/src/constants/config.js):\n  ```javascript\n  export const API_BASE_URL = \"http://10.0.2.2:3000/api\";\n  ```\n\n#### Problem: Cannot connect to backend from Physical Device\n\n**Solution:**\n\n1. Find your computer's local IP address:\n   - **Windows:** Run `ipconfig` in Command Prompt (look for IPv4 Address)\n   - **Mac/Linux:** Run `ifconfig` or `ip addr` (look for inet)\n2. Update config.js with your IP:\n   ```javascript\n   export const API_BASE_URL = \"http://192.168.1.100:3000/api\";\n   ```\n3. Ensure your phone and computer are on the same WiFi network\n4. Check if firewall is blocking port 3000\n\n#### Problem: App crashes on launch\n\n**Solution:**\n\n```bash\n# Clear Metro bundler cache\nnpx expo start --clear\n\n# Reinstall dependencies\nrm -rf node_modules\nnpm install\n\n# Reset Expo cache\nnpx expo start --reset-cache\n```\n\n#### Problem: \"Network Error\" when making API calls\n\n**Solution:**\n\n1. Verify backend is running: `curl http://localhost:3000/api/auth/verify`\n2. Check API_BASE_URL in config.js matches your setup\n3. Ensure no firewall blocking connections\n4. Try restarting Expo dev server\n\n---\n\n### Common Errors\n\n#### ValidationError: Email already exists\n\n- **Cause:** Email is already registered\n- **Solution:** Use a different email or login with existing account\n\n#### ValidationError: Password must contain...\n\n- **Cause:** Password doesn't meet requirements\n- **Solution:** Password must have:\n  - At least 8 characters\n  - One uppercase letter\n  - One lowercase letter\n  - One number\n  - One special character\n\n#### UnauthorizedError: Invalid token\n\n- **Cause:** Token is expired or invalid\n- **Solution:** Login again to get a new token\n\n---\n\n## 🎯 Usage Examples\n\n### Complete User Flow\n\n1. **Register a new account**\n\n   - Open app\n   - Tap \"Sign Up\"\n   - Enter email, password, and full name\n   - Tap \"Sign Up\" button\n\n2. **Add your first book**\n\n   - Tap the + (FAB) button\n   - Fill in book details\n   - Tap \"Add Book\"\n\n3. **View and manage books**\n\n   - Browse all books on Home screen\n   - Use tabs to filter by status\n   - Search for specific books\n   - Pull down to refresh\n\n4. **Edit a book**\n\n   - Tap on a book card\n   - Tap \"Edit Book\" button\n   - Update details\n   - Tap \"Save Changes\"\n\n5. **View statistics**\n\n   - Navigate to Profile tab\n   - See total books, average rating\n   - View books by status\n\n6. **Delete a book**\n   - Open book details\n   - Tap \"Delete Book\"\n   - Confirm deletion\n\n---\n\n## 👨‍💻 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n---\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkillflex%2Fbooktrack-react-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkillflex%2Fbooktrack-react-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkillflex%2Fbooktrack-react-native/lists"}