{"id":21663704,"url":"https://github.com/evgenywas/rss-node-crud-api","last_synced_at":"2025-03-20T06:17:18.554Z","repository":{"id":259838175,"uuid":"872547579","full_name":"EvgenyWas/rss-node-crud-api","owner":"EvgenyWas","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-28T08:04:41.000Z","size":74,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-03-17T20:56:56.627Z","etag":null,"topics":["crud-api","nodejs"],"latest_commit_sha":null,"homepage":"","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/EvgenyWas.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-10-14T16:16:11.000Z","updated_at":"2024-10-29T19:51:47.000Z","dependencies_parsed_at":"2024-10-28T09:30:46.058Z","dependency_job_id":"65a1d528-bdb3-4c90-9f59-fc75c556b0f9","html_url":"https://github.com/EvgenyWas/rss-node-crud-api","commit_stats":null,"previous_names":["evgenywas/rss-node-crud-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvgenyWas%2Frss-node-crud-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvgenyWas%2Frss-node-crud-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvgenyWas%2Frss-node-crud-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvgenyWas%2Frss-node-crud-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvgenyWas","download_url":"https://codeload.github.com/EvgenyWas/rss-node-crud-api/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244560392,"owners_count":20472220,"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":["crud-api","nodejs"],"created_at":"2024-11-25T10:28:02.721Z","updated_at":"2025-03-20T06:17:18.535Z","avatar_url":"https://github.com/EvgenyWas.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple CRUD API\n\n## Description\nThis is a lightweight CRUD (Create, Read, Update, Delete) API that utilizes an in-memory database for rapid data access, making it ideal for development and testing environments. **Note**: Since data is stored in memory, it will be lost when the server restarts.\n\n## Installation\n\n1. **Fork the Repository**  \n   Start by forking this repository to your GitHub account.\n\n2. **Clone the Repository**  \n   Clone the forked repository to your local machine:\n   ```bash\n   git clone \u003cyour-repository-url\u003e\n   cd \u003crepository-name\u003e\n   ```\n\n3. **Install Dependencies**  \n   To install the required dependencies, run:\n   ```bash\n   npm install\n   ```\n\n4. **Environment Setup**  \n   Create a `.env` file in the project root with the following content:\n   ```\n   PORT={PORT_NUMBER}\n   ```\n   Replace `{PORT_NUMBER}` with the desired port number (e.g., `4000`).\n\n## Usage Guide\n\nThe API can be started in different modes to suit various environments:\n\n1. **Development Mode**  \n   Start a single process in development mode:\n   ```bash\n   npm run start:dev\n   ```\n\n2. **Production Mode**  \n   Start a single process in production mode:\n   ```bash\n   npm run start:prod\n   ```\n\n3. **Horizontal Scaling**  \n   To enable horizontal scaling, use the `start:multi` command. This starts multiple instances of the application using the Node.js Cluster API, with each instance listening on `PORT + n`, where `n` is the instance number. The application uses a round-robin load balancer to distribute requests evenly across instances.  \n     ```bash\n     npm run start:multi\n     ```\n\n4. **Run Tests**  \n   To execute the test suite and verify application functionality, use:\n   ```bash\n   npm run test\n   ```\n\n## API Endpoints\n\n1. **Get All Users**  \n   `GET /api/users`  \n   Retrieves an array of all users.\n\n2. **Get User by ID**  \n   `GET /api/users/{userId}`  \n   Fetches details of a specific user if they exist.\n\n3. **Create a User**  \n   `POST /api/users`  \n   Adds a new user to the in-memory database.\n\n4. **Update a User**  \n   `PUT /api/users/{userId}`  \n   Updates details of an existing user.\n\n5. **Delete a User**  \n   `DELETE /api/users/{userId}`  \n   Removes a user from the in-memory database.\n\n### Data Model\n\nEach user object in the database has the following structure:\n```json\n[\n  {\n    \"id\": \"string\",         // Unique identifier (UUID) generated by the server\n    \"username\": \"string\",   // User's name (required)\n    \"age\": \"number\",        // User's age (required)\n    \"hobbies\": [\"string\"]   // User's hobbies, as an array of strings (required)\n  },\n  ...\n]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevgenywas%2Frss-node-crud-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevgenywas%2Frss-node-crud-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevgenywas%2Frss-node-crud-api/lists"}