{"id":15101476,"url":"https://github.com/mariocc29/pokemon_api","last_synced_at":"2025-06-29T16:37:43.016Z","repository":{"id":230906998,"uuid":"780364550","full_name":"mariocc29/pokemon_api","owner":"mariocc29","description":"Exemplary Ruby on Rail RestAPI aimed at assessing code quality with meticulous attention to detail.","archived":false,"fork":false,"pushed_at":"2024-04-04T21:26:41.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T10:43:48.132Z","etag":null,"topics":["backend","jbuilder","jwt","rails","rspec","rswag"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/mariocc29.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-04-01T10:15:43.000Z","updated_at":"2024-04-02T15:44:18.000Z","dependencies_parsed_at":"2024-04-04T22:43:36.278Z","dependency_job_id":null,"html_url":"https://github.com/mariocc29/pokemon_api","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"37592ea80bb055b64c339b0232fe1b6416ab2e6d"},"previous_names":["mariocc29/pokemon_api"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mariocc29/pokemon_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariocc29%2Fpokemon_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariocc29%2Fpokemon_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariocc29%2Fpokemon_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariocc29%2Fpokemon_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mariocc29","download_url":"https://codeload.github.com/mariocc29/pokemon_api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariocc29%2Fpokemon_api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262628067,"owners_count":23339723,"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":["backend","jbuilder","jwt","rails","rspec","rswag"],"created_at":"2024-09-25T18:23:50.989Z","updated_at":"2025-06-29T16:37:42.984Z","avatar_url":"https://github.com/mariocc29.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pokemon API\n**Petal Solutions Inc. Test Ruby backend**\n\n### Overview\n\nThe Pokemon API is a RESTful service that allows evaluating the quality of the code.\n\nThe purpose of this application is to connect an APIRestful and get a list of pokemons.\n\n## Requirements\n\n* The project is developed as a REST API.\n\n### Constraints\n\n1. To initialize the project, use the following command:\n\n```bash\n  rails new pokemon_api --api -d postgresql -T\n```\n\n## Technologies\n\nThe following technologies are used in this project:\n\n||Version|Command for checking\n|-|-:|-|\n|ruby|3.2.3|ruby --version|\n|rails|7.1.3.2|rails --version|\n\n## Deployment\n\nTo deploy the application, follow these steps:\n\n1. Install dependencies:\n\n```bash\n  bundle install\n```\n\n2. Start the server:\n\n```bash\n  bin/rails serve\n```\n\n## API Reference\n\nTo access the API documentation, perform the following steps:\n\n1. Run the command:\n\n```bash\n  rake rswag:specs:swaggerize\n```\n\n2. Once the documentation is retrieved, go to (Pokemon API v1 Docs)[localhost:3000/api/docs]\n\n## Running Tests\n\nExecute the following command to run the tests:\n\n```bash\n   bundle exec rspec spec/\n```\n\n## Solution Approach\n\nThe solution for building the Pokemons API involves the following steps:\n\n1. **Entity Serialization:** To ensure clean and structured responses from our API, we use JBuilder for entity serialization. This allows us to define the structure of our API responses in a clear and organized manner.\n\n2. **Documentation Generation:** We integrate Rswag to automatically generate Swagger-compliant documentation for our API. This ensures that our API endpoints are well-documented and easy to explore. Taking advantage of the gem, it allows us to create tests at the same time as we are creating the documentation.\n\n3. **Testing Strategy:** We employ RSpec and related gems for behavior-driven development (BDD) and testing. RSpec Rails provides a robust framework for testing Rails applications, while Rack Test allows us to test Rack applications with a simple API. Additionally, we use RSpec JSON Expectations for validating JSON responses in our tests.\n\n4. **Code Quality:** To maintain code quality and adherence to best practices, we utilize RuboCop, a linter for Ruby code. RuboCop helps us enforce consistent coding styles and identify potential issues in our codebase.\n\n## Installed Gems\n\nThe following gems are installed for the project:\n\n- `byebug`: Debugging tool for Ruby.\n- `dotenv-rails`: Loads environment variables from a .env file into ENV when the Rails app initializes.\n- `factory_bot_rails`: Provides support for defining and using factories in RSpec tests\n- `faker`: Generates fake data for testing purposes\n- `rspec-json_expectations`: Integrate 'rspec/json_expectations' gem for additional JSON-related expectations in RSpec.\n- `rspec-rails`: Behavior-driven development for Ruby on Rails applications\n- `rswag-api`: Adds Swagger API documentation to Rails APIs using RSpec.\n- `rswag-specs`: Provides tools to document APIs with RSpec-like syntax and generate Swagger JSON files.\n- `rswag-ui`: Provides a UI for interacting with and testing Rails APIs documented with Swagger.\n- `rubocop`: Linter for Ruby code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariocc29%2Fpokemon_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmariocc29%2Fpokemon_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariocc29%2Fpokemon_api/lists"}