{"id":21195118,"url":"https://github.com/diglopes/multi-db-api-ts","last_synced_at":"2025-03-14T21:36:20.266Z","repository":{"id":42250860,"uuid":"282440242","full_name":"diglopes/multi-db-api-ts","owner":"diglopes","description":"A multi database application using Typescript","archived":false,"fork":false,"pushed_at":"2023-01-07T20:30:58.000Z","size":908,"stargazers_count":1,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T14:14:22.890Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diglopes.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}},"created_at":"2020-07-25T12:32:50.000Z","updated_at":"2020-07-27T10:17:48.000Z","dependencies_parsed_at":"2023-02-08T01:01:15.896Z","dependency_job_id":null,"html_url":"https://github.com/diglopes/multi-db-api-ts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diglopes%2Fmulti-db-api-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diglopes%2Fmulti-db-api-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diglopes%2Fmulti-db-api-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diglopes%2Fmulti-db-api-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diglopes","download_url":"https://codeload.github.com/diglopes/multi-db-api-ts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243651600,"owners_count":20325521,"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":[],"created_at":"2024-11-20T19:26:10.203Z","updated_at":"2025-03-14T21:36:20.228Z","avatar_url":"https://github.com/diglopes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi Database API Typescript\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://media.giphy.com/media/UOvFfXGINpmN2/giphy.gif\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003eAn application with multiple databases that you can make CRUD operations to save, read, update, and delete your Digimons and battle with it!\u003c/p\u003e\n\n## Goal\n\nThe main purpose of building this app is to improve my Typescript knowledge, and use Node.js best practices on building APIs.\n\n## Techs Used\n\n- MongoDB\n- Postgres\n- Redis\n- Node.js\n\n## Roadmap\n\n- [X] Configure commit linter to conventional commit convention\n- [X] Configure code linter to Standard convention\n- [X] Configure Typescript to production and development\n- [ ] Configure the project for tests\n- [ ] Configure environment with Docker and Docker-compose\n  - [ ] Production\n  - [ ] Development\n- [ ] Connection with Postgres and MongoDB using strategy pattern\n- [ ] API Resources\n  - [ ] Digimons\n    - [ ] **GET** /digimons\n    - [ ] **GET** /digimons/{id}\n    - [ ] **POST** /digimons\n    - [ ] **PUT** /digimons/{id}\n    - [ ] **DELETE** /digimons/{id}\n  - [ ] Battles\n    - [ ] **GET** /battles\n    - [ ] **GET** /battles/{id}\n    - [ ] **POST** /battles\n- [ ] Swagger documentation\n- [ ] 100% test coverage\n\n## Data models\n\nDigimon\n```json\n{\n    \"id\": \"STRING\",\n    \"name\": \"STRING\",\n    \"health\": \"NUMBER\",\n    \"isTired\": \"BOOLEAN\",\n    \"lossStreak\": \"NUMBER\",\n    \"isDeleted\": \"BOOLEAN\", \n    \"abilities\": [\n        {\n            \"name\": \"STRING\",\n            \"minDamage\": \"NUMBER\",\n            \"maxDamage\": \"NUMBER\",\n            \"loadTime\": \"NUMBER\"\n        }\n    ],\n    \"createdAt\": \"STRING\",\n    \"updatedAt\": \"STRING\"\n}\n```\n\nBattle\n```json\n{\n    \"id\": \"STRING\",\n    \"winner\": {\n        \"id\": \"DIGIMON_ID\",\n        \"healthLeft\": \"NUMBER\",\n        \"abilitiesUsed\": [\n            {\n                \"name\": \"STRING\",\n                \"damage\": \"NUMBER\"\n            }\n        ]\n    },\n    \"loser\": {\n        \"id\": \"DIGIMON_ID\",\n        \"abilitiesUsed\": [\n            {\n                \"name\": \"STRING\",\n                \"damage\": \"NUMBER\"\n            }\n        ]\n    },\n    \"createdAt\": \"STRING\"\n}\n```\n\n## Bussiness rules\n\n### Databases usage\n\n- Digimons should be saved on MongoDB\n- Battles should be saved on Postgres\n\n### Digimon battles\n\n- The battle is based on turns, and on each turn the ability is choosed randomly\n- The Digimon which has the lowest abilities `loadTime` go first until its health goes\n- When a Digimon loses a battle it gets tired for (1 * `lossStreak`) minutes and can't battle at this time around\n- Digimon has to be recovered after tired time has passed\n- When a Digimon win a battle its `lossStreak` property should go back to zero\n- A battle shouldn't happen if one of the Digimons is tired\n- A battle is formed by two Digimons only\n\n### Regeneration JOB\n\n- Watch for Digimons that need get the `isTired` property returned to zero after rest time","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiglopes%2Fmulti-db-api-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiglopes%2Fmulti-db-api-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiglopes%2Fmulti-db-api-ts/lists"}