{"id":22595153,"url":"https://github.com/constantiner/pokemonity","last_synced_at":"2025-10-23T16:52:58.136Z","repository":{"id":256743590,"uuid":"855865582","full_name":"Constantiner/pokemonity","owner":"Constantiner","description":"Full stack pokemon visualisation with microfrontends","archived":false,"fork":false,"pushed_at":"2024-09-13T10:18:10.000Z","size":945,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T19:14:08.544Z","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/Constantiner.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,"zenodo":null}},"created_at":"2024-09-11T15:27:06.000Z","updated_at":"2024-09-13T10:18:14.000Z","dependencies_parsed_at":"2024-09-12T21:56:28.363Z","dependency_job_id":"d52d4d4f-3cc8-4008-a7b3-2c1cd0e8ad7e","html_url":"https://github.com/Constantiner/pokemonity","commit_stats":null,"previous_names":["constantiner/pokemonity"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Constantiner/pokemonity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Constantiner%2Fpokemonity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Constantiner%2Fpokemonity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Constantiner%2Fpokemonity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Constantiner%2Fpokemonity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Constantiner","download_url":"https://codeload.github.com/Constantiner/pokemonity/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Constantiner%2Fpokemonity/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260058202,"owners_count":22952911,"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-08T10:09:10.298Z","updated_at":"2025-10-23T16:52:58.050Z","avatar_url":"https://github.com/Constantiner.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pokemonity\u003c!-- omit in toc --\u003e\n\n- [Finish your CI setup](#finish-your-ci-setup)\n- [Run tasks](#run-tasks)\n- [Add new projects](#add-new-projects)\n- [Install Nx Console](#install-nx-console)\n- [Useful links](#useful-links)\n- [Pokemon Data](#pokemon-data)\n- [Setting up Elasticsearch for the Project](#setting-up-elasticsearch-for-the-project)\n\t- [Step 1: Start Elasticsearch](#step-1-start-elasticsearch)\n\t- [Step 2: Reset Elasticsearch Password](#step-2-reset-elasticsearch-password)\n\t- [Step 3: Set Elasticsearch Password as an Environment Variable](#step-3-set-elasticsearch-password-as-an-environment-variable)\n\t- [Step 4: Populate Elasticsearch with Pokémon Data](#step-4-populate-elasticsearch-with-pokémon-data)\n\t\t- [1. Create and Populate the **Pokedex** Index](#1-create-and-populate-the-pokedex-index)\n\t\t- [2. Create and Populate the **Poketypes** Index](#2-create-and-populate-the-poketypes-index)\n\t\t- [3. Create and Populate the **Pokemoves** Index](#3-create-and-populate-the-pokemoves-index)\n\t\t- [4. Create and Populate the **Pokeitems** Index](#4-create-and-populate-the-pokeitems-index)\n\t- [Step 5: Confirm the Data](#step-5-confirm-the-data)\n\t- [Notes](#notes)\n- [Environment Setup](#environment-setup)\n\t- [Environment Variables](#environment-variables)\n\t- [Setting Up Environment Files](#setting-up-environment-files)\n\t\t- [Example `.env` File](#example-env-file)\n\t\t- [Development Environment](#development-environment)\n\t\t\t- [`apps/pokemonity/.env.development.local`](#appspokemonityenvdevelopmentlocal)\n\t\t- [Production Environment](#production-environment)\n\t- [Example `.env.example` Template](#example-envexample-template)\n\t\t\t- [`apps/pokemonity/.env.example`](#appspokemonityenvexample)\n- [Running the Nest Server](#running-the-nest-server)\n- [Adding Modules, Services, or Controllers to the Nest Application in Nx Monorepository](#adding-modules-services-or-controllers-to-the-nest-application-in-nx-monorepository)\n\t- [Adding a Controller to the Nest Application](#adding-a-controller-to-the-nest-application)\n\t- [Adding a Service to the Nest Application](#adding-a-service-to-the-nest-application)\n\t- [Adding a Module to the Nest Application](#adding-a-module-to-the-nest-application)\n- [API Documentation with Swagger](#api-documentation-with-swagger)\n\t- [Accessing Swagger UI](#accessing-swagger-ui)\n\t- [How to Use](#how-to-use)\n\t- [Instructions to Run the Application](#instructions-to-run-the-application)\n\n\u003ca alt=\"Nx logo\" href=\"https://nx.dev\" target=\"_blank\" rel=\"noreferrer\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png\" width=\"45\"\u003e\u003c/a\u003e\n\n✨ Your new, shiny [Nx workspace](https://nx.dev) is almost ready ✨.\n\n[Learn more about this workspace setup and its capabilities](https://nx.dev/nx-api/node?utm_source=nx_project\u0026amp;utm_medium=readme\u0026amp;utm_campaign=nx_projects) or run `npx nx graph` to visually explore what was created. Now, let's get you up to speed!\n\n## Finish your CI setup\n\n[Click here to finish setting up your workspace!](https://cloud.nx.app/connect/xkq5Mp0XQO)\n\n\n## Run tasks\n\nTo run the dev server for your app, use:\n\n```sh\nnpx nx serve pokemonity\n```\n\nTo create a production bundle:\n\n```sh\nnpx nx build pokemonity\n```\n\nTo see all available targets to run for a project, run:\n\n```sh\nnpx nx show project pokemonity\n```\n        \nThese targets are either [inferred automatically](https://nx.dev/concepts/inferred-tasks?utm_source=nx_project\u0026utm_medium=readme\u0026utm_campaign=nx_projects) or defined in the `project.json` or `package.json` files.\n\n[More about running tasks in the docs \u0026raquo;](https://nx.dev/features/run-tasks?utm_source=nx_project\u0026utm_medium=readme\u0026utm_campaign=nx_projects)\n\n## Add new projects\n\nWhile you could add new projects to your workspace manually, you might want to leverage [Nx plugins](https://nx.dev/concepts/nx-plugins?utm_source=nx_project\u0026utm_medium=readme\u0026utm_campaign=nx_projects) and their [code generation](https://nx.dev/features/generate-code?utm_source=nx_project\u0026utm_medium=readme\u0026utm_campaign=nx_projects) feature.\n\nUse the plugin's generator to create new projects.\n\nTo generate a new application, use:\n\n```sh\nnpx nx g @nx/node:app demo\n```\n\nTo generate a new library, use:\n\n```sh\nnpx nx g @nx/node:lib mylib\n```\n\nYou can use `npx nx list` to get a list of installed plugins. Then, run `npx nx list \u003cplugin-name\u003e` to learn about more specific capabilities of a particular plugin. Alternatively, [install Nx Console](https://nx.dev/getting-started/editor-setup?utm_source=nx_project\u0026utm_medium=readme\u0026utm_campaign=nx_projects) to browse plugins and generators in your IDE.\n\n[Learn more about Nx plugins \u0026raquo;](https://nx.dev/concepts/nx-plugins?utm_source=nx_project\u0026utm_medium=readme\u0026utm_campaign=nx_projects) | [Browse the plugin registry \u0026raquo;](https://nx.dev/plugin-registry?utm_source=nx_project\u0026utm_medium=readme\u0026utm_campaign=nx_projects)\n\n\n[Learn more about Nx on CI](https://nx.dev/ci/intro/ci-with-nx#ready-get-started-with-your-provider?utm_source=nx_project\u0026utm_medium=readme\u0026utm_campaign=nx_projects)\n\n## Install Nx Console\n\nNx Console is an editor extension that enriches your developer experience. It lets you run tasks, generate code, and improves code autocompletion in your IDE. It is available for VSCode and IntelliJ.\n\n[Install Nx Console \u0026raquo;](https://nx.dev/getting-started/editor-setup?utm_source=nx_project\u0026utm_medium=readme\u0026utm_campaign=nx_projects)\n\n## Useful links\n\nLearn more:\n\n- [Learn more about this workspace setup](https://nx.dev/nx-api/node?utm_source=nx_project\u0026amp;utm_medium=readme\u0026amp;utm_campaign=nx_projects)\n- [Learn about Nx on CI](https://nx.dev/ci/intro/ci-with-nx?utm_source=nx_project\u0026utm_medium=readme\u0026utm_campaign=nx_projects)\n- [Releasing Packages with Nx release](https://nx.dev/features/manage-releases?utm_source=nx_project\u0026utm_medium=readme\u0026utm_campaign=nx_projects)\n- [What are Nx plugins?](https://nx.dev/concepts/nx-plugins?utm_source=nx_project\u0026utm_medium=readme\u0026utm_campaign=nx_projects)\n\nAnd join the Nx community:\n- [Discord](https://go.nx.dev/community)\n- [Follow us on X](https://twitter.com/nxdevtools) or [LinkedIn](https://www.linkedin.com/company/nrwl)\n- [Our Youtube channel](https://www.youtube.com/@nxdevtools)\n- [Our blog](https://nx.dev/blog?utm_source=nx_project\u0026utm_medium=readme\u0026utm_campaign=nx_projects)\n\n## Pokemon Data\n\nUse pokemon JSON data from [pokemon-data.json](https://github.com/Purukitto/pokemon-data.json).\n\n## Setting up Elasticsearch for the Project\n\n### Step 1: Start Elasticsearch\n\nTo start an Elasticsearch container locally, use the `elastic-search:start` npm script. This command will start the Elasticsearch container using Docker Compose.\n\n```bash\nnpm run elastic-search:start\n```\n\nThis will start the Elasticsearch service on `localhost:9200`.\n\n### Step 2: Reset Elasticsearch Password\n\nYou need to set a password for the `elastic` user in Elasticsearch. Run the following command to reset the password:\n\n```bash\ndocker exec -it elasticsearch /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic\n```\n\nSave the generated password, as you will need it for further steps, including setting environment variables and for NestJS to connect to Elasticsearch.\n\n### Step 3: Set Elasticsearch Password as an Environment Variable\n\nBefore populating Elasticsearch with data, export the `ELASTIC_PASSWORD` environment variable in your terminal using the password from the previous step.\n\n```bash\nexport ELASTIC_PASSWORD=\"your_password\"\n```\n\n### Step 4: Populate Elasticsearch with Pokémon Data\n\nTo populate Elasticsearch with Pokémon data, you need to create the required indexes and use the `_bulk` API to import the data.\n\n#### 1. Create and Populate the **Pokedex** Index\n\nCreate the `pokedex` index:\n\n```bash\ncurl -X PUT -u elastic:$ELASTIC_PASSWORD \"localhost:9200/pokedex\"\n```\n\nThen, bulk import the data into the `pokedex` index:\n\n```bash\ncurl -H \"Content-Type: application/json\" -X POST -u elastic:$ELASTIC_PASSWORD \"localhost:9200/pokedex/_bulk?pretty\" --data-binary \"@pokedex_bulk.json\"\n```\n\n#### 2. Create and Populate the **Poketypes** Index\n\nCreate the `poketypes` index:\n\n```bash\ncurl -X PUT -u elastic:$ELASTIC_PASSWORD \"localhost:9200/poketypes\"\n```\n\nThen, bulk import the data into the `poketypes` index:\n\n```bash\ncurl -H \"Content-Type: application/json\" -X POST -u elastic:$ELASTIC_PASSWORD \"localhost:9200/poketypes/_bulk?pretty\" --data-binary \"@poketypes_bulk.json\"\n```\n\n#### 3. Create and Populate the **Pokemoves** Index\n\nCreate the `pokemoves` index:\n\n```bash\ncurl -X PUT -u elastic:$ELASTIC_PASSWORD \"localhost:9200/pokemoves\"\n```\n\nThen, bulk import the data into the `pokemoves` index:\n\n```bash\ncurl -H \"Content-Type: application/json\" -X POST -u elastic:$ELASTIC_PASSWORD \"localhost:9200/pokemoves/_bulk?pretty\" --data-binary \"@pokemoves_bulk.json\"\n```\n\n#### 4. Create and Populate the **Pokeitems** Index\n\nCreate the `pokeitems` index:\n\n```bash\ncurl -X PUT -u elastic:$ELASTIC_PASSWORD \"localhost:9200/pokeitems\"\n```\n\nThen, bulk import the data into the `pokeitems` index:\n\n```bash\ncurl -H \"Content-Type: application/json\" -X POST -u elastic:$ELASTIC_PASSWORD \"localhost:9200/pokeitems/_bulk?pretty\" --data-binary \"@pokeitems_bulk.json\"\n```\n\n### Step 5: Confirm the Data\n\nAfter populating the data, you can verify that the data was inserted correctly by querying Elasticsearch. For example, to search all data from the `pokedex` index:\n\n```bash\ncurl -X GET -u elastic:$ELASTIC_PASSWORD \"localhost:9200/pokedex/_search?pretty\"\n```\n\n---\n\n### Notes\n\n- Replace `your_password` with the actual password you set for the `elastic` user.\n- Make sure that the corresponding bulk data files (`pokedex_bulk.json`, `poketypes_bulk.json`, `pokemoves_bulk.json`, `pokeitems_bulk.json`) are in the correct directory.\n\n## Environment Setup\n\nTo configure your project, you need to set up environment variables. These variables control how the application interacts with services like Elasticsearch and define the application's port for running the server.\n\n### Environment Variables\n\nThe following environment variables must be configured for the application to work properly:\n\n| Variable Name              | Description                             | Example Value             |\n| -------------------------- | --------------------------------------- | ------------------------- |\n| `ELASTICSEARCH_HOST`        | Elasticsearch host                      | `localhost`               |\n| `ELASTICSEARCH_PORT`        | Elasticsearch port                      | `9200`                    |\n| `ELASTICSEARCH_USERNAME`    | Username for Elasticsearch              | `elastic`                 |\n| `ELASTICSEARCH_PASSWORD`    | Password for Elasticsearch              | `your_elastic_password`   |\n| `PORT`                      | Port on which the NestJS app will run   | `3000`                    |\n\n### Setting Up Environment Files\n\nYou can use different `.env` files to manage your environment variables depending on the environment (e.g., development, production). The environment file should contain the above variables, and you can define them based on your environment.\n\n#### Example `.env` File\n\nFor a typical setup, you would have a `.env` file that looks like this:\n\n```ini\n# Elasticsearch configuration\nELASTICSEARCH_HOST=localhost\nELASTICSEARCH_PORT=9200\nELASTICSEARCH_USERNAME=elastic\nELASTICSEARCH_PASSWORD=your_elastic_password\n\n# Application configuration\nPORT=3000\n```\n\n#### Development Environment\n\nFor local development, create a file called `.env.development.local` in the `apps/pokemonity` directory. You can use the following structure as a template:\n\n##### `apps/pokemonity/.env.development.local`\n\n```ini\n# Elasticsearch configuration\nELASTICSEARCH_HOST=localhost\nELASTICSEARCH_PORT=9200\nELASTICSEARCH_USERNAME=elastic\nELASTICSEARCH_PASSWORD=your_elastic_password\n\n# Application configuration\nPORT=3000\n```\n\nThis file will override the values in your `.env` file during development.\n\n#### Production Environment\n\nFor production, create a file called `.env.production` and update the variables accordingly.\n\n### Example `.env.example` Template\n\nFor convenience, you can create a `.env.example` file as a template that other developers can use to set up their own environment:\n\n##### `apps/pokemonity/.env.example`\n\n```ini\n# Elasticsearch configuration\nELASTICSEARCH_HOST=localhost\nELASTICSEARCH_PORT=9200\nELASTICSEARCH_USERNAME=elastic\nELASTICSEARCH_PASSWORD=your_elastic_password\n\n# Application configuration\nPORT=3000\n```\n\nThis file serves as a reference for what variables are required but does not contain any sensitive information.\n\n## Running the Nest Server\n\nTo start the NestJS server for the Pokémon app, run the following command:\n\n```bash\nnpm run serve:pokemonity\n```\n\nOnce the server is up and running, you can go to the following URL to check the Pokémon search API:\n\n```bash\nhttp://localhost:3000/api/pokedex/search?name=Pikachu\n```\n\nThis will query Elasticsearch for the Pokémon with the name \"Pikachu\" and return its data.\n\n## Adding Modules, Services, or Controllers to the Nest Application in Nx Monorepository\n\nIn an Nx monorepository, we use `@nx/nest` generators to scaffold new modules, services, or controllers in our NestJS application. For this project, we will be adding these components to the **Nest application** called `pokemonity`.\n\n### Adding a Controller to the Nest Application\n\nTo generate a new controller in the Nest application, use the following command:\n\n```bash\nnpx nx g @nx/nest:controller pokedex --project=pokemonity\n```\n\nThis will generate a new controller under the `pokedex` feature in the **`pokemonity`** Nest application.\n\n### Adding a Service to the Nest Application\n\nTo generate a new service in the Nest application, use this command:\n\n```bash\nnpx nx g @nx/nest:service pokedex --project=pokemonity\n```\n\nThis will generate a new service for the `pokedex` feature in the **`pokemonity`** Nest application.\n\n### Adding a Module to the Nest Application\n\nTo generate a new module in the Nest application, use the following command:\n\n```bash\nnpx nx g @nx/nest:module pokedex --project=pokemonity\n```\n\nThis will create a new module for the `pokedex` feature in the **`pokemonity`** Nest application.\n\nFor more information on using the Nest generators in Nx, visit the official documentation:\n\n[More info on Nx Nest generators](https://nx.dev/nx-api/nest)\n\n## API Documentation with Swagger\n\nThis project includes interactive API documentation powered by **Swagger**. Swagger allows you to explore and test the available API endpoints directly from your browser.\n\n### Accessing Swagger UI\n\nOnce the server is running, you can access the Swagger UI at:\n\n```bash\nhttp://localhost:3000/api/swagger\n```\n\n### How to Use\n\n- **Explore Endpoints**: The Swagger UI provides a list of all available API endpoints, organized by tags (such as `pokedex`).\n- **Test Endpoints**: You can use the Swagger UI to send test requests directly to the server and see live responses.\n- **API Documentation**: Each endpoint includes detailed information, such as the request parameters, response structure, and status codes.\n\nSwagger is set up to reflect the current API routes, including the global `api` prefix.\n\n---\n\n### Instructions to Run the Application\n\nMake sure you have followed the instructions to set up the NestJS application and have the server running. Once the server is up, visit the Swagger documentation at the above link.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconstantiner%2Fpokemonity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconstantiner%2Fpokemonity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconstantiner%2Fpokemonity/lists"}