{"id":20346607,"url":"https://github.com/prity25-coder/hospital-api","last_synced_at":"2025-08-22T13:41:32.269Z","repository":{"id":213055157,"uuid":"732896043","full_name":"Prity25-coder/Hospital-API","owner":"Prity25-coder","description":"This is Coding Ninja Backend Skill test project 3","archived":false,"fork":false,"pushed_at":"2023-12-21T06:29:41.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-14T22:31:24.521Z","etag":null,"topics":["express","mongodb","nodejs","swagger-ui"],"latest_commit_sha":null,"homepage":"https://ninja-hospital-api.onrender.com","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/Prity25-coder.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":"2023-12-18T05:29:36.000Z","updated_at":"2023-12-21T06:34:14.000Z","dependencies_parsed_at":"2023-12-21T09:25:37.855Z","dependency_job_id":null,"html_url":"https://github.com/Prity25-coder/Hospital-API","commit_stats":null,"previous_names":["prity25-coder/hospital-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prity25-coder%2FHospital-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prity25-coder%2FHospital-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prity25-coder%2FHospital-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prity25-coder%2FHospital-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Prity25-coder","download_url":"https://codeload.github.com/Prity25-coder/Hospital-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241877401,"owners_count":20035403,"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":["express","mongodb","nodejs","swagger-ui"],"created_at":"2024-11-14T22:13:32.065Z","updated_at":"2025-03-04T15:47:39.329Z","avatar_url":"https://github.com/Prity25-coder.png","language":"JavaScript","readme":"# Welcome to Hospital API\n\n- Coding Ninja Backend Skill Test 3\n\n## Features\n\n- Authentication and Authorization using jwt token\n- Session management\n- Doctor Login\n- Patients register\n- Create report\n- Edit and delete report\n- Track Covid patient status\n- Resource Management\n- Global Error Handling\n- Logging Request and errors\n- Extensible code flow and Folder structure\n- Best env variable setup\n\n## Code Flow\n\n- First browser sends the request to the server\n- Server points to our specific routes\n- before the controller, it may be that there will be middlewares or validators or maybe both\n- If no Middleware of the validator then the request goes to the specific controller\n- Controllers will send back the response, if no need to call services\n- Services are basically functions that help us to get data from DB (here is Mongo DB)\n- Service may use models to save data in some specific format\n\nNote:\nMiddleware/validators may or may not be there\nServices/models may or may not be there\n\nImage for better understanding\n\n![How-Node-code-works](https://github.com/pktherock/Habit-Tracker/assets/59223750/c8cdaadf-09ad-4c2a-9a24-c618859282e8)\n\n## Packages used in this project.\n\n1. bcrypt\n   -\u003e To hash and compare the hashed password\n2. compression\n   -\u003e To compress res bodies\n3. cookie-parser\n   -\u003e To interact with cookies\n4. dotenv\n   -\u003e To store sensitive configurations in a .env file\n5. express\n   -\u003e To create Servers (with minimal code)\n6. express-async-handler\n   -\u003e To wrap controller function so that if any error comes it will next function with the error automatically\n7. express-rate-limit\n   -\u003e To prevent or limit repeated requests to our APIs (a normal user can not send more than 60 request per second)\n8. express-session\n   -\u003e To manage Sessions\n9. express-validator\n   -\u003e To validate request body data\n10. helmet\n    -\u003e Helmet helps secure Express apps by setting HTTP response headers.\n11. jsonwebtoken\n    -\u003e To create jwt token\n12. nodemailer\n    -\u003e To send email\n13. winston\n    -\u003e It helps us to log the req or res in a very easy way\n14. mongoose\n    -\u003e to interact with mongodb\n15. connect-mongo\n    -\u003e to store all sessions in mongodb\n16. swagger-ui-express\n    -\u003e to show api docs for better usability of api end points\n\n## How to run this project locally\n\n- Clone this repository\n- create a .env file at the root of this project\n- create all env variable which is given in the .env.example file with proper info\n- then run npm install (to install all packages used in this project)\n- then run npm run start\n- go to the link shown in the terminal all api docs are there\n- you can use postman as well, i have attached one postman-collection\n  import and change accordingly base on api docs\n- Now you are good to go\n- Thank YOU\n\nNote: \n   - if you put mongoUri of atlas, then please store user and password in .env file and uncomment in db.config.js (user and pass) refer .env.example file\n   - if you are using local mongodb and no user and password is required then comment user and password in db.config.js\n\n### Live Demo Link\n\n[Live Demo Link](https://ninja-hospital-api.onrender.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprity25-coder%2Fhospital-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprity25-coder%2Fhospital-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprity25-coder%2Fhospital-api/lists"}