{"id":24291605,"url":"https://github.com/nebeyoumusie/pokemon-api-app","last_synced_at":"2026-06-06T15:32:04.229Z","repository":{"id":271514276,"uuid":"913701989","full_name":"NebeyouMusie/Pokemon-API-App","owner":"NebeyouMusie","description":"A simple Pokemon API built using ASP.NET Core with MongoDB Atlas integration. This API allows users to perform CRUD operations on a Pokemon collection.","archived":false,"fork":false,"pushed_at":"2025-01-08T08:30:12.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-16T14:44:21.349Z","etag":null,"topics":["csharp","dotnet","mongodb-atlas"],"latest_commit_sha":null,"homepage":"","language":"C#","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/NebeyouMusie.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":"2025-01-08T07:34:54.000Z","updated_at":"2025-01-08T08:48:10.000Z","dependencies_parsed_at":"2025-01-08T08:34:53.103Z","dependency_job_id":"fe1402dc-6759-47e2-962e-145faeffc635","html_url":"https://github.com/NebeyouMusie/Pokemon-API-App","commit_stats":null,"previous_names":["nebeyoumusie/pokemon-api-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NebeyouMusie%2FPokemon-API-App","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NebeyouMusie%2FPokemon-API-App/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NebeyouMusie%2FPokemon-API-App/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NebeyouMusie%2FPokemon-API-App/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NebeyouMusie","download_url":"https://codeload.github.com/NebeyouMusie/Pokemon-API-App/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242144499,"owners_count":20078966,"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":["csharp","dotnet","mongodb-atlas"],"created_at":"2025-01-16T14:44:10.580Z","updated_at":"2025-03-06T03:50:10.792Z","avatar_url":"https://github.com/NebeyouMusie.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pokemon API\n\nA simple Pokemon API built using ASP.NET Core with MongoDB Atlas integration. This API allows users to perform CRUD operations on a Pokemon collection.\n\n---\n\n## Prerequisites\n\n- .NET 6 SDK installed\n- MongoDB Atlas account and cluster setup\n- A tool like Postman or Thunder Client for API testing\n\n---\n\n## Setup Instructions\n\n### 1. Clone the Repository\n\n```bash\n# Clone the repository\ngit clone \u003crepository-url\u003e\n\n# Navigate to the project folder\ncd PokemonApi\n```\n\n### 2. Create a `.env` File\n\nCreate a `.env` file in the root directory with the following content:\n\n```env\nMONGODB_CONNECTION_STRING=mongodb+srv://\u003cusername\u003e:\u003cpassword\u003e@\u003ccluster-address\u003e/?retryWrites=true\u0026w=majority\n```\n\n- Replace `\u003cusername\u003e` and `\u003cpassword\u003e` with your MongoDB Atlas credentials.\n- Replace `\u003ccluster-address\u003e` with your MongoDB cluster address.\n\n### 3. Update `appsettings.json`\n\nEnsure the `appsettings.json` includes:\n\n```json\n{\n  \"DatabaseSettings\": {\n    \"DatabaseName\": \"PokemonApi\",\n    \"PokemonCollectionName\": \"Pokemon\"\n  }\n}\n```\n\n### 4. Restore and Build\n\n```bash\n# Restore dependencies\ndotnet restore\n\n# Build the project\ndotnet build\n```\n\n### 5. Run the Application\n\n```bash\n# Run the app\ndotnet run\n```\n\nThe app will start and be available at `http://localhost:5000` (or another port as specified).\n\n---\n\n## API Endpoints and Usage\n\n### Base URL\n\n```\nhttp://localhost:5048/api/Pokemon\n```\n\n### Example Usages\n\n#### 1. Add a New Pokemon\n\nStart by creating the following Pokemon, as the database is empty when the app initializes:\n\n- **Endpoint**: `POST /api/Pokemon`\n- **Headers**: `Content-Type: application/json`\n- **Body**:\n\n```json\n{\n  \"id\": 1,\n  \"name\": \"Pikachu\",\n  \"type\": \"Electric\",\n  \"ability\": \"Static\",\n  \"level\": 5\n}\n```\n\n- **Response**:\n\n```json\n{\n  \"id\": 1,\n  \"name\": \"Pikachu\",\n  \"type\": \"Electric\",\n  \"ability\": \"Static\",\n  \"level\": 5\n}\n```\n\n#### 2. Add Another Pokemon\n\n- **Endpoint**: `POST /api/Pokemon`\n- **Headers**: `Content-Type: application/json`\n- **Body**:\n\n```json\n{\n  \"id\": 2,\n  \"name\": \"Charmander\",\n  \"type\": \"Fire\",\n  \"ability\": \"Blaze\",\n  \"level\": 10\n}\n```\n\n- **Response**:\n\n```json\n{\n  \"id\": 2,\n  \"name\": \"Charmander\",\n  \"type\": \"Fire\",\n  \"ability\": \"Blaze\",\n  \"level\": 10\n}\n```\n\n#### 3. Get All Pokemon\n\n- **Endpoint**: `GET /api/Pokemon`\n- **Response**:\n\n```json\n[\n  {\n    \"id\": 1,\n    \"name\": \"Pikachu\",\n    \"type\": \"Electric\",\n    \"ability\": \"Static\",\n    \"level\": 5\n  },\n  {\n    \"id\": 2,\n    \"name\": \"Charmander\",\n    \"type\": \"Fire\",\n    \"ability\": \"Blaze\",\n    \"level\": 10\n  }\n]\n```\n\n#### 4. Get Pokemon by ID\n\n- **Endpoint**: `GET /api/Pokemon/{id}`\n- **Example**: `GET /api/Pokemon/1`\n- **Response**:\n\n```json\n{\n  \"id\": 1,\n  \"name\": \"Pikachu\",\n  \"type\": \"Electric\",\n  \"ability\": \"Static\",\n  \"level\": 5\n}\n```\n\n#### 5. Update an Existing Pokemon\n\n- **Endpoint**: `PUT /api/Pokemon`\n- **Headers**: `Content-Type: application/json`\n- **Body**:\n\n```json\n{\n  \"id\": 2,\n  \"name\": \"Charmander\",\n  \"type\": \"Fire\",\n  \"ability\": \"Solar Power\",\n  \"level\": 12\n}\n```\n\n- **Response**: `204 No Content`\n\n#### 6. Delete a Pokemon\n\n- **Endpoint**: `DELETE /api/Pokemon/{id}`\n- **Example**: `DELETE /api/Pokemon/2`\n- **Response**: `204 No Content`\n\n---\n\n## Notes\n\n- Ensure the MongoDB Atlas cluster is set up and accessible.\n- The `DatabaseName` and `PokemonCollectionName` in `appsettings.json` should match your MongoDB configuration.\n- Use the `.env` file to keep your MongoDB credentials secure.\n\n---\n\n## Troubleshooting\n\n### Common Issues\n\n1. **`MongoDB Connection Failed`**:\n\n   - Verify the connection string in the `.env` file.\n   - Ensure IP Whitelist and credentials in MongoDB Atlas are correctly configured.\n\n2. **Port Already in Use**:\n\n   - Use a different port by modifying the launch settings or passing a parameter to `dotnet run`.\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebeyoumusie%2Fpokemon-api-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnebeyoumusie%2Fpokemon-api-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebeyoumusie%2Fpokemon-api-app/lists"}