{"id":21864406,"url":"https://github.com/mahdibehoftadeh/expressjs-notepad-rest-api","last_synced_at":"2026-04-09T17:11:14.457Z","repository":{"id":229326675,"uuid":"776446229","full_name":"MahdiBehoftadeh/expressjs-notepad-rest-api","owner":"MahdiBehoftadeh","description":"A simple RESTful API for a notepad that uses MongoDB as its database and Express JS as its back-end framework.","archived":false,"fork":false,"pushed_at":"2024-08-02T22:05:23.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T15:31:12.833Z","etag":null,"topics":["backend","expressjs","javascript","mongodb","rest-api"],"latest_commit_sha":null,"homepage":"https://behoftadeh.ir","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MahdiBehoftadeh.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":"2024-03-23T14:32:30.000Z","updated_at":"2024-08-02T22:05:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"9d3b4da9-c0bf-4e4a-b2be-6efdd0d035fc","html_url":"https://github.com/MahdiBehoftadeh/expressjs-notepad-rest-api","commit_stats":null,"previous_names":["mahdibehoftadeh/expressjs-notepad-rest-api"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahdiBehoftadeh%2Fexpressjs-notepad-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahdiBehoftadeh%2Fexpressjs-notepad-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahdiBehoftadeh%2Fexpressjs-notepad-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahdiBehoftadeh%2Fexpressjs-notepad-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MahdiBehoftadeh","download_url":"https://codeload.github.com/MahdiBehoftadeh/expressjs-notepad-rest-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244868251,"owners_count":20523584,"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":["backend","expressjs","javascript","mongodb","rest-api"],"created_at":"2024-11-28T04:09:03.067Z","updated_at":"2025-12-30T20:51:11.398Z","avatar_url":"https://github.com/MahdiBehoftadeh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Notes REST API with Express.js and MongoDB - by Mahdi Behoftadeh\n\nThis is a REST API for managing notes. It uses Express.js for the server and MongoDB for the database.\n\n## Features\n\n- Create, read, update, and delete notes.\n- API routes are under `/api/v1`.\n- Data is stored in MongoDB.\n\n## Getting Started\n\n1. **Install dependencies**:\n    ```bash\n    npm install\n    ```\n\n2. **Set up environment variables**:\n    Copy `.env.example` file in the root directory and paste it with a new name `.env` and configure its values with yours:\n    ```\n    API_ROUTE_PREFIX='/api/v1'\n    DATABASE_CONNECTION_STRING='mongodb://localhost:27017'\n    ```\n\n3. **Start the server**:\n    ```bash\n    npm start\n    ```\n    For development with auto-reloading:\n    ```bash\n    npm run dev\n    ```\n\nThe server will run on port 3000 by default.\n\n## API Endpoints\n\n### Notes\n\n- **Get all notes**\n    - `GET /api/v1/notes`\n    - Returns a list of all notes.\n\n- **Get a note by ID**\n    - `GET /api/v1/notes/:id`\n    - Returns a note by its ID.\n\n- **Create a note**\n    - `POST /api/v1/notes`\n    - **Body**:\n      ```json\n      {\n        \"title\": \"string\",\n        \"text\": \"string\"\n      }\n      ```\n    - Creates a new note.\n\n- **Update a note**\n    - `PATCH /api/v1/notes/:id`\n    - **Body**:\n      ```json\n      {\n        \"title\": \"string\",\n        \"text\": \"string\"\n      }\n      ```\n    - Updates an existing note by its ID.\n\n- **Delete a note**\n    - `DELETE /api/v1/notes/:id`\n    - Deletes a note by its ID.\n \n\n## Error Handling\n\n- `400 Bad Request`: For invalid data or errors with the request.\n- `404 Not Found`: When a note is not found.\n- `500 Internal Server Error`: For server or database issues.\n\n## Dependencies\n\n- **Dependencies**:\n  - `body-parser`: Parses request bodies.\n  - `express`: Server framework.\n  - `mongoose`: MongoDB object modeling.\n\n- **DevDependencies**:\n  - `dotenv`: Loads environment variables.\n  - `nodemon`: Auto-reloads server during development.\n\n## Links\n\n- **Repository**: [GitHub Repo](https://github.com/MahdiBehoftadeh/expressjs-notepad-rest-api)\n- **Issues**: [Issue Tracker](https://github.com/MahdiBehoftadeh/expressjs-notepad-rest-api/issues)\n- **Homepage**: [Project Homepage](https://github.com/MahdiBehoftadeh/expressjs-notepad-rest-api#readme)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahdibehoftadeh%2Fexpressjs-notepad-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahdibehoftadeh%2Fexpressjs-notepad-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahdibehoftadeh%2Fexpressjs-notepad-rest-api/lists"}