{"id":31999596,"url":"https://github.com/smzoha/bookshare","last_synced_at":"2026-04-07T07:45:43.986Z","repository":{"id":313538696,"uuid":"1051645263","full_name":"smzoha/bookshare","owner":"smzoha","description":"A webapp that helps users to track books, their reading progress, while keeping up with the updates of their connections","archived":false,"fork":false,"pushed_at":"2026-04-06T19:32:48.000Z","size":10141,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-07T07:45:41.420Z","etag":null,"topics":["bootstrap","java","javascript","jquery","spring","spring-boot","spring-security","thymeleaf"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smzoha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-09-06T12:37:17.000Z","updated_at":"2026-04-06T15:54:02.000Z","dependencies_parsed_at":"2025-09-06T19:29:03.283Z","dependency_job_id":"d4c6e8f0-b363-40ba-9ebe-beba141e97f1","html_url":"https://github.com/smzoha/bookshare","commit_stats":null,"previous_names":["smzoha/bookshare"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/smzoha/bookshare","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smzoha%2Fbookshare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smzoha%2Fbookshare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smzoha%2Fbookshare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smzoha%2Fbookshare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smzoha","download_url":"https://codeload.github.com/smzoha/bookshare/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smzoha%2Fbookshare/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31504897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["bootstrap","java","javascript","jquery","spring","spring-boot","spring-security","thymeleaf"],"created_at":"2025-10-15T14:32:54.173Z","updated_at":"2026-04-07T07:45:43.979Z","avatar_url":"https://github.com/smzoha.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📖 BookShare\n\n![Java](https://img.shields.io/badge/Java-25-blue.svg)\n![Spring Boot](https://img.shields.io/badge/Spring--Boot-3.x-brightgreen.svg)\n![Gradle](https://img.shields.io/badge/Build-Gradle-02303A.svg?logo=gradle)\n![PostgreSQL](https://img.shields.io/badge/Database-PostgreSQL-blue.svg?logo=postgresql)\n![Docker](https://img.shields.io/badge/Docker-Enabled-2496ED.svg?logo=docker)\n![Build](https://github.com/smzoha/bookshare/actions/workflows/gradle.yml/badge.svg)\n![License: GPL v2](https://img.shields.io/badge/License-GPL_v2-blue.svg)\n![Status](https://img.shields.io/badge/Status-Development-yellow)\n\nBookShare is a **modern web application** to track your books, reading progress, and connect with other readers. Keep your library organized and stay updated with friends' reading activity!\n\n---\n\n## 📌 Table of Contents\n\n- [Features](#features)\n- [Technology Stack](#technology-stack)\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n  - [Running the Application](#running)\n  - [Running with Docker](#docker)\n  - [Set up Gmail API \u0026 Google OAuth2 Login](#google)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [License](#license)\n- [Contact](#contact)\n\n---\n\n\u003ch2 id=\"features\"\u003e✨ Features\u003c/h2\u003e\n\n- User registration, login, and authentication\n- Add books and track reading progress\n- Connect with other users and view their activity\n- Responsive interface built with **Thymeleaf** and **Bootstrap**\n- Secure backend with **Spring Boot** and **Spring Security**\n- Easily extensible for reviews, ratings, and more\n\n---\n\n\u003ch2 id=\"technology-stack\"\u003e 🛠 Technology Stack\u003c/h2\u003e\n\n| Layer      | Technology                                 |\n|------------|--------------------------------------------|\n| Backend    | Java, Spring Boot, Spring Security         |\n| Frontend   | Thymeleaf, Bootstrap, HTML/CSS, JavaScript |\n| Database   | PostgreSQL, Flyway                         |\n| Build Tool | Gradle                                     |\n| Versioning | Git \u0026 GitHub                               |\n\n---\n\n\u003ch2 id=\"getting-started\"\u003e🚀 Getting Started\u003c/h2\u003e\n\n\u003ch3 id=\"prerequisites\"\u003ePrerequisites\u003c/h3\u003e\n\n- Java 25+\n- Gradle 8+\n- PostgreSQL\n- Git\n- Docker \u0026 Docker Compose _(optional, for containerized setup)_\n\n\u003ch3 id=\"installation\"\u003eInstallation\u003c/h3\u003e\n\n```bash\n# Clone the repository\ngit clone https://github.com/smzoha/bookshare.git\ncd bookshare\n\n# Configure database in src/main/resources/application-dev.properties:\nspring.datasource.url=jdbc:postgresql://localhost:5432/bookshare\nspring.datasource.username=your_db_user\nspring.datasource.password=your_db_password\n```\n\n\u003ch3 id=\"running\"\u003eRunning the Application\u003c/h3\u003e\n\n```bash\n# Run with Gradle\n./gradlew bootRun\n```\n\n### Access the app at:\n```\nhttp://localhost:6001\n```\n\n---\n\n\u003ch3 id=\"docker\"\u003e🐳 Running with Docker\u003c/h3\u003e\n\nDocker will spin up both the application and a PostgreSQL database together, with no local setup required.\n\n**1. Set up your environment file:**\n\n```bash\ncp .env.example .env\n```\n\nEdit `.env` with your preferred credentials:\n\n```env\nDATABASE_NAME=bookshare\nDATABASE_USER=your_db_user\nDATABASE_PASSWORD=your_db_password\n```\n\n**2. Start all services:**\n\n```bash\n./deploy.sh start\n```\n\n**3. Stop all services:**\n\n```bash\n./deploy.sh stop\n```\n\n\u003e App logs are persisted to the `./logs/` directory on your host machine.\n\n---\n\n\u003ch3 id=\"google\"\u003e✉️ 🔐 Set up Gmail API \u0026 Google OAuth2 Login\u003c/h3\u003e\n\nFollow these steps to set up Google OAuth2 credentials for two features:\n- **Gmail API** — sending emails via Gmail\n- **Google OAuth2 Login** — Login with Google authentication\n\n**Create OAuth2 Credentials in Google Cloud:**\n- Go to [Google Cloud Console](https://console.cloud.google.com/) and select your project (the name defined for this project is \"bookshare\").\n- **Enable Required APIs**:\n  - APIs \u0026 Services → Library → **Gmail API** → Enable\n- **Configure OAuth Consent Screen**:\n  - App Type: External\n  - Fill in App Name and Support Email (bookshare and your choice of Gmail address respectively)\n  - Add the following **OAuth2 scopes**:\n    - `https://www.googleapis.com/auth/gmail.send` — Send emails via Gmail\n    - `openid` — Google Login: authenticate user identity\n    - `https://www.googleapis.com/auth/userinfo.email` — Google Login: access user's email address\n    - `https://www.googleapis.com/auth/userinfo.profile` — Google Login: access user's basic profile info\n- **Create OAuth Client ID**:\n  - Application Type: Web application\n  - Add **Authorized redirect URIs**:\n    - `http://localhost:6001` *(for refresh token generation)*\n    - `http://localhost:6001/login/oauth2/code/google` *(for Google Login callback — adjust host/port as needed)*\n    - `http://localhost:6001/oauth2/authorization/google` *(for Google Login callback — adjust host/port as needed)*\n  - Copy the `client_id` and `client_secret`\n\n**Generate Refresh Token (for Gmail sending):**\n- Open the following URL in your browser (replace `YOUR_CLIENT_ID`):\n```\n  https://accounts.google.com/o/oauth2/v2/auth?\n  client_id=YOUR_CLIENT_ID\n  \u0026redirect_uri=http://localhost:6001\n  \u0026response_type=code\n  \u0026scope=https://www.googleapis.com/auth/gmail.send\n  \u0026access_type=offline\n  \u0026prompt=consent\n```\n- Login with your Gmail account and allow access.\n- Copy the `code` from the redirected URL: `http://localhost:6001/?code=AUTH_CODE`\n- Exchange `AUTH_CODE` for tokens via POST request:\n```http\nPOST https://oauth2.googleapis.com/token\nContent-Type: application/x-www-form-urlencoded\n\ncode=AUTH_CODE\u0026\nclient_id=YOUR_CLIENT_ID\u0026\nclient_secret=YOUR_CLIENT_SECRET\u0026\nredirect_uri=http://localhost:6001\u0026\ngrant_type=authorization_code\n```\n- The response will include the refresh token:\n```json\n{\n  \"access_token\": \"...\",\n  \"expires_in\": 3599,\n  \"refresh_token\": \"YOUR_REFRESH_TOKEN\",\n  \"scope\": \"https://www.googleapis.com/auth/gmail.send\",\n  \"token_type\": \"Bearer\"\n}\n```\n\n\u003e **Note:** The Google Login flow is handled automatically by Spring Security OAuth2 — no manual token exchange is needed for login.\n\n**Add Secret Tokens to env and properties files:**\n- Add the following key/value pairs to the `.env` file (for Docker deployment)\n  - Refer to the `.env.example` for example\n```\nGOOGLE_CLIENT_ID=your_client_id\nGOOGLE_CLIENT_SECRET=your_client_secret\nGOOGLE_REFRESH_TOKEN=your_refresh_token\n```\n- For Spring Boot deployment, add a `secrets-dev.properties` file and include the following properties\n  - Refer to `secret-dev.properties.example` for example\n```\napp.gmail.client.id=${GOOGLE_CLIENT_ID:client}\napp.gmail.client.secret=${GOOGLE_CLIENT_SECRET:secret}\napp.gmail.refresh.token=${GOOGLE_REFRESH_TOKEN:token}\n\nspring.security.oauth2.client.registration.google.client-id=${app.gmail.client.id}\nspring.security.oauth2.client.registration.google.client-secret=${app.gmail.client.secret}\n```\n\n---\n\n\u003ch2 id=\"usage\"\u003e💻 Usage\u003c/h2\u003e\n\n1. Register a new account or log in with an existing account.\n2. Add books to your library.\n3. Track reading progress (pages read / percentage).\n4. Connect with other users to view their activity.\n5. Manage your book collection across shelves.\n\n\u003ch2 id=\"contributing\"\u003e🤝 Contributing\u003c/h2\u003e\n\nWe welcome contributions! Follow these steps:\n\n1. Fork the repository\n2. Create a branch: `git checkout -b feat/my-feature` for features, `git checkout -b bugfix/my-fix` for bugfixes\n3. Commit your changes: `git commit -m \"Add feature\"`\n4. Push to the branch: `git push origin feature/my-feature`\n5. Open a Pull Request\n\n### Guidelines:\n- Follow existing code style\n- Include tests for new features when applicable\n- Update documentation as needed\n\n---\n\n\u003ch2 id=\"license\"\u003e📄 License\u003c/h2\u003e\n\nThis project is licensed under the **GNU General Public License v2 (GPL-2.0)**.  \nSee the full license text in the [LICENSE](LICENSE) file for details.\n\nYou are free to:\n\n- Use, copy, and modify the software\n- Distribute copies and derivatives under the same license\n\n\u003e This ensures that BookShare and any derivative works remain free software under GPL v2.\n\n---\n\n\u003ch2 id=\"contact\"\u003e📫 Contact\u003c/h2\u003e\n\n**BookShare** — Powered by ZedApps\n\nGitHub Profile: [smzoha](https://github.com/smzoha)  \nEmail: shamah.zoha@gmail.com","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmzoha%2Fbookshare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmzoha%2Fbookshare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmzoha%2Fbookshare/lists"}