{"id":20429015,"url":"https://github.com/yossef-khaled/storefront-server","last_synced_at":"2026-04-20T13:33:38.539Z","repository":{"id":109524632,"uuid":"531224687","full_name":"yossef-khaled/storefront-server","owner":"yossef-khaled","description":"An API for a store database.","archived":false,"fork":false,"pushed_at":"2022-09-11T14:32:02.000Z","size":213,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-15T16:55:15.069Z","etag":null,"topics":["db-migrate","express","postgresql"],"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/yossef-khaled.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-08-31T19:13:41.000Z","updated_at":"2022-09-12T14:21:54.000Z","dependencies_parsed_at":"2023-07-28T09:30:19.532Z","dependency_job_id":null,"html_url":"https://github.com/yossef-khaled/storefront-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yossef-khaled%2Fstorefront-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yossef-khaled%2Fstorefront-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yossef-khaled%2Fstorefront-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yossef-khaled%2Fstorefront-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yossef-khaled","download_url":"https://codeload.github.com/yossef-khaled/storefront-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241975134,"owners_count":20051428,"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":["db-migrate","express","postgresql"],"created_at":"2024-11-15T07:32:30.942Z","updated_at":"2026-04-20T13:33:33.516Z","avatar_url":"https://github.com/yossef-khaled.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# storefront-server\n\n## First, you need to install the packages listed in the `package.json` file using:\n\n\n### `yarn install`\n\n### Then, you need to build the app with `yarn build`\n**NOTE : This command will create the DB, the tables, \u0026 build the app into JS code**\n\n#### Backend PORT is: `3000`\n#### Database PORT is: `5432`\n\n### Available Scripts\nIn the project directory, you can run:\n\n `yarn build`\n### - To create the database, tables \u0026 then build the application\n***\n\n `yarn watch`\n### - To build the application \u0026 watch for changes in TS files\n***\n\n `yarn test`\n### - To run the test units\n***\n\n`yarn dev`\n### - To run the index.js file \n*Will listen on port 3000*  \n***\n\n### End points for each model :\n\n### **Users** :\n\n#### - index :\n- `Route`: /users\n- `Action` get\n- `Header` Authorization for token - `Value` for example (you can use the following string) : \neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlRlc3RfVXNlciIsImlkIjo4NSwiaWF0IjoxNjYyNDc2MTUwfQ.IzhpuSRZowqLnaWe4ewBFn0n9-5oSveijRjwwP6HNqc\n\n#### - show :\n- `Route`: /users/:id\n- `Action` get\n- `Header` Authorization for token - `Value` for example (you can use the following string) : \neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlRlc3RfVXNlciIsImlkIjo4NSwiaWF0IjoxNjYyNDc2MTUwfQ.IzhpuSRZowqLnaWe4ewBFn0n9-5oSveijRjwwP6HNqc\n \n#### - create :\n- `Route`: /users\n- `Action` post\n- `Body` {\n    firstname: *STRING*, \n    lastname: *STRING*, \n    password: *STRING*\n}\n\n*** \n\n### products :\n\n#### - index :\n- `Route`: /products\n- `Action` get\n\n#### - show :\n- `Routes`: /products/key=:key\u0026value=:Value for example :\n/products/key=id\u0026value=1 Will show product with id = 1\n/products/key=category\u0026value=Kitchen Will show products with category = Kitchen\n/products/key=topProducts\u0026value=5 Will show top 5 products\n- `Action` get\n\n#### - create :\n- `Route`: /products\n- `Action` post\n- `Header` Authorization for token - `Value` for example (you can use the following string) : \neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlRlc3RfVXNlciIsImlkIjo4NSwiaWF0IjoxNjYyNDc2MTUwfQ.IzhpuSRZowqLnaWe4ewBFn0n9-5oSveijRjwwP6HNqc\n- `Body` {\n    name: *STRING*, \n    price: *NUMBER*, \n    category: *STRING*\n} \n \n#### - add product to cart (orders that has a status = 'inCart' are refered to  as carts) :\n- `Route`: /products/addToCart=:orderId for example :\nproducts/addToCart=1 Will add \n- `Action` post\n- `Header` Authorization for token - `Value` for example (you can use the following string) : \neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlRlc3RfVXNlciIsImlkIjo4NSwiaWF0IjoxNjYyNDc2MTUwfQ.IzhpuSRZowqLnaWe4ewBFn0n9-5oSveijRjwwP6HNqc\n \n***\n\n### orders :\n\n#### - order history :\n- `Route`: /orders\n- `Action` get\n- `Header` Authorization for token - `Value` for example (you can use the following string) : \neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlRlc3RfVXNlciIsImlkIjo4NSwiaWF0IjoxNjYyNDc2MTUwfQ.IzhpuSRZowqLnaWe4ewBFn0n9-5oSveijRjwwP6HNqc\n\n#### - current order :\n- `Route`: /orders/current\n- `Action` get\n- `Header` Authorization for token - `Value` for example (you can use the following string) : \neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlRlc3RfVXNlciIsImlkIjo4NSwiaWF0IjoxNjYyNDc2MTUwfQ.IzhpuSRZowqLnaWe4ewBFn0n9-5oSveijRjwwP6HNqc\n\n#### - create an order :\n- `Route`: /orders\n- `Action` post\n- `Header` Authorization for token - `Value` for example (you can use the following string) : \neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlRlc3RfVXNlciIsImlkIjo4NSwiaWF0IjoxNjYyNDc2MTUwfQ.IzhpuSRZowqLnaWe4ewBFn0n9-5oSveijRjwwP6HNqc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyossef-khaled%2Fstorefront-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyossef-khaled%2Fstorefront-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyossef-khaled%2Fstorefront-server/lists"}