{"id":22300191,"url":"https://github.com/codeslator/firmavirtual-pokeapi","last_synced_at":"2025-03-25T23:21:52.662Z","repository":{"id":242387295,"uuid":"809376507","full_name":"codeslator/firmavirtual-pokeapi","owner":"codeslator","description":"FirmaVirtual Technical Test Pokemon API - Back-End - NestJS + TypeScript + Express","archived":false,"fork":false,"pushed_at":"2024-06-05T16:22:54.000Z","size":532,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"devel","last_synced_at":"2025-01-30T20:39:08.478Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeslator.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":"2024-06-02T14:18:07.000Z","updated_at":"2024-06-05T16:22:57.000Z","dependencies_parsed_at":"2025-01-30T20:30:40.328Z","dependency_job_id":"af92ff1e-f220-4478-b60c-e6b9057d87d3","html_url":"https://github.com/codeslator/firmavirtual-pokeapi","commit_stats":null,"previous_names":["codeslator/firmavirtual-pokeapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeslator%2Ffirmavirtual-pokeapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeslator%2Ffirmavirtual-pokeapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeslator%2Ffirmavirtual-pokeapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeslator%2Ffirmavirtual-pokeapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeslator","download_url":"https://codeload.github.com/codeslator/firmavirtual-pokeapi/tar.gz/refs/heads/devel","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245557679,"owners_count":20635024,"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-12-03T18:09:51.669Z","updated_at":"2025-03-25T23:21:52.635Z","avatar_url":"https://github.com/codeslator.png","language":"TypeScript","readme":"# FirmaVirtual PokeAPI\r\nTechnical Test by **FirmaVirtual Mexico** - @codeslator (Andres Melendez) - API built with **Node + TypeScript** using **NestJS Framework + TypeORM** and **PostgreSQL Database**.\r\n## Requirements\r\nTo run this app, you must have installed Node, NPM \u0026 Docker.\r\n\r\n## Installation\r\n\r\nThis README has the instructions to install and execute this API. The first step is clone the repository from GitHub.\r\n```bash\r\ngit clone https://github.com/codeslator/firmavirtual-pokeapi.git\r\n```\r\nAfter clone the repository, you must to install all dependencies.\r\n```bash\r\ncd firmavirtual-pokeapi\r\nnpm install\r\n```\r\n When dependencies was installed, you must run the database container, make sure you have the `.env` file in the repository with the following variables:\r\n ```\r\nPOSTGRES_DB=pokedb\r\nPOSTGRES_USER=codeslator\r\nPOSTGRES_PASSWORD=firmavirtualdb\r\n```\r\nThen, you can run the container with the following command:\r\n```docker\r\ndocker compose up -d\r\n```\r\n**NOTE**: If you don't have the database image downloaded, this command will download it automatically, this process can take some minutes. \r\nNow, you can connect with the FirmaVirtual database from any client as PgAdmin (not installed),  DBeaver, TablePlus, etc.\r\nTo connect, you should use this values:\r\n```\r\nName: firmavirtual-db\r\nHost: 127.0.0.1 or localhost\r\nPort: 5432\r\nUser: codeslator\r\nPassword: firmavirtualdb\r\nDatabase: pokedb\r\n```\r\n**Remember Test the connection before save.**\r\n\r\nAfter add environment variables and connect with database, we can execute the NestJS using the following command:\r\n```bash\r\nnpm run start:dev\r\n```\r\nAs we are using TypeORM, when API is starting it will connect with database and will map all entities created to create tables automatically.\r\nThe entities are **Pokemon**, **Abilities**, **Types** and **Stats**, relations are created automatically.\r\nIf application was started correctly, will be listen in **3000** port. Open in the browser or API client the following URL: `http://localhost:3000/`. Now the API is running. Great!\r\n\r\nTo see the API endpoints, you can open the **API Swagger** in the following URL:\r\n```\r\nhttp://localhost:3000/api/\r\n```\r\n**NOW**, you must seed all your database with Pokemon info got from PokeAPI. In your API Client or Browser call the followind endpoint:\r\n```\r\nhttp://localhost:3000/seed\r\n```\r\nPlease, wait until the database tables are seed correctly. You can follow the API logs to know if process is running correctly or an error happened.\r\n\r\n**NOTE**: Seed all database can take some minutes, please be patient because there are more than 1000 Pokemon Species that exists today. From **#0001 Bulbasaur** to **#1024 Pecharunt**. This is required to make some requests in the API.  When the process finishes, you can run the Front-End application that connects with this API.\r\n\r\nFinally, the API is running correctly and now you can connect any front-end app or make request to any declared endpoint. **Good job!**\r\n\r\n## Directory Structure\r\nThe API project has the following directory structure:\r\n```\r\n├── src\r\n│   ├── abilities\r\n│   │   ├── entities\r\n│   │   ├── abilities.controller.ts\r\n│   │   ├── abilities.module.ts\r\n│   │   └── abilities.service.ts\r\n│   ├── interfaces\r\n│   │   ├── functions.ts\r\n│   │   └── index.ts\r\n│   ├── pokemon\r\n│   │   ├── dto\r\n│   │   ├── entities\r\n│   │   ├── pokemon.controller.ts\r\n│   │   ├── pokemon.module.ts\r\n│   │   └── pokemon.service.ts\r\n│   ├── seed\r\n│   │   ├── seed.controller.ts\r\n│   │   ├── seed.module.ts\r\n│   │   └── seed.service.ts\r\n│   ├── stats\r\n│   │   ├── entities\r\n│   │   ├── stats.controller.ts\r\n│   │   ├── stats.module.ts\r\n│   │   └── stats.service.ts\r\n│   ├── types\r\n│   │   ├── entities\r\n│   │   ├── types.controller.ts\r\n│   │   ├── types.module.ts\r\n│   │   └── types.service.ts\r\n│   ├── app.module.ts\r\n│   ├── app.service.ts\r\n│   ├── main.ts\r\n├── .env\r\n├── ...\r\n├── docker-compose.yml\r\n├── package.json\r\n├── nest-cli.json\r\n├── tsconfig.build.json\r\n├── tsconfig.json\r\n└── README.md\r\n```\r\nThis was part of the developement of this Technical Test. **I hope you like it!** Thanks for this opportunity and sorry for delay.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeslator%2Ffirmavirtual-pokeapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeslator%2Ffirmavirtual-pokeapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeslator%2Ffirmavirtual-pokeapi/lists"}