{"id":30594026,"url":"https://github.com/codershubinc/yourbook-api","last_synced_at":"2025-08-29T19:33:19.969Z","repository":{"id":310206827,"uuid":"1034961200","full_name":"codershubinc/yourBook-api","owner":"codershubinc","description":"this is backend for yourBook app","archived":false,"fork":false,"pushed_at":"2025-08-26T00:52:41.000Z","size":138,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-26T02:37:55.218Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/codershubinc.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}},"created_at":"2025-08-09T11:01:06.000Z","updated_at":"2025-08-26T00:52:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"6e535908-f7da-45f0-868a-e28a895e86d8","html_url":"https://github.com/codershubinc/yourBook-api","commit_stats":null,"previous_names":["codershubinc/yourbook-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codershubinc/yourBook-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codershubinc%2FyourBook-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codershubinc%2FyourBook-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codershubinc%2FyourBook-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codershubinc%2FyourBook-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codershubinc","download_url":"https://codeload.github.com/codershubinc/yourBook-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codershubinc%2FyourBook-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272749597,"owners_count":24986868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-08-29T19:33:19.368Z","updated_at":"2025-08-29T19:33:19.957Z","avatar_url":"https://github.com/codershubinc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yourBook API\n\nA Flask-based REST API for managing personal books, reading progress, and sharing functionality.\n\n## 🚀 Features\n\n- **User Management**: User registration, authentication, and profile management\n- **Book Management**: Add, edit, and organize personal book collections\n- **Reading Progress**: Track reading progress with page-by-page updates\n- **Sharing**: Share books and reading progress with friends\n- **Health Monitoring**: Built-in health check endpoints\n- **MongoDB Integration**: Robust database connectivity with connection pooling\n\n## 🛠️ Tech Stack\n\n- **Backend**: Flask 3.1.1\n- **Database**: MongoDB (via PyMongo 4.14.1)\n- **Environment**: Python 3.13+ with virtual environment\n- **Production**: Gunicorn WSGI server\n- **Testing**: pytest with Flask integration\n\n## 📋 Prerequisites\n\n- Python 3.13 or higher\n- MongoDB Atlas account or local MongoDB installation\n- Virtual environment (recommended)\n\n## 🔧 Installation\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/codershubinc/yourBook-api.git\n   cd yourBook-api\n   ```\n\n2. **Create and activate virtual environment**\n\n   ```bash\n   python -m venv .venv\n   source .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\n   ```\n\n3. **Install dependencies**\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. **Set up environment variables**\n\n   Create a `.env` file in the root directory:\n\n   ```env\n   MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/?retryWrites=true\u0026w=majority\n   MONGO_DB_NAME=yourDayBookApi\n   ```\n\n   The `.flaskenv` file is already configured for development:\n\n   ```env\n   FLASK_APP=app.py\n   FLASK_ENV=development\n   FLASK_DEBUG=1\n   FLASK_RUN_PORT=5001\n   ```\n\n## 🚀 Running the Application\n\n### Development Mode\n\n**Option 1: Using Flask CLI (Recommended)**\n\n```bash\nsource .venv/bin/activate\nflask run\n```\n\n**Option 2: Using Python directly**\n\n```bash\nsource .venv/bin/activate\npython run.py\n```\n\nThe API will be available at `http://localhost:5001`\n\n### Production Mode\n\n```bash\ngunicorn -w 4 -b 0.0.0.0:8000 app:app\n```\n\n## 📁 Project Structure\n\n```\nyourBook-api/\n├── app.py                     # Flask application instance\n├── run.py                     # Application entry point\n├── config.py                  # Configuration settings\n├── requirements.txt           # Python dependencies\n├── .env                       # Environment variables (private)\n├── .flaskenv                  # Flask environment variables (public)\n├── yourBookApi/\n│   ├── __init__.py\n│   ├── core/                  # Core functionality\n│   │   ├── auth.py           # Authentication logic\n│   │   └── extensions.py     # Flask extensions\n│   ├── models/               # Database models\n│   ├── modules/              # Feature modules\n│   │   ├── books/           # Book management\n│   │   ├── users/           # User management\n│   │   └── sharing/         # Sharing functionality\n│   ├── routes/              # API routes\n│   └── utils/               # Utility functions\n│       ├── cloudinary_service.py\n│       └── db/\n│           └── db_connect.py # Database connection\n└── typings/                 # Type definitions\n```\n\n## 🔗 API Endpoints\n\n### Core Endpoints\n\n- `GET /` - API status and configuration info\n- `GET /health` - Health check with database connectivity\n\n### Planned Endpoints\n\n- `POST /users` - Create new user\n- `GET /users/{id}` - Get user profile\n- `POST /books` - Add new book\n- `GET /books` - List user's books\n- `PUT /books/{id}/progress` - Update reading progress\n- `POST /sharing` - Share book with friends\n\n## 🗄️ Database Schema\n\nThe API uses MongoDB with the following main collections:\n\n- **users**: User profiles and authentication\n- **books**: Book metadata and user collections\n- **reading_progress**: Page-by-page reading tracking\n- **sharing**: Book sharing and social features\n\n## 🧪 Testing\n\nRun the test suite:\n\n```bashv\n# Install test dependencies (if not already installed)\npip install pytest pytest-flask\n\n# Run tests\npytest\n\n# Run with coverage\npytest --cov=yourBookApi\n```\n\n## 🔍 Health Check\n\nCheck if the API and database are running properly:\n\n```bash\ncurl http://localhost:5001/health\n```\n\nExpected response:\n\n```json\n{\n  \"status\": \"healthy\",\n  \"database\": \"connected\",\n  \"db_name\": \"yourDayBookApi\"\n}\n```\n\n##  Documentation\n\n- [API Architecture](./yourBookApi_detailed_architecture.excalidraw) - Visual architecture diagram\n- [Project Plan](./yourBookApi_project_plan.md) - Development roadmap and requirements\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 👥 Authors\n\n- **codershubinc** - _Initial work_ - [GitHub](https://github.com/codershubinc)\n\n## 🙏 Acknowledgments\n\n- Flask community for the excellent web framework\n- MongoDB for reliable database services\n- Python ecosystem for robust development tools\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodershubinc%2Fyourbook-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodershubinc%2Fyourbook-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodershubinc%2Fyourbook-api/lists"}