{"id":18743877,"url":"https://github.com/devmarkson/hng-stage2","last_synced_at":"2025-11-21T23:30:14.867Z","repository":{"id":194205662,"uuid":"690316946","full_name":"DevMarkson/HNG-Stage2","owner":"DevMarkson","description":"This is a simple REST API for performing CRUD (Create, Read, Update, Delete) operations on a \"person\" resource. It allows you to add, retrieve, update, and delete person records","archived":false,"fork":false,"pushed_at":"2023-09-12T03:39:14.000Z","size":150,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-28T19:46:44.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hng-stage2-0d2o.onrender.com/api-docs","language":"JavaScript","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/DevMarkson.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}},"created_at":"2023-09-12T00:57:25.000Z","updated_at":"2023-09-12T03:40:39.000Z","dependencies_parsed_at":"2023-09-12T09:44:33.821Z","dependency_job_id":"68b5e57c-3d3e-4a9f-ba57-aa68ad993bd8","html_url":"https://github.com/DevMarkson/HNG-Stage2","commit_stats":null,"previous_names":["markson17/hng-stage2","devmarkson/hng-stage2"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevMarkson%2FHNG-Stage2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevMarkson%2FHNG-Stage2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevMarkson%2FHNG-Stage2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevMarkson%2FHNG-Stage2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevMarkson","download_url":"https://codeload.github.com/DevMarkson/HNG-Stage2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239627300,"owners_count":19670844,"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-07T16:12:51.221Z","updated_at":"2025-11-21T23:30:14.816Z","avatar_url":"https://github.com/DevMarkson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CRUD API for Managing Persons(HNG-Stage2-Task)\n\nThis is a simple REST API for performing CRUD (Create, Read, Update, Delete) operations on a \"person\" resource. It allows you to add, retrieve, update, and delete person records.\n\n## Table of Contents\n\n- [Swagger Documentation](#swagger-documentation)\n- [Prerequisites](#prerequisites)\n- [Getting Started](#getting-started)\n  - [Installation](#installation)\n  - [Configuration](#configuration)\n- [Usage](#usage)\n  - [API Endpoints](#api-endpoints)\n- [Testing](#testing)\n- [UML Diagram](#uml-diagram)\n- [Deployment](#deployment)\n\n## Swagger Documentation\n\nYou can access the Swagger documentation for this API at `https://hng-stage2-0d2o.onrender.com/api-docs/`. The Swagger UI provides detailed information about the API endpoints, request schemas, and example requests and responses.\n![Swagger Documentation of CRUD API](swagger-docs.png)\n\n## Prerequisites\n\nBefore you begin, ensure you have met the following requirements:\n\n- Node.js and npm installed on your machine.\n- MongoDB installed and running locally or access to a MongoDB instance.\n- Git (optional, for cloning the repository).\n\n## Getting Started\n\n### Installation\n\n1. Clone the repository (or download the ZIP file):\n\n   ```bash\n   git clone https://github.com/Markson17/HNG-Stage2.git\n   ```\n\n2. Navigate to the project directory:\n\n   ```bash\n   cd HNG-Stage2\n   ```\n\n3. Install the dependencies:\n\n   ```bash\n   npm install\n   ```\n\n### Configuration\n\n1. Create a `config` folder in the project root directory.\n\n2. Inside the `config` folder, create a `config.env` file with the following configuration:\n\n   ```plaintext\n   PORT=3000\n   MONGO_URI=your-mongodb-connection-string\n\n\n## Usage\n\n### API Endpoints\n\n- **Create a new person:**\n\n  ```http\n  POST /api\n\n  Request Body:\n  {\n    \"name\": \"Favour Markson\"\n  }\n  ```\n\n- **Retrieve details of a person:**\n\n  ```http\n  GET /api/:id\n  ```\n\n- **Update details of an existing person:**\n\n  ```http\n  PATCH /api/:id\n\n  Request Body:\n  {\n    \"name\": \"Updated Name\"\n  }\n  ```\n\n- **Remove a person:**\n\n  ```http\n  DELETE /api/:id\n  ```\n\n## Testing\n\nTo test the API endpoints, you can use tools like Postman or write automated tests using testing libraries like Mocha and Chai. Ensure that you have the necessary testing environment set up.\n\n1. Start the API server:\n\n   ```bash\n   npm start\n   ```\n\n2. Use your chosen testing tool to send requests to the API endpoints.\n\n## UML Diagram\n\nHere is the UML (Unified Modeling Language) diagram representing the structure and relationships of this API's classes and models:\n\n![UML Diagram](CRUD.jpg)\n\n\n## Deployment\n\nI deployed this project to Render. You can view the live API at [https://hng-stage2-0d2o.onrender.com/api](https://hng-stage2-0d2o.onrender.com/api-docs).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevmarkson%2Fhng-stage2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevmarkson%2Fhng-stage2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevmarkson%2Fhng-stage2/lists"}