{"id":22115336,"url":"https://github.com/abdulrhmangoni/am-store-server","last_synced_at":"2026-04-04T08:44:04.290Z","repository":{"id":183706273,"uuid":"670235593","full_name":"AbdulrhmanGoni/AM-store-server","owner":"AbdulrhmanGoni","description":"The server side (API) of \"AM Store\" project","archived":false,"fork":false,"pushed_at":"2024-04-12T12:30:24.000Z","size":587,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-12T20:16:02.109Z","etag":null,"topics":["api","apitesting","backend","database","docker","docker-compose","e-commerce-project","javascript","jest-tests","mongodb","mongoose","nodejs","server-side","web","web-application","web-development"],"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/AbdulrhmanGoni.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}},"created_at":"2023-07-24T15:32:27.000Z","updated_at":"2024-04-14T19:36:03.483Z","dependencies_parsed_at":null,"dependency_job_id":"a6971b45-cd6c-4f85-95da-4c27cf28fff1","html_url":"https://github.com/AbdulrhmanGoni/AM-store-server","commit_stats":null,"previous_names":["abdulrhmangoni/am-store-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdulrhmanGoni%2FAM-store-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdulrhmanGoni%2FAM-store-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdulrhmanGoni%2FAM-store-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdulrhmanGoni%2FAM-store-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AbdulrhmanGoni","download_url":"https://codeload.github.com/AbdulrhmanGoni/AM-store-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245212884,"owners_count":20578537,"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":["api","apitesting","backend","database","docker","docker-compose","e-commerce-project","javascript","jest-tests","mongodb","mongoose","nodejs","server-side","web","web-application","web-development"],"created_at":"2024-12-01T12:15:28.510Z","updated_at":"2025-12-30T20:34:55.597Z","avatar_url":"https://github.com/AbdulrhmanGoni.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AM Store's Server (API)\n\n## Description\n\nThis is the server side or the **Back End** of **AM Store** project (e-commerce), \u003cbr\u003e\nWhich is the server that handles the business logic of the e-commerce and provides the services to the clients\n([**AM Store** Client site](https://github.com/AbdulrhmanGoni/AM-store-client) and\n[**AM Store** Admin Pandel](https://github.com/AbdulrhmanGoni/AM-store-admin)).\n\n## Technologies :hammer_and_wrench:\n\n- JavaScript \u003cimg src=\"./icons_readme/javascript.svg\" style=\"width: 15px;height: 15px; transform: translate(6px, 3px)\"\u003e\n- Node.js \u003cimg src=\"./icons_readme/nodejs.svg\" style=\"width: 50px;height: 16px; transform: translate(6px, 3px)\"\u003e\n- Express.js \u003cimg src=\"./icons_readme/express.jpg\" style=\"width: 50px;height: 15px; transform: translate(6px, 3px)\"\u003e\n- MongoDB \u003cimg src=\"./icons_readme/mongodb.svg\" style=\"width: 16px;height: 16px; transform: translate(6px, 3px)\"\u003e\n- Mongoose \u003cimg src=\"./icons_readme/mongoose.png\" style=\"width: 36px;height: 16px; transform: translate(6px, 3px)\"\u003e\n- Docker \u003cimg src=\"./icons_readme/docker.svg\" style=\"width: 50px;height: 16px; transform: translate(6px, 3px)\"\u003e\n- Jest \u003cimg src=\"./icons_readme/jest.svg\" style=\"width: 15px;height: 15px; transform: translate(6px, 3px)\"\u003e\n- Supertest \u003cimg src=\"./icons_readme/supertest.png\" style=\"width: 15px;height: 15px; transform: translate(6px, 3px)\"\u003e\n\n## Architecture :memo:\n\nThis **API** is a `RESTful API`, And it follows the `MVC` architectural pattern for separation of concerns and organizing the code to make it more modular, maintainable and easier to test.\n\n## Install and Get Started :rocket:\n\n### Requirements\n\nThis project built with the Javascript Runtime Environment `Node.js` and `Docker`, \u003cbr\u003e\nSo you need to have `Node.js` and `Docker` installed in your machine to be able to install the project and run it. \u003cbr\u003e\n\n- If you don't have `Node.js`, Go to [the official website of Node.js](https://nodejs.org/en/download) and install it. \u003cbr\u003e\n- If you don't have `Docker`, Go to [Docker official website](https://docs.docker.com/engine/install/) and install it.\n\n\u003cbr\u003e\n\nFollow these steps to install and run AM Store's Server in your machine :point_down::\n\n### Clone the repository on your machine\n\nOpen the terminal on your machine whenever you want and run the following command to clone the repository:\n\n```\ngit clone https://github.com/AbdulrhmanGoni/AM-store-server.git\n```\n\n### Prepare running environment\n\nFirst open `AM-store-server` folder by running this command\n\n```\ncd AM-store-server\n```\n\nAnd then create `.env.development` files using the following command:\n\nIf you use **Linux** or **Mac** operating systems run this command:\n\n```\ntouch .env.development\n```\n\nIf you use **Windows** operating system run this command:\n\n```\necho \"\" \u003e .env.development\n```\n\nOpen `.env.development` file and add these variables to it:\n\n\u003e [!NOTE]\n\u003e You can left these variables empty and go to [run the server](#run-the-server) directlty in development mode\n\u003e and it will work, but know that there are some features and functionalites may don't work because the variables\n\u003e that they depend on are missing.\n\n```\nHASHING_SALT_ROUNDS=\nJWT_SECRET_KEY=\"\"\nSTORE_EMAIL=\"\"\nEMAIL_APP_PASSWORD=\"\"\nVERIFY_EMAIL_API_KEY=\"\"\nDB_CONNECTION_TYPE=\"\"\nDB_USERNAME=\"\"\nDB_PASSWORD=\"\"\nDB_NAME=\"\"\nDB_HOST=\"\"\nREDIS_CONNECTION_TYPE=\"\"\nREDIS_USERNAME=\"\"\nREDIS_PASSWORD=\"\"\nREDIS_HOST=\"\"\nREDIS_PORT=\n```\n\nA quick description of these environment variable:\n| VARIABLE | DESCRIPTION |\n| --- | --- |\n| HASHING_SALT_ROUNDS | The number rounds that hashing algorithm should take to encrypt users paswords |\n| JWT_SECRET_KEY | The secret key of the tokens that will used to generat users access tokens |\n| STORE_EMAIL | The official email of the store |\n| EMAIL_APP_PASSWORD | The pasword of the app that should be created from Google cloud platform for store's email |\n| VERIFY_EMAIL_API_KEY | The API key of [hunter.io platform](https://hunter.io/) for using **Email Verifier** service to verify users emails existence |\n| DB_CONNECTION_TYPE | Specifies how the server connects to the database (use \"remote\" or let it empty) |\n| DB_USERNAME | The name of the user who has access to the mongo database of the project (**it used only if `DB_CONNECTION_TYPE` variable is specified to \"remote\"**) |\n| DB_PASSWORD | The password of the user who has access to the mongo database of the project (**it used only if `DB_CONNECTION_TYPE` variable is specified to \"remote\"**) |\n| DB_NAME | The name of the mongo database of the project (**it used only if `DB_CONNECTION_TYPE` variable is specified to \"remote\"**) |\n| DB_HOST | The host name of the database of the project, in other words, where is the database hosted?, (**it used only if `DB_CONNECTION_TYPE` variable is specified to \"remote\"**) |\n| REDIS_CONNECTION_TYPE | Specifies how the server connects to redis database (use \"remote\" or let it empty) |\n| REDIS_USERNAME | The name of redis database that used for caching in the project (**it used only if `REDIS_CONNECTION_TYPE` variable is specified to \"remote\"**) |\n| REDIS_PASSWORD | The password of redis database that used for caching in the project (**it used only if `REDIS_CONNECTION_TYPE` variable is specified to \"remote\"**) |\n| REDIS_HOST | The host name of redis database, in other words, where is redis database hosted?, (**it used only if `REDIS_CONNECTION_TYPE` variable is specified to \"remote\"**) |\n| REDIS_PORT | The port that redis database should listen to (**it used only if `REDIS_CONNECTION_TYPE` variable is specified to \"remote\"**) |\n\n### Run the server\n\nRun the server using the following command:\n\n```\nnpm run docker-dev\n```\n\nAnd congratulations 🎉, Your AM Store Server is up and running on your http://localhost:7000.\n\n## Endpoints \u0026 Documentation :ledger:\n\nYou can browse the **Endpoints** and the **Documentation** of the **API** on **Postman** :point_down:\n\n[\u003cimg src=\"./icons_readme/postman-button.svg\" alt=\"Run In Postman\" style=\"width: 128px; height: 32px; transform: translateY(4px)\"\u003e](https://app.getpostman.com/run-collection/27040994-2b37c7cf-3a2d-4022-9dfa-6b850399d269?action=collection%2Ffork\u0026source=rip_markdown\u0026collection-url=entityId%3D27040994-2b37c7cf-3a2d-4022-9dfa-6b850399d269%26entityType%3Dcollection%26workspaceId%3Db9135996-e8d9-4c02-bc81-d0b278bfc9ff)\n\n## Authentication :key:\n\nThis **API** uses **JSON Web Tokens ( JWT \u003cimg src=\"./icons_readme/jwt.svg\" alt=\"JWT Icon\" style=\"width: 15px; height: 15px; transform: translateY(3px)\"\u003e )** for users authentication. \u003cbr\u003e\nUsers can log in or sign up with their credentials (e.g., email and password or google authentication)\nto obtain a **JWT token**, And then this token will be included in subsequent requests to authenticate the user\nand authorize him to access the protected resources (e.g his data, orders, shopping cart, favorites, etc. ).\n\n## Tests :test_tube:\n\nThis project uses a combination of unit and integration tests written with [`Jest`](https://jestjs.io)\nto test the functionality of the API.\n\n### Running The Tests:\n\nTo run all tests use the following command:\n\n```\nnpm test\n```\n\nTo run specific tests files add an argumant matches files names, For example `orders`\n\n```\nnpm test orders\n```\n\nTo run a specific tests file add the full name of the file as an argumant, For example `products_addDiscount_post`\n\n```\nnpm test products_addDiscount_post\n```\n\n### Tests Code Coverage Report:\n\n![code coverage badges](https://raw.githubusercontent.com/AbdulrhmanGoni/AM-store-server-tests-code-coverage-report/main/tests-code-coverage-report/badges.svg)\n\nYou can go to [tests code coverage report stie](https://abdulrhmangoni.github.io/AM-store-server-tests-code-coverage-report) to see the full information about tests code coverage report of this project. \u003cbr\u003e\n\n\u003e [!NOTE]\n\u003e The tests code coverage report created by [`Jest`](https://jestjs.io) and [`Istanbul`](https://istanbul.js.org/).\n\n### Tests in CD pipline:\n\nTests process is included in `continuous-deployment.yml` workflow to ensure that all tests passed successfully\nand the new changes didn't make any errors before building and deploying the project to production environment.\n\nIf all tests in `continuous-deployment.yml` workflow passed successfully, `Jest` using `istanbul` will create\na new code coverage report for the tests and this new report will be pushed to [`AM-store-server-tests-code-coverage-report`](https://github.com/AbdulrhmanGoni/AM-store-server-tests-code-coverage-report) repository.\n\n## Feedbacks :incoming_envelope:\n\nI welcome any feedback or suggestions you might have! \u003cbr\u003e\nif you faced any problem in the project or you have any suggestion improves it,\nor even you have some advices to improve me and my skills, \u003cbr\u003e\nPlease feel free to open an issue and discuss it with me or contact me directly on [my LinkedIn account](https://www.linkedin.com/in/abdulrhman-goni-857a36275/)\nor throuth my email abdulrhmangoni@gmail.com\n\nThank you for stopping by! 🌟\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulrhmangoni%2Fam-store-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdulrhmangoni%2Fam-store-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulrhmangoni%2Fam-store-server/lists"}