{"id":23674564,"url":"https://github.com/sendistephen/bookstore","last_synced_at":"2026-04-09T21:05:03.498Z","repository":{"id":264431673,"uuid":"893129623","full_name":"sendistephen/bookstore","owner":"sendistephen","description":"Application for managing a book store. Built with python, flask, react and docker","archived":false,"fork":false,"pushed_at":"2025-01-13T16:15:57.000Z","size":187,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T23:03:56.743Z","etag":null,"topics":["docker","flask","flask-sqlalchemy","nginx"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sendistephen.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}},"created_at":"2024-11-23T16:02:14.000Z","updated_at":"2025-01-13T16:16:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"167453d2-bb71-4fd9-94bc-43b6598423c0","html_url":"https://github.com/sendistephen/bookstore","commit_stats":null,"previous_names":["sendistephen/bookstore"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sendistephen/bookstore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendistephen%2Fbookstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendistephen%2Fbookstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendistephen%2Fbookstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendistephen%2Fbookstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sendistephen","download_url":"https://codeload.github.com/sendistephen/bookstore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendistephen%2Fbookstore/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263641681,"owners_count":23493428,"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","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":["docker","flask","flask-sqlalchemy","nginx"],"created_at":"2024-12-29T13:27:35.025Z","updated_at":"2026-04-09T21:05:03.466Z","avatar_url":"https://github.com/sendistephen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bookstore API\n\nA robust Flask-based backend application for managing a bookstore, featuring comprehensive book management, customer interactions, and administrative capabilities.\n\n## Overview\n\nThis API powers a modern bookstore platform with features including inventory management, customer accounts, order processing, and secure payments. Built with scalability and maintainability in mind using Python, Flask, PostgreSQL, and Docker.\n\n## Technology Stack\n\n- **Backend Framework**: Python 3.9, Flask\n- **Database**: PostgreSQL\n- **Caching**: Redis\n- **Containerization**: Docker, Docker Compose\n- **Web Server**: Nginx\n- **Migration Tool**: Alembic\n- **Task Queue**: Celery (coming soon)\n\n## Project Structure\n\n```\nbookstore/\n├── app/                    # Application code\n│   ├── api/               # API endpoints and routes\n│   ├── models/            # Database models\n│   ├── schemas/           # Pydantic/Marshmallow schemas\n│   ├── services/          # Business logic services\n│   ├── templates/         # HTML templates\n│   ├── extensions.py      # Flask extensions\n│   └── __init__.py        # App factory and configuration\n├── config/                # Configuration files\n│   ├── config.py         # App configuration classes\n│   └── logging_config.py  # Logging configuration\n├── docker/                # Docker configuration\n│   └── local/            # Local development setup\n├── migrations/            # Database migrations\n├── scripts/              # Utility scripts\n├── tests/                # Test suite\n├── utils/                # Helper utilities\n├── .env                  # Environment variables\n├── .env.example          # Example environment file\n├── alembic.ini           # Alembic configuration\n├── local.yml             # Docker Compose configuration\n├── manage.py             # Management commands\n├── requirements.txt      # Python dependencies\n└── run.py               # Application entry point\n```\n\n## Features\n\n### Book Management\n- Create, read, update, and delete books\n- Search by title, author, or genre\n- Manage inventory and pricing\n\n### Customer Features\n- User registration and authentication\n- Book browsing and searching\n- Shopping cart management\n- Order history\n\n### Administrative Tools\n- User management\n- Order processing\n- Inventory control\n- Sales reporting\n\n### Security\n- Role-based access control\n- Secure authentication\n- Protected admin routes\n- Data validation\n\n## Getting Started\n\n### Prerequisites\n\n- Docker and Docker Compose\n- Make\n- Git\n\n### Quick Start\n\n1. **Clone the Repository**\n```bash\ngit clone https://github.com/sendi-stev/bookstore-api.git\ncd bookstore-api\n```\n\n2. **Environment Setup**\n```bash\n# Copy environment files\ncp .env.example .env\ncp .admin_credentials.example .admin_credentials\n```\n\n3. **Launch Application**\n```bash\n# Build and start services\nmake build\nmake up\n\n# Initialize database\nmake migrate\nmake seed-db\n```\n\n## Development Guide\n\n### Development Workflow Commands\n\n#### Docker Management\n- `make build`: Build Docker images\n- `make up`: Start services in detached mode\n- `make down`: Stop services\n- `make down-v`: Stop services and remove volumes\n- `make reset-db`: Completely reset database (remove volumes, recreate, migrate, seed)\n- `make clean`: Clean up Docker resources\n\n#### Database Management\n- `make migrate`: Run all pending database migrations\n- `make migration MESSAGE=\"Your migration description\"`: Create a new database migration\n- `make seed-db`: Seed database with initial data\n- `make create-admin`: Create an admin user\n\n#### Development\n- `make runserver`: Start development server\n- `make test`: Run test suite\n\n### Database Migrations\n\nThe project uses Alembic for database migrations. To create and apply migrations:\n\n1. Create a new migration:\n```bash\nmake migration MESSAGE=\"Description of schema changes\"\n```\n\n2. Apply migrations:\n```bash\nmake migrate\n```\n\n3. Reset database (drops and recreates):\n```bash\nmake reset-db\n```\n\n### Troubleshooting\n\n- If you encounter migration issues, use `make reset-db` to completely reset the database\n- Check Docker logs with `docker-compose -f local.yml logs api` for detailed error messages\n- Ensure all environment variables are correctly set in `.env`\n\n## Testing\n\n### Setup for Testing\n\n1. Create a virtual environment:\n```bash\npython3 -m venv venv\nsource venv/bin/activate\n```\n\n2. Install dependencies:\n```bash\npip install -r requirements.txt\npip install -r requirements-dev.txt\n```\n\n### Running Tests\n\nRun the full test suite with coverage:\n```bash\n# Run all tests with verbose output and coverage\npytest -vv --cov=app\n\n# Run tests for a specific module\npytest tests/unit/test_book_category_service.py\n\n# Generate HTML coverage report\npytest --cov=app --cov-report=html\n```\n\n### Test Configuration\n\n- Tests use an in-memory SQLite database\n- Configuration is managed through `config/config.py`\n- Test fixtures are defined in `tests/conftest.py`\n\n### Common Test Commands\n\n```bash\n# Run tests and stop on first failure\npytest -x\n\n# Run tests with detailed output\npytest -s\n\n# Run tests matching a specific pattern\npytest -k \"test_create\"\n```\n\n### Code Quality Checks\n\n```bash\n# Run linters\nflake8 app/\nblack --check app/\nisort --check-only app/\n\n# Run type checking\nmypy app/\n```\n\n### Debugging Tests\n\nIf you encounter import or configuration issues:\n1. Ensure all dependencies are installed\n2. Check your Python path\n3. Verify environment variables\n4. Use `pytest -vv` for detailed output\n\n## Deployment\n\n### Fresh Installation\n\n```bash\nmake build\nmake up\nmake migrate\nmake seed-db\n```\n\n### Update Existing Installation\n\n```bash\ngit pull\nmake build\nmake migrate\nmake up\n```\n\n## Configuration\n\n### Environment Variables\n\nKey configuration variables in `.env`:\n\n- `FLASK_ENV`: Application environment (development/production)\n- `DATABASE_URL`: PostgreSQL connection string\n- `REDIS_URL`: Redis connection string\n- `SECRET_KEY`: Application secret key\n\n### Admin Setup\n\nThe `.admin_credentials` file is required for database seeding and contains initial admin user details. This file should be kept secure and not committed to version control.\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit changes (`git commit -m 'Add amazing feature'`)\n4. Push to 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 file for details.\n\n## Contact\n\nSendi Steve - sendi.stev@gmail.com\n\nProject Link: [https://github.com/sendi-stev/bookstore-api](https://github.com/sendi-stev/bookstore-api)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsendistephen%2Fbookstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsendistephen%2Fbookstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsendistephen%2Fbookstore/lists"}