{"id":21273205,"url":"https://github.com/saurabhdhumane/nodejsrestfullapi","last_synced_at":"2026-04-10T02:44:05.302Z","repository":{"id":249387136,"uuid":"831247988","full_name":"saurabhdhumane/nodejsRestFullApi","owner":"saurabhdhumane","description":"A comprehensive RESTful API for managing persons, built with Node.js, Express, and MongoDB. This project is designed for those who want to study and understand the structure and implementation of a RESTful API.","archived":false,"fork":false,"pushed_at":"2024-07-20T11:39:11.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T03:09:04.224Z","etag":null,"topics":["expressjs","javascript","mongodb","mongoose","nodejs","rest-api","restful-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/saurabhdhumane.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-07-20T03:21:56.000Z","updated_at":"2024-07-24T18:31:42.000Z","dependencies_parsed_at":"2024-07-20T12:58:01.262Z","dependency_job_id":null,"html_url":"https://github.com/saurabhdhumane/nodejsRestFullApi","commit_stats":null,"previous_names":["saurabhdhumane/nodejsrestfullapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saurabhdhumane%2FnodejsRestFullApi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saurabhdhumane%2FnodejsRestFullApi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saurabhdhumane%2FnodejsRestFullApi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saurabhdhumane%2FnodejsRestFullApi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saurabhdhumane","download_url":"https://codeload.github.com/saurabhdhumane/nodejsRestFullApi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243732252,"owners_count":20338831,"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":["expressjs","javascript","mongodb","mongoose","nodejs","rest-api","restful-api"],"created_at":"2024-11-21T09:13:03.609Z","updated_at":"2026-04-10T02:44:00.260Z","avatar_url":"https://github.com/saurabhdhumane.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# nodejsRestFullApi\r\n \r\n```markdown\r\n# Person Management System - RESTful API\r\n\r\nA comprehensive RESTful API for managing persons, built with Node.js, Express, and MongoDB. This project is designed for those who want to study and understand the structure and implementation of a RESTful API.\r\n\r\n## Features\r\n\r\n- **Display All Persons**: Fetch and display all registered persons.\r\n- **Register Person**: Create a new person with fields such as name, email, address, and password.\r\n- **Update Person**: Update the details of an existing person.\r\n- **Delete Person**: Remove a person from the database.\r\n- **Login**: Authenticate a person using their email and password.\r\n- **Logout**: Invalidate the current session token.\r\n\r\n## Technologies Used\r\n\r\n- **Node.js**: JavaScript runtime for building server-side applications.\r\n- **Express**: Web framework for Node.js.\r\n- **MongoDB**: NoSQL database for storing person data.\r\n- **Mongoose**: ODM library for MongoDB.\r\n- **bcryptjs**: Library for hashing passwords.\r\n- **jsonwebtoken**: Library for handling JSON Web Tokens (JWT).\r\n- **dotenv**: Module for loading environment variables.\r\n- **Helmet**: Middleware for securing Express apps by setting various HTTP headers.\r\n\r\n## Project Structure\r\n\r\n```plaintext\r\n├── controllers\r\n│   └── PersonController.js   # Controller logic for person-related operations\r\n├── middleware\r\n│   └── userAuth.js           # Middleware for user authentication\r\n    └── errorMiddleware.js           # Middleware for error handling\r\n├── models\r\n│   └── PersonModel.js        # Mongoose schema and model for Person\r\n├── routes\r\n│   └── personRoutes.js       # Route definitions for person-related endpoints\r\n├── util\r\n│   └── jwt.js                # Utility functions for JWT handling\r\n├── config\r\n│   └── db.js                 # Database connection setup\r\n├── .env                      # Environment variables\r\n├── app.js                    # Main application file\r\n├── package.json              # Project metadata and dependencies\r\n└── README.md                 # Project documentation\r\n```\r\n\r\n## Installation\r\n\r\n1. Clone the repository:\r\n   ```bash\r\n   git clone https://github.com/saurabhdhumane/nodejsRestFullApi\r\n   ```\r\n\r\n2. Navigate to the project directory:\r\n   ```bash\r\n   cd nodejsRestFullApi\r\n   ```\r\n\r\n3. Install the dependencies:\r\n   ```bash\r\n   npm install\r\n   ```\r\n\r\n4. Create a `.env` file and add your environment variables:\r\n   ```\r\n   PORT=8080\r\n   DB_CONNECT=your_mongodb_connection_string\r\n   JWT_SECRET_KEY=your_jwt_secret_key\r\n   ```\r\n\r\n5. Start the server:\r\n   ```bash\r\n   npm start\r\n   ```\r\n\r\n## Usage\r\n\r\n- **GET /**: Display all persons.\r\n- **POST /register**: Register a new person.\r\n- **PATCH /update**: Update an existing person.\r\n- **DELETE /delete**: Delete a person.\r\n- **POST /login**: Login a person.\r\n- **POST /logout**: Logout a person.\r\n\r\n## Learning Objectives\r\n\r\n- Understand the structure of a RESTful API project.\r\n- Learn how to implement CRUD operations with Express and MongoDB.\r\n- Study user authentication using JWT.\r\n- Learn to handle errors and secure your API with middleware.\r\n\r\n## Contributing\r\n\r\nFeel free to fork the repository and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License.\r\n```\r\n\r\nFeel free to replace `https://github.com/saurabhdhumane/nodejsRestFullApi` with the actual URL of your GitHub repository. Adjust any other parts as necessary to better fit your specific project details.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaurabhdhumane%2Fnodejsrestfullapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaurabhdhumane%2Fnodejsrestfullapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaurabhdhumane%2Fnodejsrestfullapi/lists"}