{"id":25746327,"url":"https://github.com/sultan308/masjidi","last_synced_at":"2026-04-12T03:38:06.919Z","repository":{"id":38616831,"uuid":"506659222","full_name":"sultan308/masjidi","owner":"sultan308","description":"A web app serving masjids details and providing a space to share feedback about them.","archived":false,"fork":false,"pushed_at":"2022-06-29T12:17:05.000Z","size":897,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T11:38:44.008Z","etag":null,"topics":["express","nodejs","postgresql","reactjs","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/sultan308.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}},"created_at":"2022-06-23T13:49:25.000Z","updated_at":"2022-06-29T11:01:53.000Z","dependencies_parsed_at":"2022-08-28T23:31:47.831Z","dependency_job_id":null,"html_url":"https://github.com/sultan308/masjidi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sultan308/masjidi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultan308%2Fmasjidi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultan308%2Fmasjidi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultan308%2Fmasjidi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultan308%2Fmasjidi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sultan308","download_url":"https://codeload.github.com/sultan308/masjidi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sultan308%2Fmasjidi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31703501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"online","status_checked_at":"2026-04-12T02:00:06.763Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["express","nodejs","postgresql","reactjs","restful-api"],"created_at":"2025-02-26T11:31:00.836Z","updated_at":"2026-04-12T03:38:06.895Z","avatar_url":"https://github.com/sultan308.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Masjidi**\n\nA web app serving masjids details and providing a space to share feedback about them.\n\n\n## Installation\n```bash\n$ git clone git@github.com:sultan308/masjidi.git working-directory-name\n$ cd working-directory-name\n$ cd server\n$ npm install\n$ cd ../client\n$ npm install\n``` \nThen rename the \".example.env\" file in the server folder to .env and enter your environment values. \n## GUI Usage\n### Home page\n![Home page image](https://raw.githubusercontent.com/sultan308/masjidi/main/imgs/home-page.png)\n#### From the home page the user can :\n* Add a new Masjid\n* Click on a masjid to got to it's page\n* Delete a masjid \n* Go to the masjid update page by clicking update\n* See all masjids with their average rating, number of reviews and locaton\n\n### Masjid page\n![Masjid page image](https://raw.githubusercontent.com/sultan308/masjidi/main/imgs/masjid-page.png)\n#### From the Masjid page the user can :\n* Add a new review\n* View masjid reviews \n* See all the masjid details\n  \nNote : The review color changes in correspondence with the rating value.\n\n### Update masjid page\n![Update masjid page image](https://raw.githubusercontent.com/sultan308/masjidi/main/imgs/update-masjid-page.png)\n#### From the Update masjid page the user can :\n* Change the masjd name\n* Change the masjid location \n\nNote : After clicking update the user will be redirected to the home page.\n\n---\n## API Usage\n\n### ```GET``` Requests:\n---\n#### ```{host}/api/v1/masjid```\n\n\n##### Request body\nnone\n\n\n**Successful Response** : \n\n```200``` and JSON with attributes :\n\n* ```status``` Always equal success if the request was successful\n* ```length``` The number od masjid ojects returned\n* ```data``` An array of masjid objects Each having:\n  \n  * ```id``` Masjid id\n  * ```name``` Masjid name\n  * ```location``` masjid location\n  * ```avg_rating``` Average rating\n  * ```count``` Number of reviews that the Masjid has\n  \nExample JSON\n```json\n{ \n    \"status\": \"success\" ,\n    \n    \"length\": 2 ,\n\n    \"data\": [\n        {\n            \"id\": \"1\",\n            \"name\": \"Canterbury mosque\",\n            \"location\": \"UK, England , Canterbury, Uni\",\n            \"avg_rating\": \"3.4\",\n            \"count\": \"16\"\n        },\n        {\n            \"id\": \"58\",\n            \"name\": \"Mosque\",\n            \"location\": \"1 Street, town, city, postcode, Country\",\n            \"avg_rating\": \"4.0\",\n            \"count\": \"4\"\n        }\n    ],\n    \n}\n```\n\n**Error Responses :**\n\n\nError status code and JSON with attributes :\n* ```status``` Always equal Fail if the request was failed\n* ```statusCode``` HTTP error status code\n* ```msg``` error message\n  \nExample JSON\n```json\n{\n    \"status\": \"Fail\",\n    \"statusCode\": 500,\n    \"msg\": \"Error occured\"\n}\n```\nPossible erros:\n* StatusCode : ```500```  and msg: ```\"Error occured\"``` | internal server error\n\n---\n#### ```{host}/api/v1/masjid/:id```\nWhere ```:id``` is the id of the requested masjid\n\n##### Request body\nnone\n\n\n**Successful Response** : \n\n```200``` and JSON with attributes :\n\n* ```status``` Always equal success if the request was \n* ```data``` An Masjid objects  having:\n  \n  * ```id``` Masjid id\n  * ```name``` Masjid name\n  * ```location``` masjid location\n  * ```avg_rating``` Average rating\n  * ```count``` Number of reviews that the Masjid has\n  \nExample JSON\n```json\n{\n    \"status\": \"success\",\n    \"data\": {\n        \"id\": \"1\",\n        \"name\": \"Canterbury mosque\",\n        \"location\": \"UK, England , Canterbury, Uni\",\n        \"avg_rating\": \"3.4\",\n        \"count\": \"16\"\n    }\n}\n```\n\n**Error Responses :** \n\n\nError status code and JSON with attributes :\n* ```status``` Always equal Fail if the request was failed\n* ```statusCode``` HTTP error status code\n* ```msg``` error message\n  \nExample JSON\n```json\n{\n    \"status\": \"Fail\",\n    \"statusCode\": 400,\n    \"msg\": \"Masjid id needs to be a number.\"\n}\n```\nPossible erros:\n* StatusCode : ```400```  and msg: ```\"Masjid id needs to be a number.\"``` | Supplied id wasn't an integer.\n* StatusCode : ```404```  and msg: ```\"Masjid doesn't exist\"``` | Masjid wasn't found.\n* StatusCode : ```500```  and msg: ```\"Error occured\"``` | internal server error.\n\n---\n#### ```{host}/api/v1/masjid/:id/reviews```\nWhere ```:id``` is the id of the requested masjid\n\n##### Request body\nnone\n\n\n**Successful Response** : \n\n```200``` and JSON with attributes :\n\n* ```status``` Always equal success if the request was successful\n* ```length``` The number of review ojects returned\n* ```data``` An array of review objects Each having:\n  \n  * ```id``` Review id\n  * ```masjid_id``` Masjid id\n  * ```firstname``` Reviewer first name\n  * ```lastname``` Reviewer Last name\n  * ```review``` the review \n  * ```rating``` rating between 1 and 5 inclusive\n  \nExample JSON\n```json\n{\n    \"status\": \"success\",\n    \"length\": 2,\n    \"data\": [\n        {\n            \"id\": \"66\",\n            \"masjid_id\": \"58\",\n            \"firstname\": \"Ahmed\",\n            \"lastname\": \"Mohamed\",\n            \"review\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst quisque sagittis purus sit amet. At volutpat diam ut venenatis.\",\n            \"rating\": 5\n        },\n        {\n            \"id\": \"68\",\n            \"masjid_id\": \"58\",\n            \"firstname\": \"Mohamed\",\n            \"lastname\": \"Ali\",\n            \"review\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst quisque sagittis purus sit amet. At volutpat diam ut venenatis.\",\n            \"rating\": 4\n        }\n    ]\n    \n}\n```\n\n**Error Responses :** \n\n\nError status code and JSON with attributes :\n* ```status``` Always equal Fail if the request was failed\n* ```statusCode``` HTTP error status code\n* ```msg``` error message\n  \nExample JSON\n```json\n{\n    \"status\": \"Fail\",\n    \"statusCode\": 400,\n    \"msg\": \"Masjid id needs to be a number.\"\n}\n```\nPossible erros:\n* StatusCode : ```400```  and msg: ```\"Masjid id needs to be a number.\"``` | Supplied id wasn't an integer.\n* StatusCode : ```404```  and msg: ```\"Masjid doesn't exist\"``` | Masjid wasn't found.\n* StatusCode : ```500```  and msg: ```\"Error occured\"``` | internal server error.\n\n### ```POST``` Requests:\n---\n#### ```{host}/api/v1/masjid```\n\n\n##### Request body\n\nJSON with attributes :\n* ```name``` | String | Masjid name\n* ```location``` | String | masjid location\nExample JSON\n```json\n{\n    \"name\" : \"Masjid Name\",\n    \"location\": \"Masjid Location\"\n}\n```\n**Successful Response** : \n\n```201``` and JSON with attributes :\n\n* ```status``` Always equal success if the request was successful\n* ```data``` the created masjid object with attributes:\n  \n  * ```id``` Masjid id\n  * ```name``` Masjid name\n  * ```location``` Masjid location\n  \nExample JSON\n```json\n{\n    \"status\": \"success\",\n    \"data\": {\n        \"id\": \"59\",\n        \"name\": \"Masjid Name\",\n        \"location\": \"Masjid Location\"\n    }\n}\n```\n\n**Error Responses :** \n\n\nError status code and JSON with attributes :\n* ```status``` Always equal Fail if the request was failed\n* ```statusCode``` HTTP error status code\n* ```msg``` error message\n  \nExample JSON\n```json\n{\n    \"status\": \"Fail\",\n    \"statusCode\": 400,\n    \"msg\": \"Request body needs to have name and location\"\n}\n```\nPossible erros:\n* StatusCode : ```400```  and msg: ```\"Request body needs to have name and location.\"``` | Name or location weren't supplied in the request body.\n* StatusCode : ```400```  and msg: ```\"name and location needs to be a string.\"``` | Name or location aren't string.\n* StatusCode : ```400```  and msg: ```\"name and location can't be empty\"``` | Name or location attributes where empty.\n* StatusCode : ```500```  and msg: ```\"Error occured\"``` | internal server error.\n\n---\n\n#### ```{host}/api/v1/masjid/:id/reviews```\nWhere ```:id``` is the id of the requested masjid\n\n\n##### Request body\n\nJSON with attributes :\n* ```firstName``` | String | Reviewer first name\n* ```lastName``` | String | Reviewer last name\nExample JSON\n* ```review``` | String | Reviwe content\n* ```rating``` | Integer | Rating between 1 and 5 inclusive\nExample JSON\n```json\n{\n    \"firstName\" : \"Ahmed\",\n    \"lastName\" : \"Mohamed\",\n    \"review\" :\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst quisque sagittis purus sit amet. At volutpat diam ut venenatis.\",\n    \"rating\" : 5\n}\n```\n**Successful Response** : \n\n```201``` and JSON with attributes :\n\n* ```status``` Always equal success if the request was successful\n* ```data``` the created masjid object with attributes:\n  \n  * ```id``` Review id\n  * ```masjid_id``` Masjid id\n  * ```firstname``` Reviewer first name\n  * ```lastname``` Reviewer Last name\n  * ```review``` the review \n  * ```rating``` rating between 1 and 5 inclusive\n  \nExample JSON\n```json\n{\n    \"status\": \"success\",\n    \"data\": {\n        \"id\": \"70\",\n        \"masjid_id\": \"58\",\n        \"firstname\": \"Ahmed\",\n        \"lastname\": \"Mohamed\",\n        \"review\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst quisque sagittis purus sit amet. At volutpat diam ut venenatis.\",\n        \"rating\": 5\n    }\n}\n```\n\n**Error Responses :** \n\n\nError status code and JSON with attributes :\n* ```status``` Always equal Fail if the request was failed\n* ```statusCode``` HTTP error status code\n* ```msg``` error message\n  \nExample JSON\n```json\n{\n    \"status\": \"Fail\",\n    \"statusCode\": 400,\n    \"msg\": \"Request body needs to have firstName, lastName, review,  rating\"\n}\n```\nPossible erros:\n* StatusCode : ```400```  and msg: ```\"Request body needs to have firstName, lastName, review,  rating\"``` | A required attribute weren't supplied in the request body.\n* StatusCode : ```400```  and msg: ```\"firstName, lastName and review needs to be a string.\"``` | The firstName, lastName or review supplied in the request body weren't of type string.\n* StatusCode : ```400```  and msg: ```\"firstName, lastName and review can't be empty.\"``` | The firstName, lastName or review supplied in the request body were empty. \n* StatusCode : ```400```  and msg: ```\"rating need to be a number between 1 and 5 inclusive.\"``` | The supplied rating was either not an integer, bigger than 5 or less than 1. \n* StatusCode : ```400```  and msg: ```\"Masjid id needs to be a number.\"``` | Supplied id wasn't an integer.\n* StatusCode : ```404```  and msg: ```\"Masjid doesn't exist\"``` | Masjid wasn't found.\n* StatusCode : ```500```  and msg: ```\"Error occured\"``` | internal server error.\n\n### ```PUT``` Requests:\n---\n#### ```{host}/api/v1/masjid/:id```\nWhere ```:id``` is the id of the requested masjid\n\n\n##### Request body\n\nJSON with attributes :\n* ```name``` | String | Masjid name\n* ```location``` | String | masjid location\nExample JSON\n```json\n{\n    \"name\" : \"Masjid Name\",\n    \"location\": \"Masjid Location\"\n}\n```\n**Successful Response** : \n\n```200``` and JSON with attributes :\n\n* ```status``` Always equal success if the request was successful\n* ```data``` the created masjid object with attributes:\n  \n  * ```id``` Masjid id\n  * ```name``` Masjid name\n  * ```location``` Masjid location\n  \nExample JSON\n```json\n{\n    \"status\": \"success\",\n    \"data\": {\n        \"id\": \"59\",\n        \"name\": \"Masjid Name\",\n        \"location\": \"Masjid Location\"\n    }\n}\n```\n\n**Error Responses :** \n\n\nError status code and JSON with attributes :\n* ```status``` Always equal Fail if the request was failed\n* ```statusCode``` HTTP error status code\n* ```msg``` error message\n  \nExample JSON\n```json\n{\n    \"status\": \"Fail\",\n    \"statusCode\": 400,\n    \"msg\": \"Request body needs to have name and location\"\n}\n```\nPossible erros:\n* StatusCode : ```400```  and msg: ```\"Request body needs to have name and location.\"``` | Name or location weren't supplied in the request body.\n* StatusCode : ```400```  and msg: ```\"name and location needs to be a string.\"``` | Name or location aren't string.\n* StatusCode : ```400```  and msg: ```\"name and location can't be empty\"``` | Name or location attributes where empty.\n* StatusCode : ```400```  and msg: ```\"Masjid id needs to be a number.\"``` | Supplied id wasn't an integer.\n* StatusCode : ```404```  and msg: ```\"Masjid doesn't exist\"``` | Masjid wasn't found.\n* StatusCode : ```500```  and msg: ```\"Error occured\"``` | internal server error.\n\n### ```DELETE``` Requests:\n---\n#### ```{host}/api/v1/masjid/:id```\n\n\n##### Request body\n\nnone\n\n**Successful Response** : \n\n**```204``` an empty body.**\n\n**Error Responses :** \n\n\nError status code and JSON with attributes :\n* ```status``` Always equal Fail if the request was failed\n* ```statusCode``` HTTP error status code\n* ```msg``` error message\n  \nExample JSON\n```json\n{\n    \"status\": \"Fail\",\n    \"statusCode\": 404,\n    \"msg\": \"Faild to delete, Masjid doesn't exist.\"\n}\n```\nPossible erros:\n* StatusCode : ```400```  and msg: ```\"Masjid id needs to be a number.\"``` | Supplied id wasn't an integer.\n* StatusCode : ```404```  and msg: ```\"Masjid doesn't exist\"``` | Masjid wasn't found.\n* StatusCode : ```500```  and msg: ```\"Error occured\"``` | internal server error.\n\n## Contributing\nThis project was created for practice purposes only its not intended realword use. However any reccomndation are welcome. Wiether its a major desgin flaw or a best prctice advice please don't hesitate to open a new issue I am always happy to learn.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsultan308%2Fmasjidi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsultan308%2Fmasjidi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsultan308%2Fmasjidi/lists"}