{"id":25046399,"url":"https://github.com/dung204/books-maison-backend","last_synced_at":"2026-04-14T04:03:30.460Z","repository":{"id":239117337,"uuid":"798578049","full_name":"dung204/books-maison-backend","owner":"dung204","description":"REST API for Books Maison - an online library web application","archived":false,"fork":false,"pushed_at":"2025-01-13T07:28:18.000Z","size":630,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T06:44:01.426Z","etag":null,"topics":["docker","jwt","momo","nestjs","postgresql","redis","rest-api","typescript"],"latest_commit_sha":null,"homepage":"https://api.books-maison.live/api-docs","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dung204.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-05-10T03:58:03.000Z","updated_at":"2024-11-19T09:32:52.000Z","dependencies_parsed_at":"2024-06-07T18:30:38.793Z","dependency_job_id":"eaa615d0-c7e7-49b3-8cdc-669f62209870","html_url":"https://github.com/dung204/books-maison-backend","commit_stats":null,"previous_names":["dung204/books-maison-remake-backend","dung204/books-maison-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dung204%2Fbooks-maison-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dung204%2Fbooks-maison-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dung204%2Fbooks-maison-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dung204%2Fbooks-maison-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dung204","download_url":"https://codeload.github.com/dung204/books-maison-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246400924,"owners_count":20771090,"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","jwt","momo","nestjs","postgresql","redis","rest-api","typescript"],"created_at":"2025-02-06T06:40:36.362Z","updated_at":"2026-04-14T04:03:30.425Z","avatar_url":"https://github.com/dung204.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://api.books-maison.live/api-docs\" target=\"blank\"\u003e\u003cimg src=\"static/images/books-maison-logo-dark.svg\" width=\"400\" alt=\"Nest Logo\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eThe RESTful API for Books Maison - an online library web application\u003c/p\u003e\n\nLive API documentation: [http://api.books-maison.live/api-docs](http://api.books-maison.live/api-docs)\n\n## Table of Contents\n\n- [1. Primary Features](#1-primary-features)\n- [2. Technologies Used](#2-technologies-used)\n- [3. Getting Started](#3-getting-started)\n  - [3.1. Prerequisites](#31-prerequisites)\n  - [3.2. Installation](#32-installation)\n- [4. License](#4-license)\n\n## 1. Primary Features\n\n- CRUD (Create, Read, Update, Delete) users, books, authors, checkouts, fines\n- User authentication and authorization using JWT (JSON Web Token)\n- Allowing users to borrow and return books\n- Calculating fines for late returns\n- Allowing users to pay fines using [Momo E-wallet](https://www.momo.vn/)\n\n\u003e **Note**:\n\u003e\n\u003e - Whenever a user borrows a book, a checkout record is created with a due date.\n\u003e - If the user returns the book after the due date, a fine is calculated based on the number of days the book is overdue.\n\n## 2. Technologies Used\n\n- [NestJS](https://nestjs.com/): A progressive Node.js framework for building efficient, reliable and scalable server-side applications.\n- [TypeORM](https://typeorm.io/): An ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used with TypeScript and JavaScript (ES5, ES6, ES7, ES8).\n- [PostgreSQL](https://www.postgresql.org/): A powerful, open source object-relational database system.\n- [Redis](https://redis.io/): An open source, in-memory data structure store, used as a database, cache, and message broker.\n- [Swagger UI](https://swagger.io/tools/swagger-ui/): A tool that generates interactive API documentation that lets you try out the API calls directly in the browser.\n- [Docker](https://www.docker.com/): A platform for developing, shipping, and running applications in containers.\n- [DigitalOcean](https://www.digitalocean.com/): A cloud infrastructure provider that offers cloud services to help deploy modern apps.\n\n## 3. Getting Started\n\n### 3.1. Prerequisites\n\nYou need to have the following installed on your machine:\n\n- [Node.js 22.3.0+](https://nodejs.org/en/download/)\n- [Yarn 1.22.22](https://yarnpkg.com/getting-started/install)\n- [Docker](https://docs.docker.com/get-docker/)\n- [Docker Compose](https://docs.docker.com/compose/install/)\n- [Git](https://git-scm.com/downloads)\n\nOnce installed Node.js, you also have to enable [`corepack`](https://nodejs.org/api/corepack.html), and install the correct version of Yarn:\n\n```bash\ncorepack enable \u0026\u0026 corepack install --global yarn@1.22.22\n```\n\n### 3.2. Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/dung204/books-maison-backend.git\n```\n\n2. Change into the project directory:\n\n```bash\ncd books-maison-backend\n```\n\n3. Install the dependencies:\n\n```bash\nyarn install --frozen-lockfile\n```\n\n4. Create a `.env` file in the root of the project. The `.env` **must** contains all variables in the [`.env.example`](.env.example) file.\n\n\u003e **Note**: The `MOMO_IPN_URL` environment variable is the URL that Momo will send the IPN (Instant Payment Notification) to. During development, you must a service like [ngrok](https://ngrok.com/), to expose your local server to the internet, and then use the generated URL as the value for this variable.\n\n5. The application always runs in HTTPS mode **only when `USE_HTTPS` in `.env` is set to `true`**. This requires two files: `cert.pem` (the public TLS certificate) and `key.pem` (the private key). Both files must be stored in the `cert` directory at the root of the project. You can use [`mkcert`](https://github.com/FiloSottile/mkcert) to generate these files for development purposes.\n\n6. To run the application in development mode, you have to install PostgreSQL and Redis (on your local machine or using Docker). You have to make sure that the PostgreSQL and Redis connection in `.env` file is correct. Once ready, you can run the following command:\n\n```bash\nyarn start:dev\n```\n\n7. To run the application in production-like mode, you can use Docker Compose with the following command:\n\n```bash\ndocker-compose up -d\n```\n\n8. Run the database migrations:\n\n```bash\nyarn migration:run\n```\n\nIn case of running with Docker Compose, you have to run the migrations inside the Docker container. You can do this by running the following command:\n\n```bash\ndocker-compose exec api yarn migration:run\n```\n\n\u003e **Note**: `api` is the name of the service in the [`docker-compose.yml`](docker-compose.yml) file.\n\n9. The application should be running at `http://localhost:\u003cAPP_PORT\u003e`, where `APP_PORT` is the environment variable in the `.env` file. The API documentation can be found at `http://localhost:\u003cAPP_PORT\u003e/api-docs`.\n\n10. To stop the application running with Docker Compose, you can run the following command:\n\n```bash\ndocker-compose down\n```\n\n## 4. License\n\nThis project is licensed under the Unlicense - see the [LICENSE](LICENSE) file for details.\n\n[![DigitalOcean Referral Badge](https://web-platforms.sfo2.cdn.digitaloceanspaces.com/WWW/Badge%203.svg)](https://www.digitalocean.com/?refcode=2fd2624bd8d3\u0026utm_campaign=Referral_Invite\u0026utm_medium=Referral_Program\u0026utm_source=badge)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdung204%2Fbooks-maison-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdung204%2Fbooks-maison-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdung204%2Fbooks-maison-backend/lists"}