{"id":20923487,"url":"https://github.com/exortek/nodejs-question-answer-api","last_synced_at":"2025-07-01T06:35:15.028Z","repository":{"id":186358263,"uuid":"431996058","full_name":"ExorTek/nodejs-question-answer-api","owner":"ExorTek","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-30T11:44:43.000Z","size":517,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-27T05:53:21.586Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ExorTek.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":"2021-11-25T22:52:46.000Z","updated_at":"2021-11-30T21:03:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"3636365a-cca0-4575-a94d-5b350468a22d","html_url":"https://github.com/ExorTek/nodejs-question-answer-api","commit_stats":null,"previous_names":["exortek/nodejs-question-answer-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ExorTek/nodejs-question-answer-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExorTek%2Fnodejs-question-answer-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExorTek%2Fnodejs-question-answer-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExorTek%2Fnodejs-question-answer-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExorTek%2Fnodejs-question-answer-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ExorTek","download_url":"https://codeload.github.com/ExorTek/nodejs-question-answer-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExorTek%2Fnodejs-question-answer-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262914198,"owners_count":23383846,"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-18T20:16:05.121Z","updated_at":"2025-07-01T06:35:15.006Z","avatar_url":"https://github.com/ExorTek.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This project is still being developed — PRs, Contributions and Issues are all welcome!\n\n- [Original Readme](https://github.com/mustafamuratcoskun/question-answer-rest-api/blob/master/README.md)\n\n# Getting started\n\n[Postman Collection](https://www.postman.com/memetdemirel/workspace/question-answer-api/overview)\n\nTo get the Node server running locally:\n\n- Clone this repo\n- `npm install` to install all required dependencies\n- Create MongoDb Cluster and Get Connection MongoDb URI\n- Set environment variables in `config.env` under `./config/env`\n    * Set `MONGO_URI = \u003cYOUR_MONGO_URI\u003e`\n    * Set `JWT_SECRET_KEY = \u003cYOUR_SECRET_KEY\u003e`\n    * Set `SMTP_EMAIL = \u003cYOUR_GMAIL_EMAIL\u003e`\n    * Set `SMTP_PASS = \u003cYOUR_GMAIL_PASSWORD\u003e`\n- `node dummy-generator.js --import` to load dummy data to database\n- `npm run dev` to start the local server developer environment\n\n# Code Overview\n\n## Dependencies\n\n- [expressjs](https://github.com/expressjs/express) - The server for handling and routing HTTP requests\n- [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) - For generating JWTs used by authentication\n- [mongoose](https://github.com/Automattic/mongoose) - For modeling and mapping MongoDB data to JavaScript\n- [slugify](https://github.com/simov/slugify) - For encoding titles into a URL-friendly format\n- [bcryptjs](https://github.com/dodo/node-slug) - Hashing Password\n- [dotenv](https://github.com/motdotla/dotenv) - Zero-Dependency module that loads environment variables\n- [multer](https://github.com/expressjs/multer) - Node.js middleware for uploading files\n- [nodemailer](https://github.com/nodemailer/nodemailer) - Send e-mails from Node.js\n\n## Application Structure\n\n- `server.js` - The entry point to our application. This file defines our express server and connects it to MongoDB\n  using mongoose. It also inncludes the routes we'll be using in the application.\n- `config/` - This folder contains configuration for central location environment variables and other configurations.\n- `routes/` - This folder contains the route definitions (answer, question etc. ) for our API.\n- `models/` - This folder contains the schema definitions for our Mongoose models (User, Question).\n- `controllers/` - This folder contains controllers for our API.\n- `public/` - This folder contains static files for our API.\n- `middlewares/` - This folder contains middlewares for our API.\n- `helpers/` - This folder contains helper functions for adapting 3rd party libraries for our API.\n- `dummy/` - This folder contains dummy data created by dummy-generator.js file for our database.\n\n## Error Handling\n\nIn `middlewares/errors/errorHandler.js`, we define a error-handling middleware for handling Mongoose's errors and our\nown errors.\n\n## Authentication\n\nRequests are authenticated using the `Authorization` header and value `Bearer: {{token}}`. with a valid JWT.\n\nWe define express middlewares in `middlewares/authorization/auth.js` that can be used to authenticate requests.\nThe `required` middlewares returns `401` or `403`.\n\n## API Specifications\n\nDetailed information can be found in [this specifications](./question-answer-specifications.md). \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexortek%2Fnodejs-question-answer-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexortek%2Fnodejs-question-answer-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexortek%2Fnodejs-question-answer-api/lists"}