{"id":15168524,"url":"https://github.com/wnawa/backend-store-api","last_synced_at":"2026-02-06T10:12:11.081Z","repository":{"id":190475839,"uuid":"579407197","full_name":"wnawa/Backend-store-api","owner":"wnawa","description":"Api for online store to showcase great products where user accounts can be created and users can make orders.","archived":false,"fork":false,"pushed_at":"2023-11-22T12:54:46.000Z","size":17197,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T09:34:11.219Z","etag":null,"topics":["bcrypt","cors","db-migrate","dotenv","environment-variables","eslint","express","jasmine","json","jwt","nodejs","nodemon","postgresql","prettier","supertest","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/wnawa.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":"2022-12-17T15:41:47.000Z","updated_at":"2023-11-22T12:50:02.000Z","dependencies_parsed_at":"2024-09-22T21:01:31.595Z","dependency_job_id":"5890bf6a-21ea-4dae-b760-c0a40f0651b4","html_url":"https://github.com/wnawa/Backend-store-api","commit_stats":null,"previous_names":["wnawa/backend-store-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnawa%2FBackend-store-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnawa%2FBackend-store-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnawa%2FBackend-store-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnawa%2FBackend-store-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wnawa","download_url":"https://codeload.github.com/wnawa/Backend-store-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248059281,"owners_count":21040910,"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":["bcrypt","cors","db-migrate","dotenv","environment-variables","eslint","express","jasmine","json","jwt","nodejs","nodemon","postgresql","prettier","supertest","typescript"],"created_at":"2024-09-27T06:20:41.416Z","updated_at":"2026-02-06T10:12:11.049Z","avatar_url":"https://github.com/wnawa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API Description\nThe company stakeholders want to create an online storefront to showcase their great product ideas. Users need to be able to browse an index of all products, see the specifics of a single product, and add products to an order that they can view in a cart page. I have been tasked with building the API that will support this application, \nand I built a sample frontend APP too.\n\nThese are the notes that describe what endpoints the API needs to supply, as well as data shapes the frontend and backend have agreed to meet the requirements of the application. \n\n## API Endpoints\n#### Products\n- Index \n- Show\n- Create [token required]\n- Top 5 most popular products \n- Products by category (args: product category)\n\n#### Users\n- Index [token required]\n- Show [token required]\n- Create N[token required]\n\n#### Orders\n- Current Order by user (args: user id)[token required]\n- [OPTIONAL] Completed Orders by user (args: user id)[token required]\n\n## Data Shapes\n#### Product\n-  id\n- name\n- price\n- [OPTIONAL] category\n\n#### User\n- id\n- firstName\n- lastName\n- password\n\n#### Orders\n- id\n- id of each product in the order\n- quantity of each product in the order\n- user_id\n- status of order (active or complete)\n\n## Migrate Create and drop database\n   \n#### Add database connection details in .env file \n    enviroment variable used :\n    POSTGRES_HOST=localhost\n    POSTGRES_DB=my_db\n    POSTGRES_TEST_DB=my_db_test\n    POSTGRES_USER=postgres\n    POSTGRES_PASSWORD=\"1234\"\n    POSTGRES_DBPORT=5432\n    ENV=dev\n    BCRYPT_PASSWORD=secretpassword\n    SALT_ROUNDS=10\n    TOKEN_SECRET=MYSECRET\n    PORT=8080\n\n## Database setup CMD\n    npm install -g db-migrate\n    npm i db-migrate db-migrate-pg\n    db-migrate create products_table --sql-file\n    db-migrate create users_table --sql-file\n    db-migrate create Orders-table --sql-file\n    db-migrate create OrderDetails-table --sql-file\n    npm run db-migrate-up\n    (RUN down CMD WHEN NEEDED)\n    npm run db-migrate-down\n\n## Unite Testing is done using Jasmine\n#### Jasmine Setup\n    IN Jasmine.json SET RANDOM=FALSE;\n    npm run test\n\n## Build and Start CMD\n npm run dev-server\n\n## END POINTS API \n#### For API Testing ADD token to header authentication with Bearer \ntoken =eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjo0LCJmaXJzdG5hbWUiOiJhaG1lZCIsImxhc3RuYW1lIjoibW9oZSIsInBhc3N3b3JkIjoiJDJiJDEwJGFkUXVvL05DdjY4SnA0NENISFguc08zWlZ1Q1JGZUtaOFVER0VuSC9pYkdwVUtyd0tTZ095IiwidXNlcm5hbWUiOiJhaG1lZGVyZmFuIn0sImlhdCI6MTY3MDk0OTQ0Nn0.4V-sSzRkmSYw4W4ThE0QOcgMLOEow3il6zFaCbzy4o0\n\n## END POINTS API URL for USER MODEL\n#### Add New User\nPOST http://localhost:8080/Signup?id=4\u0026firstname=ahmed\u0026lastname=mohe\u0026password=555\u0026username=ahmederfan\n### updates User to removing id \nPOST http://localhost:8080/Signup?firstname=ahmed\u0026lastname=mohe\u0026password=555\u0026username=ahmederfan\n### Authenticate User\nGET http://localhost:8080/authenticate?username=ahmederfan\u0026password=555 \n### Get User\nGET http://localhost:8080/user\n### Get User By id\nGET http://localhost:8080/user/:userID\n\n\n## END POINTS API URL for PRODUCT MODEL\n#### Add New Product\nPOST http://localhost:8080/Products?id=3\u0026name=third\u0026price=300\n#### Get Products\nGET http://localhost:8080/Products\n#### Get Products by Id 3\nGET http://localhost:8080/Products/3 \n\n## END POINTS API URL for ORDER MODEL\n### ADD NEW ORDER WITH NEW PRODUCT TO USER\nPOST http://localhost:8080/user/:userID/Order/:orderID/product\n#### Note: Add the following data in the body inputs to add product details to the cart of order 1 for testing\n{\n\"quantity\":\"5\",\n\"productid\":\"3\"\n}\n### Get EXISTING ORDER for user with userID\nGET http://localhost:8080/user/:userID/Order \n\n### ADD NEW PRODUCT TO EXISTING ORDER \nPOST http://localhost:8080/Order/:orderID/product  \n#### Note: Add the following data in the body inputs to add product details to the cart of order 1 for testing\n{\n\"quantity\":\"5\",\n\"productid\":\"3\"\n}\n\n## END POINT API URL for DASHBOARD\nGET http://localhost:8080/userorder\n\n## END POINT API URL for Top Products\nGET http://localhost:8080/topproducts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwnawa%2Fbackend-store-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwnawa%2Fbackend-store-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwnawa%2Fbackend-store-api/lists"}