{"id":15068218,"url":"https://github.com/mahirsust/nodejs-crud-app-backend","last_synced_at":"2026-02-15T23:31:51.952Z","repository":{"id":255451960,"uuid":"850379203","full_name":"mahirsust/nodejs-crud-app-backend","owner":"mahirsust","description":"A simple CRUD using Express JS as backend and MongoDB as database","archived":false,"fork":false,"pushed_at":"2024-09-21T13:10:55.000Z","size":86,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T20:27:40.008Z","etag":null,"topics":["crud-app","express-js","mongodb","nodejs","rest-api"],"latest_commit_sha":null,"homepage":"","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/mahirsust.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-08-31T15:55:32.000Z","updated_at":"2024-09-21T13:10:59.000Z","dependencies_parsed_at":"2024-09-25T01:32:37.041Z","dependency_job_id":"4627e9f5-d201-4de2-a929-c5e32c6809f2","html_url":"https://github.com/mahirsust/nodejs-crud-app-backend","commit_stats":null,"previous_names":["mahirsust/nodejs-crud-app-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mahirsust/nodejs-crud-app-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahirsust%2Fnodejs-crud-app-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahirsust%2Fnodejs-crud-app-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahirsust%2Fnodejs-crud-app-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahirsust%2Fnodejs-crud-app-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mahirsust","download_url":"https://codeload.github.com/mahirsust/nodejs-crud-app-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahirsust%2Fnodejs-crud-app-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29492518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T19:29:10.908Z","status":"ssl_error","status_checked_at":"2026-02-15T19:29:10.419Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-app","express-js","mongodb","nodejs","rest-api"],"created_at":"2024-09-25T01:32:30.906Z","updated_at":"2026-02-15T23:31:51.937Z","avatar_url":"https://github.com/mahirsust.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js CRUD App Backend\n\nA simple CRUD (Create, Read, Update, Delete) API built using **Node.js** with **Express.js** and **MongoDB** as the database.\n\n# Table of Contents\n\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Getting Started](#getting-started)\n  - [1. Clone the Repository](#1-clone-the-repository)\n  - [2. Install Dependencies](#2-install-dependencies)\n  - [3. Environment Configuration](#3-environment-configuration)\n  - [4. Running the App](#4-running-the-app)\n  - [5. Access the API](#5-access-the-api)\n- [API Documentation](#api-documentation)\n- [Folder Structure](#folder-structure)\n- [Technologies Used](#technologies-used)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n\n- RESTful API for managing a resource (e.g. products)\n- Supports CRUD operations:\n  - **Create** a new entry\n  - **Read** entries (single or all)\n  - **Update** an existing entry\n  - **Delete** an entry\n- Uses **MongoDB** for data storage\n- **Express.js** for routing and handling HTTP requests\n- Environment configuration using **.env** file\n- Swagger documentation for API routes\n\n## Prerequisites\n\nMake sure you have the following installed on your machine:\n\n- **Node.js** (version 14 or higher)\n- **npm** (Node package manager)\n- **MongoDB** (Local or remote instance)\n\n## Getting Started\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/mahirsust/nodejs-crud-app-backend.git\ncd nodejs-crud-app-backend\n```\n\n### 2. Install Dependencies\n\n```bash\nnpm install\n```\n\n### 3. Environment Configuration\n\nCreate a **.env** file in the root directory of the project. Refer to **.env.example** for the required variables:\n\n```bash\n# Environment variables.\n\n# Environment Status\nNODE_ENV=your_node_env\n# Development port\nDEV_PORT=3000\n# Production port\nPROD_PORT=8080\n\n# DB CONFIG\nDB_USERNAME=your_mongodb_username\nDB_PASSWORD=your_mongodb_password\nDB_NAME=your_mongodb_database_name\nDB_CLUSTER_NAME=your_mongodb_cluster_name\n```\n#### Setting `NODE_ENV`:\n- Use `NODE_ENV=development` for running the app in **development** mode.\n- Use `NODE_ENV=production` for running the app in **production** mode.\n\nReplace the placeholders with your actual MongoDB credentials and app configurations.\n\n### 4. Running the App\n\n#### In Development Mode\n\n```bash\nnpm run dev\n```\n\nThe application will run on the port defined in **DEV_PORT**.\n\n#### In Production Mode\n\n```bash\nnpm start\n```\n\nThe application will run on the port defined in **PROD_PORT**.\n\n### 5. Access the API\n\nThe base URL for accessing the API is:\n\n```bash\nhttp://localhost:[PORT]/\n```\n\n**[PORT]** is the port number your server is running on (e.g., 3000 or 8080).\n\nYou can interact with the API using tools like [Postman](https://www.postman.com/) or [curl](https://curl.se/).\n\nHere are some example endpoints:\n- **GET** `/api/items` - Get all items\n- **POST** `/api/items` - Create a new item\n- **GET** `/api/items/:id` - Get an item by ID\n- **PUT** `/api/items/:id` - Update an item by ID\n- **DELETE** `/api/items/:id` - Delete an item by ID\n\nReplace **items** with the resource name (e.g. products).\n\n## API Documentation\n\nThis project includes a Swagger file (**swagger.yaml**) for API documentation. You can visualize the documentation using [Swagger UI](https://swagger.io/tools/swagger-ui/) or similar tools. To view the interactive Swagger UI in your browser, use the following URL once the server is running:\n\n```bash\nhttp://localhost:[PORT]/api-docs\n```\n\nThis URL will give you access to the full API documentation where you can interact with the endpoints directly from the browser.\n\n## Folder Structure\n\n```plaintext\n├── controllers   # API route logic\n├── models        # Database schemas\n├── routes        # API routes\n├── .env.example  # Environment variable example\n├── index.js      # Application entry point\n├── swagger.yaml  # Swagger API documentation\n└── package.json  # Project metadata and dependencies\n```\n\n## Technologies Used\n\n- **Node.js**: JavaScript runtime\n- **Express.js**: Web framework for Node.js\n- **MongoDB**: NoSQL database\n- **Swagger**: API documentation\n\n## Usage\n\nOnce the app is running, you can test the CRUD functionality by sending HTTP requests to the available endpoints. Here are some common scenarios:\n\n- **Create a new item**: Send a POST request to **/api/items** with the item data in the request body.\n- **Retrieve all items**: Send a GET request to **/api/items** to get a list of all items in the collection.\n- **Retrieve a single item**: Send a GET request to **/api/items/:id** where **:id** is the **ID** of the item.\n- **Update an item**: Send a PUT request to **/api/items/:id** with the updated data.\n- **Delete an item**: Send a DELETE request to **/api/items/:id**.\n\nYou can use a tool like Postman, curl, or even a frontend application to interact with the API.\n\n## Contributing\n\nFeel free to open issues or submit pull requests. Contributions are welcome!\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahirsust%2Fnodejs-crud-app-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahirsust%2Fnodejs-crud-app-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahirsust%2Fnodejs-crud-app-backend/lists"}