{"id":29471363,"url":"https://github.com/masmuss/hono-elibrary","last_synced_at":"2026-04-12T13:05:34.260Z","repository":{"id":300762688,"uuid":"1007076905","full_name":"masmuss/hono-elibrary","owner":"masmuss","description":"🚀 A modern, containerized E-Library REST API built with Bun, Hono, Drizzle ORM, and PostgreSQL.","archived":false,"fork":false,"pushed_at":"2025-07-14T00:59:58.000Z","size":275,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-14T02:58:12.463Z","etag":null,"topics":["api","biomejs","bun","docker","drizzle-orm","elibrary-project","honojs","postgresql","redis","scalar","typescript","zod"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/masmuss.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-06-23T12:31:43.000Z","updated_at":"2025-07-14T01:00:02.000Z","dependencies_parsed_at":"2025-06-23T13:48:25.865Z","dependency_job_id":"0a98fe8d-e2cb-4e93-bfa5-76c4d49a949f","html_url":"https://github.com/masmuss/hono-elibrary","commit_stats":null,"previous_names":["masmuss/hono-elibrary"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/masmuss/hono-elibrary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masmuss%2Fhono-elibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masmuss%2Fhono-elibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masmuss%2Fhono-elibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masmuss%2Fhono-elibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masmuss","download_url":"https://codeload.github.com/masmuss/hono-elibrary/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masmuss%2Fhono-elibrary/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265304524,"owners_count":23743880,"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":["api","biomejs","bun","docker","drizzle-orm","elibrary-project","honojs","postgresql","redis","scalar","typescript","zod"],"created_at":"2025-07-14T14:01:04.794Z","updated_at":"2026-04-12T13:05:34.220Z","avatar_url":"https://github.com/masmuss.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📖 E-Library API\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Bun-%23000000.svg?style=for-the-badge\u0026logo=bun\" alt=\"Bun\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Hono-E36002?logo=hono\u0026logoColor=fff\u0026style=for-the-badge\" alt=\"Hono Badge\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Drizzle-%23C5F74F.svg?style=for-the-badge\u0026logo=drizzle\u0026logoColor=black\" alt=\"Drizzle ORM\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/PostgreSQL-%234169E1.svg?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white\" alt=\"PostgreSQL\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Redis-%23FF4438?logo=redis\u0026logoColor=fff\u0026style=for-the-badge\" alt=\"Redis Badge\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Docker-%232496ED.svg?style=for-the-badge\u0026logo=docker\u0026logoColor=white\" alt=\"Docker\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Scalar-1A1A1A?logo=scalar\u0026logoColor=fff\u0026style=for-the-badge\" alt=\"Scalar Badge\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Zod-3E67B1?logo=zod\u0026logoColor=fff\u0026style=for-the-badge\" alt=\"Zod Badge\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/TypeScript-%233178C6.svg?style=for-the-badge\u0026logo=typescript\u0026logoColor=white\" alt=\"TypeScript\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Biome-60A5FA?logo=biome\u0026logoColor=fff\u0026style=for-the-badge\" alt=\"Biome Badge\"\u003e\n\u003c/p\u003e\n\nA backend API for a simple e-library system built with a modern stack, featuring Bun as the runtime, Hono as the web framework, and Drizzle as the ORM. This project is fully containerized with Docker for ease of development and deployment.\n\n## ✨ Key Features\n\n-   **Authentication \u0026 Authorization**: JWT-based registration, login, and logout system with Role-Based Access Control (RBAC).\n-   **User Management (Admin)**: Full CRUD operations for managing users and their roles (`ADMIN`, `LIBRARIAN`, `MEMBER`).\n-   **Content Management (Admin)**: Ability to create, read, update, and delete book and category data.\n-   **Loan Lifecycle**: A complete book loan workflow, from a member's request, approval/rejection by a librarian, to the final return of the book.\n-   **Member Profile \u0026 History**: Members can view their personal profile and their own loan history.\n-   **API Validation \u0026 Documentation**: Type-safe request validation using Zod, and automated, interactive API documentation with `@hono/zod-openapi` and Scalar UI.\n-   **Centralized Error Handling**: A consistent and informative error handling system across all endpoints.\n-   **Automated Code Quality**: Equipped with Git Hooks using Husky and Biome to ensure code quality and formatting before every commit and push.\n\n## 🛠️ Tech Stack\n\n-   **Runtime**: [Bun](https://bun.sh/)\n-   **Web Framework**: [Hono](https://hono.dev/)\n-   **Database**: [PostgreSQL](https://www.postgresql.org/)\n-   **ORM**: [Drizzle ORM](https://orm.drizzle.team/)\n-   **Caching**: [Redis](https://redis.io/)\n-   **Validation**: [Zod](https://zod.dev/)\n-   **Containerization**: [Docker](https://www.docker.com/) \u0026 Docker Compose\n-   **Language**: [TypeScript](https://www.typescriptlang.org/)\n-   **Code Quality**: [Biome](https://biomejs.dev/) (Linter \u0026 Formatter) \u0026 [Husky](https://typicode.github.io/husky/) (Git Hooks)\n\n## 🚀 Getting Started\n\nTo run this project in your local environment, you must have **Bun** and **Docker** installed.\n\n### 1. **Clone the Repository**\n\n```bash\ngit clone https://github.com/masmuss/hono-elibrary.git\ncd hono-elibrary\n```\n\n### 2. **Run the Setup Script**\nFirst, make the script executable:\n\n    chmod +x setup.sh\n\nThen, run it:\n    \n    ./setup.sh\n    \nThe script will check your dependencies, create the necessary `.env` files, and guide you through starting the services.\n\nYour application will be running and accessible at `http://localhost:3000`.\n\n## 📚 Usage\n\n### API Documentation\nThis project includes interactive API documentation powered by Scalar. You can access it to see all available endpoints and try them out directly.\n\n- Documentation URL: `http://localhost:3000/reference`\n\n### Running Unit Tests\nEnsure your Docker services are running (`docker-compose up`). Then, in a separate terminal, run the following command:\n\n```bash\nbun run test\n```\n\nThis command will execute all test files in the `test/` directory using the environment defined in `.env.test`.\n\n### Database Migrations\n\nThis project uses `drizzle-kit` to manage database schema migrations.\n\n- To generate a new migration file after changing the schema in `src/db/schema.ts`:\n\n    ```bash\n    bun run migrate:generate\n    ```\n- To apply migrations manually (optional, as it's automated on startup):\n  \n  ```bash\n  docker-compose exec app bun run db:migrate\n  ```\n\n## \n📂 Project Structure\n```plaintext\ne-library/\n├── .husky/         # Git Hooks configuration\n├── src/            # Source code\n│   ├── core/       # Core logic: base classes, handlers, repositories, schemas\n│   ├── db/         # Drizzle config, schema, and migration files\n│   ├── lib/        # Hono app setup and global types\n│   ├── middlewares/  # Custom middlewares\n│   ├── routes/     # API endpoint definitions\n│   └── index.ts    # Main application entry point\n├── test/           # All unit test files\n├── .env.docker.example # Example environment file for Docker\n├── .env.test.example   # Example environment file for testing\n├── docker-compose.yml # Docker services definition\n├── Dockerfile.dev    # Instructions for building the development image\n├── setup.sh        # Interactive setup script for new developers\n└── package.json    # Project dependencies and scripts\n```\n\nMade with ❤️ and a passion for learning!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasmuss%2Fhono-elibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasmuss%2Fhono-elibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasmuss%2Fhono-elibrary/lists"}