{"id":25646419,"url":"https://github.com/reinaldoper/js-books","last_synced_at":"2026-06-10T23:31:42.472Z","repository":{"id":278389064,"uuid":"935445609","full_name":"reinaldoper/js-books","owner":"reinaldoper","description":"Projeto para emprestimos de livros e gerenciamento de usuarios.","archived":false,"fork":false,"pushed_at":"2025-02-19T13:37:05.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-19T14:32:46.112Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/reinaldoper.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":"2025-02-19T13:08:34.000Z","updated_at":"2025-02-19T13:37:08.000Z","dependencies_parsed_at":"2025-02-19T14:44:26.958Z","dependency_job_id":null,"html_url":"https://github.com/reinaldoper/js-books","commit_stats":null,"previous_names":["reinaldoper/js-books"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reinaldoper/js-books","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reinaldoper%2Fjs-books","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reinaldoper%2Fjs-books/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reinaldoper%2Fjs-books/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reinaldoper%2Fjs-books/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reinaldoper","download_url":"https://codeload.github.com/reinaldoper/js-books/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reinaldoper%2Fjs-books/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34175887,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"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-02-23T10:27:24.980Z","updated_at":"2026-06-10T23:31:42.451Z","avatar_url":"https://github.com/reinaldoper.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Biblioteca\n\n## Descrição\n\nEste é um projeto backend desenvolvido em Node.js utilizando Express, Prisma e outras bibliotecas para gerenciar um sistema de biblioteca. A aplicação permite o registro de usuários, login, gerenciamento de livros e empréstimos de livros.\n\n## Instalação\n\n1. Clone o repositório:\n   ```bash\n   git clone \u003cURL_DO_NOVO_REPOSITORIO\u003e\n   cd js-books\n   ```\n\n2. Instale as dependências:\n\n   ```bash\n   npm install\n   docker compose up -d\n   ```\n\n3. Configure as variáveis de ambiente: Crie um arquivo .env na raiz do projeto e adicione as seguintes variáveis:\n\n   ```bash\n    API_LISTENING_PORT=3000\n    DB_USERNAME=\u003cseu_usuario\u003e\n    DB_PASSWORD=\u003csua_senha\u003e\n    DB_HOST=\u003cseu_host\u003e\n    DB_PORT=\u003csua_porta\u003e\n    DB_NAME=\u003cseu_banco_de_dados\u003e\n   ```\n\n4. Inicialize o Prisma:\n\n   ```bash\n    npx prisma db push\n    npx prisma migrate deploy\n   ```\n\n5. Inicie a aplicação:\n\n   ```bash\n   npm run dev\n \n   ```\n## Endpoints\n\n### Autenticação de Usuário\n- Login de Usuário\n- POST /user/login\n\n    ```bash\n    {\n      \"username\": \"string\",\n      \"password\": \"string\"\n    }\n    ```\n\n### Registro de Usuário\n\n- POST /user/register\n\n    ```bash\n    {\n      \"email\": \"string\",\n      \"username\": \"string\",\n      \"password\": \"string\"\n    }\n    ```\n\n### Gerenciamento de Livros\n- Criar Livros\n- POST /books\n    \n    ```bash\n    {\n      \"books\": [\n        {\n          \"title\": \"string\",\n          \"author\": \"string\",\n          \"edition\": \"string\",\n          \"publisher\": \"string\",\n          \"isbn\": \"string\",\n          \"genre\": \"string\",\n          \"page_count\": \"number\",\n          \"language\": \"string\",\n          \"publication_year\": \"number\"\n        }\n      ]\n    }\n    ```\n\n### Obter Livros\n- GET /books\n1. Query Params:\n2. page: Número da página (opcional, padrão: 0)\n3. Respostas:\n- 200 OK: Lista de livros.\n\n\n### Atualizar Livro\n- PUT /books/:isbn\n\n    ```bash\n    {\n      \"title\": \"string\",\n      \"author\": \"string\",\n      \"edition\": \"string\",\n      \"publisher\": \"string\",\n      \"genre\": \"string\",\n      \"page_count\": \"number\",\n      \"language\": \"string\",\n      \"publication_year\": \"number\"\n    }\n    ```\n\n### Deletar Livro\n1. DELETE /books/:isbn\n2. Respostas:\n- 204 No Content: Livro deletado com sucesso.\n- 400 Bad Request: Livro não encontrado.\n\n\n### Empréstimo de Livros\n1. Emprestar Livro\n\n- POST /borrow\n    ```bash\n    {\n      \"isbn\": \"string\"\n    }\n    ```\n\n### Devolver Livro\n1. DELETE /return/:isbn\n- Respostas:\n- 204 No Content: Livro devolvido com sucesso.\n- 400 Bad Request: Livro não encontrado ou não emprestado.\n2. Obter Livros Emprestados\n- GET /borrowed\n- Respostas:\n- 200 OK: Lista de livros emprestados.\n\n\n### Tecnologias Utilizadas\n- Node.js \u003e18\n- Express\n- Prisma\n- MySQL\n- bcrypt\n- cookie-parser\n- cors\n- dotenv\n- jsonwebtoken\n- nodemon\n- zod\n- docker","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freinaldoper%2Fjs-books","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freinaldoper%2Fjs-books","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freinaldoper%2Fjs-books/lists"}