{"id":20109690,"url":"https://github.com/mufidu/bookstore-api","last_synced_at":"2025-11-28T06:07:28.031Z","repository":{"id":244727666,"uuid":"816081714","full_name":"mufidu/bookstore-api","owner":"mufidu","description":"API for managing an online bookstore. WIth auth, cart, and payment system.","archived":false,"fork":false,"pushed_at":"2024-06-17T11:40:11.000Z","size":262,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T18:30:48.915Z","etag":null,"topics":["bookstore"],"latest_commit_sha":null,"homepage":"https://bookstore-app.fly.dev","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/mufidu.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}},"created_at":"2024-06-17T02:05:24.000Z","updated_at":"2024-06-29T02:47:08.000Z","dependencies_parsed_at":"2024-06-17T03:25:48.535Z","dependency_job_id":"2022ab5b-3474-4069-aefb-2b312320d80f","html_url":"https://github.com/mufidu/bookstore-api","commit_stats":null,"previous_names":["mufidu/bookstore-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mufidu/bookstore-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mufidu%2Fbookstore-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mufidu%2Fbookstore-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mufidu%2Fbookstore-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mufidu%2Fbookstore-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mufidu","download_url":"https://codeload.github.com/mufidu/bookstore-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mufidu%2Fbookstore-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27298828,"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-11-28T02:00:06.623Z","response_time":58,"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":["bookstore"],"created_at":"2024-11-13T18:09:13.195Z","updated_at":"2025-11-28T06:07:28.016Z","avatar_url":"https://github.com/mufidu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Online Bookstore Management System\n\nThis project is a backend system for managing an online bookstore. It allows customers to browse, search, and purchase books while providing functionality for inventory and customers management for admins.\n\n## Features\n\n## CI/CD\n- **Testing:** Unit and integration tests are run on GitHub Actions every time a commit is pushed.\n- **Continuous Deployment:** Every successful push to the main branch triggers a deployment to fly.io.\n\n### User Authentication\n- **Roles:** Two user roles are supported: customer and admin.\n- **Customer Authentication:** Customers can register, log in, and update their profile information.\n- **Admin Management:** Admins can manage customers' accounts.\n\n### Book Management\n- **Add Books:** Admins can add new books to the inventory via an API endpoint.\n- **Update Books:** An endpoint is available for admins to update existing book details.\n- **Retrieve Books:** Users can retrieve a list of books with filtering options; genre, author, and year.\n\n### Shopping Cart\n- **Add to Cart:** Customers can add books to their shopping cart.\n- **Update Cart:** Customers can update the quantity or remove items from their cart.\n- **Total Price Calculation:** The total price of items in the cart is automatically calculated each time the cart is updated.\n\n### Order Processing\n- **Place Orders:** Customers can place orders to checkout their carts.\n- **Inventory Deduction:** The ordered quantity is deducted from the inventory upon order placement.\n- **Payment Gateway:** Midtrans payment gateway is integrated to process order payments. Customers can pay using QRIS.\n- **Email Notification:** Customers receive an email confirmation after placing an order.\n\n### Inventory Management\n- **View and Manage Inventory:** Admins can view and manage the current inventory.\n\n### Security\n- **Validation and Error Handling:** All API endpoints have proper validation and error handling.\n- **Sensitive Information:** Sensitive information is securely encrypted.\n\n### Logging and Monitoring\n- **Logging:** Important events and errors are logged with Morgan.\n- **Monitoring:** Basic monitoring for API performance is implemented using Prometheus.\n\n### Testing\n- **Unit Tests:** Important API endpoints (book and order) have unit tests.\n- **Integration Testing:** Integration testing ensures components work together seamlessly.\n\n## Database Schema\n\n![Database Schema](https://raw.githubusercontent.com/mufidu/jobhun-devops-test/main/Screenshot%202024-06-17%20at%2015.45.24.jpg)\n\n## Documentation\n\nThe API documentation is available at [Postman](https://documenter.getpostman.com/view/33823495/2sA3XS9g65).\n\n## Getting Started\n\n### Tech Stack\n\n- Node.js and npm for server-side code.\n- PostgreSQL for database.\n- Midtrans for payment gateway.\n- Postman for API documentation.\n- fly.io for deployment.\n\n### Setup\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/mufidu/bookstore-api.git\ncd bookstore-api\n```\n\n2. Install dependencies:\n\n```bash\nnpm install\n```\n\n3. Set up the environment variables:\n\n```bash\ncp .env.example .env\n```\n\n4. Set up the database:\n\n```bash\nNODE_ENV=development npx sequelize-cli db:migrate\n```\n\n5. Start the server:\n\n```bash\nnpm run dev\n```\n\n6. The server will be running at `http://localhost:9000`.\n\n## Deployment\n\nThe API is deployed on fly.io. The live version is available at [https://bookstore-app.fly.dev](https://bookstore-app.fly.dev).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmufidu%2Fbookstore-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmufidu%2Fbookstore-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmufidu%2Fbookstore-api/lists"}