{"id":21581630,"url":"https://github.com/tsaytson/boardcamp-node","last_synced_at":"2026-04-05T23:02:13.558Z","repository":{"id":135953252,"uuid":"599578893","full_name":"TSaytson/boardcamp-node","owner":"TSaytson","description":"A management system for board games rentals built with Node and Express, enjoy the classics!","archived":false,"fork":false,"pushed_at":"2025-01-29T16:41:51.000Z","size":727,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T08:14:39.533Z","etag":null,"topics":["dayjs","express","fakerjs","jest","nodejs","postgresql","prisma","supertest","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":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TSaytson.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":"2023-02-09T12:48:29.000Z","updated_at":"2025-01-29T16:41:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"0bfbe042-9c28-45ae-a618-615e3e1f361e","html_url":"https://github.com/TSaytson/boardcamp-node","commit_stats":null,"previous_names":["tsaytson/boardcamp-node"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TSaytson%2Fboardcamp-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TSaytson%2Fboardcamp-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TSaytson%2Fboardcamp-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TSaytson%2Fboardcamp-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TSaytson","download_url":"https://codeload.github.com/TSaytson/boardcamp-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244181393,"owners_count":20411605,"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":["dayjs","express","fakerjs","jest","nodejs","postgresql","prisma","supertest","typescript","zod"],"created_at":"2024-11-24T14:13:11.013Z","updated_at":"2025-12-30T21:04:44.928Z","avatar_url":"https://github.com/TSaytson.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome to Boardcamp API\nThe API for the lovers of board games.\n## About\nBoardcamp is a REST API to manage board games rentals.\n\n## How to run for development\n1. Clone this repository\n```\ngit clone https://github.com/TSaytson/boardcamp-node\n```\n2. Install the dependencies (remove pnpm-lock.yaml if using other package manager than pnpm)\n```\npnpm i\n```\n3. Create a PostgreSQL database with the name you want\n4. Configure the .env file using the .env.example file\n5. Run all migrations\n```\npnpm dlx prisma migrate dev\n```\n6. Run the back-end in a development environment:\n```\npnpm dev\n```\n## How to run tests\n1. Configure the .env.test file using the .env.example file\n2. Run all migrations\n```\npnpm test:migration:generate\n```\n3. Run tests: (locally)\n```\npnpm test\n```\n## How to run with docker\n1. Configure the .env file accordingly to .env.example file\n2. Run docker compose\n```\ndocker compose up -d (Ubuntu)\n```\n3. Run migration script\n```\ndocker exec boardcamp_api pnpm deploy:migration:generate\n```\n\nBoardcamp API handles REST requests for board games rentals as described below\n\n## Categories\n\n### GET /categories\n```\n[\n  {\n    \"id\": 1,\n    \"name\": 'strategy'\n  },\n  {\n    \"id\": 2,\n    \"name\": \"criminal\"\n  },\n]\n```\n\n### POST /categories\n#### body\n```\n{\n  \"name\": 'strategy',\n}\n```\n#### Response\n#### status 201\n```\n{\n  \"message\": \"Category strategy created\"\n}\n```\n## Customers\n\n### GET /customers\n#### Response\n```\n{\n  \"id\": 1,\n  \"name\": 'João Alfredo',\n  \"cpf\": '01234567890'\n  \"birthday\": '1994-04-28',\n  \"phone\": '31999999999'\n}\n```\n### GET /customers/:customerId\n#### Response\n```\n{\n  \"id\": 1,\n  \"name\": 'João Alfredo',\n  \"cpf\": '01234567890'\n  \"birthday\": '1994-04-28',\n  \"phone\": '31999999999'\n}\n```\n### POST /customers\n#### body\n```\n{\n  \"name\": 'João Alfredo',\n  \"cpf\": '01234567890',\n  \"birthday\": '1994-04-28',\n  \"phone\": '31999999999'\n}\n```\n#### Response\n#### status 201\n```\n{\n\t\"message\": \"Client João Alfredo registered\"\n}\n```\n### PUT /customers/:customerId\n#### body\n```\n{\n  \"name\": 'João Alfredo',\n  \"birthday\": '1994-04-28',\n  \"phone\": '31999999999'\n}\n```\n#### Response\n#### status 200\n```\n{\n\t\"message\": \"Client data updated\"\n}\n```\n## Games\n\n### GET /games\n```\n[\n  {\n    \"id\": 1,\n    \"name\": 'Banco Imobiliário',\n    \"image\": 'http://www.imagem.com.br/banco_imobiliario.jpg',\n    \"stockTotal\": 3,\n    \"categoryId\": 1,\n    \"pricePerDay\": 1500,\n    \"categories\": {\n      \"name\": \"strategy\"\n    }\n  },\n  {\n    \"id\": 2,\n    \"name\": 'Detetive',\n    \"image\": 'http://',\n    \"stockTotal\": 1,\n    \"categoryId\": 2,\n    \"pricePerDay\": 2500,\n    \"categories\": {\n      \"name\": \"criminal\"\n    }\n  },\n]\n```\n\n### POST /games\n#### body\n```\n{\n  \"name\": 'Banco Imobiliário',\n  \"image\": 'http://www.imagem.com.br/banco_imobiliario.jpg',\n  \"stockTotal\": 3,\n  \"pricePerDay\": 1500,\n  \"categoryId\": 1\n}\n```\n#### Response\n#### status 201\n```\n{\n\t\"message\": \"Game Banco Imobiliário saved\"\n}\n```\n## Rentals\n### GET /rentals\n```\n[\n  {\n    \"id\": 1,\n    \"rentDate\": '2021-06-20T00:00.000Z',\n    \"customerId\": 1,\n    \"gameId\": 1,\n    \"daysRented\": 3,\n    \"returnDate\": null, // Changes to the date the game is returned\n    \"originalPrice\": 4500,\n    \"delayFee\": 0, // Changes to pricePerDay*delayedDays in case the game is returned with delay\n    \"customers\": {\n      id: 1,\n      name: 'João Alfredo'\n    },\n    \"games\": {\n      \"id\": 1,\n\t\t  \"name\": 'Banco Imobiliário',\n\t\t  \"categories\": {\n        \"id\": 1,\n        \"name\": \"strategy\"\n      }\n    }\n  }\n]\n```\n### POST /rentals\n```\n{\n  customerId: 1,\n  gameId: 1,\n  daysRented: 3\n}\n```\n#### Response\n#### status 201\n```\n{\n  \"message\": \"Rental on 19/01/2025 registered\"\n}\n```\n### POST /rentals/:rentalId/return\n```\n{\n  \"message\": \"Rental of Banco Imobiliário returned at 21/01/2025\"\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsaytson%2Fboardcamp-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsaytson%2Fboardcamp-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsaytson%2Fboardcamp-node/lists"}